file session object.
POST /revisions/:id/data/command (Command: upload_session_file)
This is a binary command: the file bytes are the
application/octet-stream request body, and the
JSON command below is serialized onto a single line into the X-Request-Body header instead of the
body. X-Request-Body is named in the API’s Access-Control-Allow-Headers, so a browser client can
send it.Request Body
Serialized intoX-Request-Body, not into the body itself:
The
alias must conform to the session-object alias grammar:
one or more /-separated segments of A–Z, a–z, 0–9, ., _, -, @; 1–256 characters total; no
segment may be . or ... An alias outside the grammar returns 400 invalid_session_object_alias. A successful
upload fires a session_object_modified session event.
Response
Unlikeupload_session_object, this command returns the created object’s full envelope, since the
server computes size and sha256 from the bytes it received:
Errors
unsupported_file_type—content_type(after dropping parameters and lower-casing) does not match any entry in the content-type allow-list.session_file_too_large— the uploaded bytes exceed the 4 MiB limit.session_file_size_mismatch— the declaredsizedoes not match the number of bytes actually received.invalid_file_object— the alias already names a session object that exists and is not afile.
Example
See also
- File session object — envelope shape and limits.
- Download Session File — read the bytes back.

