Files API
Manage files attached to your agents. You can upload files for an agent to access, download them securely, list existing files, and delete them. All endpoints require session authentication.Download a file
Query parameters
Response headers
Errors
The download URL format is
/api/files?download={id}. Files are only accessible to the user who uploaded them.List files
Query parameters
Response
File object
Errors
Upload a file
multipart/form-data encoding.
Request body (multipart/form-data)
Response (201)
Upload response fields
The GET endpoint returns
filename while the POST response returns name. Both refer to the sanitized filename of the uploaded file.Filename validation
Uploaded filenames are sanitized before storage:- Leading dots are stripped — files like
.envbecomeenv. A filename consisting entirely of dots (e.g.,...) becomes empty after stripping. - Unsafe characters are replaced — characters outside
a-zA-Z0-9._-are replaced with underscores. - Length is limited to 128 characters — filenames longer than 128 characters are truncated.
- Fallback naming — if the sanitized filename is empty, a fallback name of
upload_{timestamp}is used.
The stored filename may differ from the original filename you provided. Dotfiles (files starting with
.) cannot be uploaded — the leading dots are always removed.