Upload a file
Upload a file into the session's uploads directory. By default the file is stored under uploads/{filename} within the session scope; pass path to push it to a custom object-storage-style key (e.g. data/2024/report.pdf), relative to the uploads mount (/mnt/user-data/uploads/ inside the sandbox). The relative path is returned as the file ID. Uploading a file to an existing key overwrites it.
Query parameters
Session / container identifier (matches the container field in chat requests).
Session / container identifier (matches the container field in chat requests).
Object-storage-style key for the uploaded file, relative to the uploads mount. Defaults to uploads/{filename}. Nested keys are supported and parent directories are created automatically. May be prefixed with uploads/ for convenience. Must be relative (no leading /), must not contain .. components, and must not end with /.
Object-storage-style key for the uploaded file, relative to the uploads mount. Defaults to uploads/{filename}. Nested keys are supported and parent directories are created automatically. May be prefixed with uploads/ for convenience. Must be relative (no leading /), must not contain .. components, and must not end with /.
Namespace for the file. Defaults to 'session'.
Namespace for the file. Defaults to 'session'.
Response
Successful Response
Example response
{
"created_at": "2024-01-15T10:30:00Z",
"downloadable": false,
"filename": "data.csv",
"id": "uploads/data.csv",
"mime_type": "text/csv",
"scope": {
"id": "session-abc123",
"type": "session"
},
"size_bytes": 4096,
"type": "file"
}