Put a file at a specific path (object-storage style)

S3/blob-style put-object: store the raw request body at the given key. The key is relative to the session's uploads mount (`/mnt/user-data/uploads/` inside the sandbox) and may be nested, e.g. `data/2024/report.pdf`; an explicit `uploads/` prefix is accepted and normalized away. Parent directories are created automatically and existing keys are overwritten. The response is the same `FileMetadata` as `POST /v1/files`, so the returned `id` can be used with the other file endpoints.

Path parameters

file_idstringRequired

Query parameters

scope_idstringRequired

Session / container identifier.

namespacestringOptionalDefaults to session
Namespace for the file. Defaults to 'session'.

Request

Request payload.

Response

Successful Response
idstring

Relative path of the file within the session, e.g. ‘uploads/data.csv’ or ‘outputs/result.png’. Use this value as file_id in subsequent requests.

created_atdatetime

ISO-8601 timestamp when the file was created or last modified.

filenamestring
Filename derived from the path.
mime_typestring
MIME type detected from the file content.
size_bytesinteger
File size in bytes.
downloadableboolean

True for sandbox output files; False for uploaded input files.

scopeobject
Session scope this file belongs to.
type"file"OptionalDefaults to file
Object type discriminator, always 'file'.
etagstring or nullOptional

Content checksum (MD5 hex or S3 ETag). Present after stat; None if unavailable.

namespacestringOptionalDefaults to session

Namespace this file belongs to (e.g. ‘session’, ‘skills’, or a custom namespace).

Errors

400
Bad Request Error
401
Unauthorized Error
404
Not Found Error
422
Unprocessable Entity Error
503
Service Unavailable Error