Workflow
1
Upload file
POST /api/v1/cloud/files — upload text-based content.2
Mount on Session
POST /api/v1/cloud/sessions/{session_id}/resources — attach the uploaded file to the Session.3
Agent uses it
The Agent reads the file’s contents during the Session and completes the task.
Upload a file
Parameters
Use the File object’s
downloadable field to decide whether /content is available.- Single file
- Multiple files
Mount on a session
After uploading, use the Resources API to mount the file on a specific Session:- Single file
- Multiple files
Managing files
Get file metadata
scope_id is supported for Session-scoped files.
Download a file
Files with"downloadable": true can be downloaded:
/content return 403 Forbidden.
End-to-end example
FAQ
Q: How long are uploaded files retained? A: Files are retained until you explicitly delete them viaDELETE /api/v1/cloud/files/{file_id}. A file that is still referenced by an active Session cannot be deleted — remove or detach the Session first.
Q: Can I attach files when creating a Session?
A: Yes. Pass file resources in the resources field when creating the Session. See Sessions — Attach Resources at Creation.
Q: Why can’t I download some files?
A: For security, some files are only available for the Agent’s internal use. To export results, use files whose File object returns "downloadable": true.
Q: Which file formats are supported?
A: The upload API accepts text-based files. Code, configuration, and plain-text reference documents work best.
Next steps
Start a session
Attach files at session creation time.
Build persistent memory
Persist Agent knowledge across Sessions.
Files API
The full Files API surface.