Skip to content

Upload Session File

POST/v1/agents/sessions/{session_id}/files

SandBase extension. Upload one file (multipart field file, up to 5 MiB) into the Session workspace. Idempotency-Key is required. Supported extensions: .txt, .md, .csv, .log, .json, .pdf, .png, .jpg, .jpeg, .webp; content must match the extension. File names use letters, digits, spaces, dots, underscores, and hyphens. If the transfer fails the response is still 201 with status failed and error_code attachment_unavailable. Send a ready file with POST /v1/agents/sessions/{session_id}/events using file_ids.

Path parameters

stringsession_idrequired

Session ID (ses_ prefix).

Headers

stringIdempotency-Keyrequired

1-128 characters, no leading or trailing whitespace. Reuse the same key and body when retrying; the same key with a different body returns 409.

Request body

multipart/form-data.

filefilerequired

Exactly one file part.