Skip to content

Complete an upload

POST/v1/asset-objects/{uid}/complete

Marks an object created with Create an upload as ready after you have PUT its bytes to the presigned upload_url. Send no request body.

The file is checked in storage first. If it is not there yet, the call fails with 409 (the file has not been uploaded yet; upload it to upload_url before completing) and the object stays pending_upload, so you can upload and complete again. The object's size_bytes and ETag are then taken from storage, not from the size_bytes you sent when creating the upload.

Completing an object that is already ready is safe and returns it unchanged. The storage allowance is checked again here with the stored size. If completing the upload would take your account past its free file storage, the call fails with 403 and the uploaded file is removed from storage; the object stays pending_upload.

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

uidstringRequired

The object's uid (the object_id returned by Create an upload).

Headers

X-Workspace-SlugstringRequired

Slug of the workspace the request acts on. You can also pass it as the workspace_slug query parameter.

Response

200

The object is ready.

successbooleanRequired

true when the request succeeded.

messagestringRequired

Human-readable status message.

dataobject
Show attributes
uidstringRequired

Unique identifier of the object.

bucket_uidstringRequired

UID of the bucket the object belongs to.

keystringRequired

Full object key inside the S3 bucket.

filenamestringRequired

Original file name sent when the upload was created, or the last part of the key for objects written directly over S3.

content_typestringRequired

MIME type of the object.

size_bytesintegerRequired

Size of the object in bytes. Until the upload is completed this is the size_bytes sent when the upload was created; completing it replaces it with the size stored in the bucket.

statusstringRequired

pending_upload until the upload is completed, then ready.

One ofpending_uploadreadyfaileddeleted

public_urlstringRequired

Permanent URL of the object on the public assets host. Only readable without a signature in public buckets.

read_urlstring

URL to read the object. A presigned URL in private buckets, otherwise the public URL.

read_url_expires_atstring (date-time)

When read_url stops working. Only present when it is signed.

read_url_is_signedbooleanRequired

true when read_url is a presigned, expiring URL.

created_atstring (date-time)Required

When the object record was created.

last_failurestring

Why the object failed, if it did. Omitted otherwise.

Errors

StatusMeaning
401The API key is missing, invalid, expired or revoked.
403Your role cannot upload, you cannot access the workspace, or completing the upload would exceed your account's free file storage allowance.
404The object (or its bucket) does not exist in this workspace.
409The object is neither pending_upload nor ready (asset upload cannot be completed), or the file has not reached storage yet.

Errors use the standard error format.