/v2/agents/sessions/{session_id}/workspace/uploadUpload a file to a session workspace
Upload a file or tar archive to a path in a session's sandbox workspace. Send the raw bytes in the request body and use is_archive to have the guest extract a tar stream under the destination path. Include X-Content-Sha256 to verify the payload after it is written; uploads are capped at 500 MiB.
- IdempotentThe SDK sends
Idempotency-Key, so a retried request is only applied once.
A 400 is returned when the path query parameter is missing or invalid, or the X-Content-Sha256 header digest does not match; a 401 indicates invalid authentication credentials; a 402 indicates the team is blocked by the prepayment gate; a 403 indicates the path resolves outside the workspace or the session belongs to another team; a 404 indicates the resource was not found. A 409 is returned when the session has no sandbox or it is not ready; a 413 when the payload exceeds the maximum size; a 423 when the session is unavailable; a 429 when the API rate limit is exceeded; a 500 for a server error; a 501 when the active sandbox driver does not support workspace file transfers; a 502 when the upstream sandbox transfer fails; and a 503 when workspace transfer capacity is exhausted. The session_id path parameter must identify a session with an available sandbox, the path query parameter must stay within the workspace, and the request body must not exceed 500 MiB; if provided, the X-Content-Sha256 header must contain the payload's hex SHA-256 digest.