Reserve a direct upload from the widget
Reserves storage for a file and returns a one-time URL to PUT the bytes to. Two steps, not one:
POSThere with the file’s name, size, MIME type and base64 MD5 checksum.PUTthe bytes todirect_upload.urlwith the headers it gives you. The upload is rejected if the bytes disagree with the size or checksum you declared.
Then send signed_id as the attachment when you create the message. This is the widget’s only upload path — the account-level POST /upload needs an api_access_token, which a widget session does not have.
Authorizations
The signed session token from POST /api/v1/widget/config. Sent alongside website_token in the query string on every widget request. See /api-reference/widget-api-authentication.
Query Parameters
The web-widget inbox's public token, as it appears in your widget snippet. Required on every widget request.
"EXAMPLE_WEBSITE_TOKEN"
Body
Describe the file before sending it. All four fields are required, and the subsequent PUT is rejected if the bytes disagree with byte_size or checksum.
Response
Success
The stored blob plus the one-time URL to PUT the bytes to. This is Rails' ActiveStorage direct-upload response, passed through unchanged.
The blob's numeric ID.
The storage key.
The filename you declared.
The content type you declared.
The size you declared. The upload is rejected if the bytes do not match it.
The base64 MD5 you declared. The upload is rejected if the bytes do not match it.
Metadata ActiveStorage derives once the bytes arrive.
Which storage service holds it.
ISO-8601 timestamp.
What you send as the attachment reference when creating the message.
Signed global ID for the blob, used by rich-text attachment flows.
Where and how to send the bytes.