curl --request POST \
--url https://api.staging.bma.beeos.ai/v1/sessions/{session_id}/resources \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"type": "file",
"file_id": "<string>",
"mount_path": "<string>"
}
'import requests
url = "https://api.staging.bma.beeos.ai/v1/sessions/{session_id}/resources"
payload = {
"type": "file",
"file_id": "<string>",
"mount_path": "<string>"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({type: 'file', file_id: '<string>', mount_path: '<string>'})
};
fetch('https://api.staging.bma.beeos.ai/v1/sessions/{session_id}/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/v1/sessions/{session_id}/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("x-api-key", "<api-key>")
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>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"type": "error",
"error": {
"type": "<string>",
"message": "<string>",
"code": "<string>"
}
}Mount one project file into the session (BMA extension)
Mounts an uploaded project file by reference. The Anthropic contract
mounts files through resources on POST /v1/sessions; this extension
mounts into an existing session. The file is read-only at mount_path
(default /mnt/session/uploads/<file_id>), and the response file_id
is the session instance created for the mount, not the project file’s
own id.
curl --request POST \
--url https://api.staging.bma.beeos.ai/v1/sessions/{session_id}/resources \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"type": "file",
"file_id": "<string>",
"mount_path": "<string>"
}
'import requests
url = "https://api.staging.bma.beeos.ai/v1/sessions/{session_id}/resources"
payload = {
"type": "file",
"file_id": "<string>",
"mount_path": "<string>"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({type: 'file', file_id: '<string>', mount_path: '<string>'})
};
fetch('https://api.staging.bma.beeos.ai/v1/sessions/{session_id}/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/v1/sessions/{session_id}/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("x-api-key", "<api-key>")
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>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"type": "error",
"error": {
"type": "<string>",
"message": "<string>",
"code": "<string>"
}
}Authorizations
BMA organization API key.
Headers
Project to operate in. Required when the key can read more than one
project and the deployment has no default project.
anthropic-workspace-id is accepted as an alias.
Path Parameters
1Body
file The project file (file_...) to mount.
^file_[a-z2-7]{26}$Absolute path below /mnt/session/uploads the session's tools read
the file at. A path outside it is placed under it. Defaults to
/mnt/session/uploads/<file_id>.
1 - 4096Response
The mounted resource.
Opaque, stable resource id.
^sesrsc_[a-z2-7]{26}$file The session instance created for the mount.
^file_[a-z2-7]{26}$