Skip to main content

File object

Upload, get, and list endpoints return File objects.
FieldTypeDescription
idstringFile ID with the file_ prefix
typestringAlways "file"
filenamestringStored file name
size_bytesintegerFile size in bytes
mime_typestringMIME type supplied by the upload or detected from the file name
downloadablebooleanWhether this file can be downloaded through GET /api/v1/cloud/files/{file_id}/content
scopeobject | nullScope object when associated with another resource, for example { "id": "sess_...", "type": "session" }
metadataobjectCustom metadata object supplied on upload; defaults to {}
created_atstringUTC creation time in RFC 3339 format
GET /api/v1/cloud/files/{file_id}/content returns this object.
FieldTypeDescription
urlstringPresigned download URL
expires_atstringUTC expiration time for the URL in RFC 3339 format

Upload form fields

POST /api/v1/cloud/files uses multipart/form-data.
FieldTypeRequiredDescription
filefileYesText-based file content
namestringNoStored file name. Defaults to the uploaded file name. After server sanitization, length must be 1-255 bytes and cannot be . or ..
metadataJSON stringNoValid JSON encoded as a form field. Maximum raw length is 8 KB. Defaults to {}

Supported upload file types

The upload endpoint accepts text-based files only.
CategoryAccepted values
MIME typeAny text/* MIME type, plus application/json, application/xml, application/javascript, application/x-yaml, and application/x-toml
Extension.txt, .md, .csv, .json, .xml, .yaml, .yml, .toml, .ini, .conf, .cfg, .env, .log, .html, .htm, .css, .scss, .less, .js, .jsx, .ts, .tsx, .vue, .svelte, .py, .go, .rs, .java, .kt, .scala, .c, .cpp, .cc, .h, .hpp, .rb, .php, .swift, .r, .lua, .pl, .sh, .bash, .zsh, .fish, .ps1, .sql, .graphql, .gql, .proto, .dockerfile, .makefile, .gitignore, .editorconfig, .eslintrc, .prettierrc, .tex, .rst, .adoc, .org, .svg
Extensionless file namedockerfile, makefile, gemfile, rakefile, procfile, vagrantfile, justfile, brewfile

Attach and download files

Upload files to give your agent context, and download files it produces.