Mount a file into a session
curl --request POST \
--url https://api.staging.bma.beeos.ai/api/v1/orgs/{orgID}/projects/{projectID}/agents/{agentID}/sessions/{sessionID}/resources \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "file",
"file_id": "<string>",
"mount_path": "<string>"
}
'import requests
url = "https://api.staging.bma.beeos.ai/api/v1/orgs/{orgID}/projects/{projectID}/agents/{agentID}/sessions/{sessionID}/resources"
payload = {
"type": "file",
"file_id": "<string>",
"mount_path": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({type: 'file', file_id: '<string>', mount_path: '<string>'})
};
fetch('https://api.staging.bma.beeos.ai/api/v1/orgs/{orgID}/projects/{projectID}/agents/{agentID}/sessions/{sessionID}/resources', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.staging.bma.beeos.ai/api/v1/orgs/{orgID}/projects/{projectID}/agents/{agentID}/sessions/{sessionID}/resources"
payload := strings.NewReader("{\n \"type\": \"file\",\n \"file_id\": \"<string>\",\n \"mount_path\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"id": "<string>",
"type": "file",
"file_id": "<string>",
"mount_path": "<string>",
"filename": "<string>",
"mime_type": "<string>",
"size_bytes": 123,
"digest": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"error": "<string>",
"code": "<string>",
"current_digest": "<string>",
"issues": [
{
"path": "<string>",
"message": "<string>",
"line": 2,
"column": 2
}
]
}{
"error": "<string>",
"code": "<string>",
"current_digest": "<string>",
"issues": [
{
"path": "<string>",
"message": "<string>",
"line": 2,
"column": 2
}
]
}{
"error": "<string>",
"code": "<string>",
"current_digest": "<string>",
"issues": [
{
"path": "<string>",
"message": "<string>",
"line": 2,
"column": 2
}
]
}{
"error": "<string>",
"code": "<string>",
"current_digest": "<string>",
"issues": [
{
"path": "<string>",
"message": "<string>",
"line": 2,
"column": 2
}
]
}{
"error": "<string>",
"code": "<string>",
"current_digest": "<string>",
"issues": [
{
"path": "<string>",
"message": "<string>",
"line": 2,
"column": 2
}
]
}{
"error": "<string>",
"code": "<string>",
"current_digest": "<string>",
"issues": [
{
"path": "<string>",
"message": "<string>",
"line": 2,
"column": 2
}
]
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}Files
Mount a file into a session
Mounts a project file, read-only, at mount_path below /mnt/session/uploads (default /mnt/session/uploads/<file_id>). The mount creates a new file_id, a session instance scoped to this session that references the same stored content: no bytes are copied, the instance does not count against the storage limit, and it stays readable after the original file is deleted. The session's storage tools read it at mount_path. Mounting the same file at the same path again returns the existing resource; another file at that path is 409. Only project files can be mounted, not session instances (404). A session holds at most 500 files.
POST
/
orgs
/
{orgID}
/
projects
/
{projectID}
/
agents
/
{agentID}
/
sessions
/
{sessionID}
/
resources
Mount a file into a session
curl --request POST \
--url https://api.staging.bma.beeos.ai/api/v1/orgs/{orgID}/projects/{projectID}/agents/{agentID}/sessions/{sessionID}/resources \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "file",
"file_id": "<string>",
"mount_path": "<string>"
}
'import requests
url = "https://api.staging.bma.beeos.ai/api/v1/orgs/{orgID}/projects/{projectID}/agents/{agentID}/sessions/{sessionID}/resources"
payload = {
"type": "file",
"file_id": "<string>",
"mount_path": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({type: 'file', file_id: '<string>', mount_path: '<string>'})
};
fetch('https://api.staging.bma.beeos.ai/api/v1/orgs/{orgID}/projects/{projectID}/agents/{agentID}/sessions/{sessionID}/resources', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.staging.bma.beeos.ai/api/v1/orgs/{orgID}/projects/{projectID}/agents/{agentID}/sessions/{sessionID}/resources"
payload := strings.NewReader("{\n \"type\": \"file\",\n \"file_id\": \"<string>\",\n \"mount_path\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"id": "<string>",
"type": "file",
"file_id": "<string>",
"mount_path": "<string>",
"filename": "<string>",
"mime_type": "<string>",
"size_bytes": 123,
"digest": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"error": "<string>",
"code": "<string>",
"current_digest": "<string>",
"issues": [
{
"path": "<string>",
"message": "<string>",
"line": 2,
"column": 2
}
]
}{
"error": "<string>",
"code": "<string>",
"current_digest": "<string>",
"issues": [
{
"path": "<string>",
"message": "<string>",
"line": 2,
"column": 2
}
]
}{
"error": "<string>",
"code": "<string>",
"current_digest": "<string>",
"issues": [
{
"path": "<string>",
"message": "<string>",
"line": 2,
"column": 2
}
]
}{
"error": "<string>",
"code": "<string>",
"current_digest": "<string>",
"issues": [
{
"path": "<string>",
"message": "<string>",
"line": 2,
"column": 2
}
]
}{
"error": "<string>",
"code": "<string>",
"current_digest": "<string>",
"issues": [
{
"path": "<string>",
"message": "<string>",
"line": 2,
"column": 2
}
]
}{
"error": "<string>",
"code": "<string>",
"current_digest": "<string>",
"issues": [
{
"path": "<string>",
"message": "<string>",
"line": 2,
"column": 2
}
]
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}Authorizations
bearerAuthbrowserSessionCookie & csrfHeader
An opaque BMA personal or organization bearer token.
Path Parameters
Organization ID (org_...).
Pattern:
^org_[a-z2-7]{26}$Project ID (proj_...).
Pattern:
^proj_[a-z2-7]{26}$Agent ID (agt_...).
Pattern:
^agt_[a-z2-7]{26}$Agent session ID (ses_...).
Pattern:
^ses_[a-z2-7]{26}$Body
application/json
Available options:
file File ID (file_...).
Pattern:
^file_[a-z2-7]{26}$Absolute path below /mnt/session/uploads; a path outside it is placed under it (/data.csv mounts at /mnt/session/uploads/data.csv). Defaults to /mnt/session/uploads/<file_id>.
Required string length:
1 - 4096Response
The mounted file.
A file mounted into a session. file_id is the session instance created for the mount, not the mounted file's id; GET /files/{file_id} and its content read it.
Pattern:
^sesrsc_[a-z2-7]{26}$Available options:
file File ID (file_...).
Pattern:
^file_[a-z2-7]{26}$Absolute path the session's tools read the file at.
Pattern:
^sha256:[0-9a-f]{64}$