Files
Upload a file
Start uploading an input file so the agent can use it in a Task.
POST
Uploads go straight to cloud storage — the API only hands you a presigned
target and never receives the bytes. The response’s Small files —
Large files —
upload_type tells you which
of two flows to run; it’s picked automatically from the bytes you declare
(large files use multipart), and there’s no maximum file size.
Small files — upload_type: "single"
POST /files/uploads(this call) — returns afile_id, a presignedupload_url, and thefieldsto send with the bytes.- Upload the bytes — POST them to
upload_urlas multipart form-data, with every key infieldsincluded as a form field (204 No Contenton success). POST /files/{file_id}/finalize— confirm the upload (empty body).
Large files — upload_type: "multipart"
POST /files/uploadsreturns afile_id, anupload_id, apart_size, and apart_count(noupload_url).- Split the file into
part_countchunks ofpart_sizebytes (the last chunk is whatever’s left). POST /files/{file_id}/partswith theupload_idand the part numbers you want → returns a presigned PUT URL per part. You can request them in batches.- PUT each chunk to its URL and keep the
ETagresponse header for that part number. POST /files/{file_id}/finalizewith{ "upload_id": "…", "parts": [{ "part_number": 1, "etag": "…" }, … ] }— cloud storage assembles the object.
file_id to a Task with
"file_ids": [...] on POST /messages.Authorizations
Requires an API key. See the Authentication guide.
Body
application/json
Response
200 - application/json
Upload started. upload_type=single → POST the bytes to upload_url with fields. upload_type=multipart → use upload_id + part_size + part_count with POST /files/{file_id}/parts.
Allowed value:
"upload_intent"Available options:
single, multipart 