Skip to main content
POST
/
v1
/
storage
/
objects
Upload Object
curl --request POST \
  --url https://api.bctrl.ai/v1/storage/objects \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "file": {},
  "workspace": "<string>",
  "path": "<string>",
  "source": "<string>",
  "sessionId": "<string>",
  "driver": "<string>",
  "target": "<string>",
  "filename": "<string>"
}
'
{
  "id": "<string>",
  "workspace": "<string>",
  "logicalPath": "<string>",
  "objectKey": "<string>",
  "filename": "<string>",
  "sizeBytes": 123,
  "contentType": "<string>"
}
file
binary
required
File to upload (multipart/form-data).
workspace
string
Workspace name.
path
string
Logical path in storage.
source
string
Source identifier (e.g., screenshot).
sessionId
string
Associated session ID.
driver
string
Driver that produced this file.
target
string
RPC target that produced this file.
filename
string
Filename for the upload.

Examples

const storage = client.storage('my-workspace');

const result = await storage.uploadObject(screenshotBuffer, {
  source: 'screenshot',
  filename: 'page.png',
  sessionId: session.id,
});
console.log(result.id, result.sizeBytes);

Response

id
string
required
Object catalog ID.
workspace
string
required
Workspace name.
logicalPath
string
required
Logical path in storage.
objectKey
string
required
Raw storage key.
filename
string
required
Filename.
sizeBytes
number
required
File size in bytes.
contentType
string
required
MIME content type.