/v1/asset-buckets/{uid}/uploadsStarts an upload by reserving an object and returning a presigned URL to send the file to. No file data goes through this endpoint.
Upload flow:
- Call this endpoint with the file's name, content type and size. The object is created
with status
pending_upload. - Send the file's bytes with an HTTP
PUTtoupload_url(methodis alwaysPUT), setting every header inheadersexactly as returned. For public buckets these includex-amz-acl: public-readand aCache-Controlheader. The URL expires atexpires_at(10 minutes by default). - Call Complete an upload with
object_idto mark the objectready. Onlyreadyobjects count towards storage usage and can be read with Create an object read URL.
curl -X PUT "$UPLOAD_URL" \
-H "Content-Type: application/pdf" \
-H "x-amz-acl: public-read" \
-H "Cache-Control: public, max-age=31536000, immutable" \
--data-binary @report.pdfThe object's key is generated for you. It is the bucket's key prefix, then key_prefix
(if sent), then a slug of the file name with a short unique suffix, for example
report-d5e6f7.pdf.
Things to know:
- Allowed content types and extensions:
application/pdf(.pdf), Word.docx(application/vnd.openxmlformats-officedocument.wordprocessingml.document),image/gif,image/jpeg(.jpg,.jpeg),image/png,image/svg+xml,image/webp,text/csv,text/html(.html,.htm),text/markdownandtext/x-markdown(.md),text/plain(.txt,.md,.csv),application/vnd.apple.mpegurlandapplication/x-mpegurl(.m3u8),video/mp2t(.ts),video/mp4,video/quicktime(.mov,.qt),video/webm,video/x-matroska(.mkv) andvideo/x-msvideo(.avi). - If
filenamehas an extension, it must matchcontent_type. size_bytesmust be above zero and no larger than the maximum upload size (1 GiB by default, shown asmax_upload_bytesin Get workspace bucket usage).- The upload is rejected with
403if it would take your account's file storage past the free allowance. - The bucket must be
ready.
Requires the resource write permission (owner, admin or developer role).
Authentication
Send your API key as Authorization: Bearer <token>. The request is scoped to the workspace in X-Workspace-Slug.
Path parameters
uidstringRequiredThe bucket's uid.
Headers
X-Workspace-SlugstringRequiredSlug of the workspace the request acts on. You can also pass it as the workspace_slug query parameter.
Request body
filenamestringRequiredOriginal file name. Used for the object's filename and to build its key. Its extension must match content_type.
content_typestringRequiredMIME type of the file. Case-insensitive. Must be one of the allowed types listed above.
size_bytesintegerRequiredSize of the file in bytes. Must be above zero and within the maximum upload size.
min 1
key_prefixstringOptional folder path to place the object in, for example invoices/2026.
Leading and trailing slashes are ignored. Each folder name must start with a
letter or number and may contain only letters, numbers, spaces, dots, dashes and
underscores.
max length 512
Response
The object was reserved and a presigned upload URL was created.
successbooleanRequiredtrue when the request succeeded.
messagestringRequiredHuman-readable status message.
dataobjectShow attributesHide attributes
object_idstringRequiredUID of the reserved object. Pass it to Complete an upload after the PUT succeeds.
keystringRequiredGenerated object key inside the S3 bucket.
upload_urlstringRequiredPresigned URL to PUT the file's bytes to. Valid until expires_at.
public_urlstringRequiredPermanent URL the object will have on the public assets host.
read_urlstringURL to read the object once uploaded. Presigned in private buckets, otherwise the public URL. Omitted if it could not be created.
read_url_expires_atstring (date-time)When read_url stops working. Only present when it is signed.
read_url_is_signedbooleanRequiredtrue when read_url is a presigned, expiring URL.
methodstringRequiredHTTP method to use with upload_url. Always PUT.
One ofPUT
headersobjectRequiredHeaders you must send with the PUT, exactly as given. Always includes Content-Type. Public buckets also require x-amz-acl and Cache-Control.
expires_atstring (date-time)RequiredWhen upload_url expires (10 minutes after creation by default).
Errors
| Status | Meaning |
|---|---|
400 | Validation failed. Possible messages: invalid request (malformed JSON or a missing required field), filename is required, size_bytes must be greater than zero, file exceeds max upload size, unsupported file content_type, filename extension does not match content_type, filename must include a supported file extension, folder path is too long (max 512 characters) and folder names may only contain letters, numbers, spaces, dots, dashes, and underscores. |
401 | The API key is missing, invalid, expired or revoked. |
403 | Your role cannot upload, you cannot access the workspace, or the upload would exceed your account's free file storage allowance. |
404 | The bucket does not exist in this workspace. |
409 | The bucket is not ready. |
Errors use the standard error format.