Skip to content

Presign Upload

Generates a presigned upload URL for a new asset. The upload follows a two-step flow: first obtain the presigned URL, then PUT the file directly to object storage.

POST /v1/assets/presign
assets:write

Query Parameters

ParameterTypeRequiredDefaultDescription
filenamestringYesOriginal filename including extension (e.g. logo.png).
content_typestringNoapplication/octet-streamMIME type of the file being uploaded.
file_sizeintegerYesSize of the file in bytes. Maximum 25 MB (26,214,400 bytes).

Request Examples

Terminal window
# Step 1: Get presigned URL
curl -X POST "https://xqr.co/api/v1/assets/presign?filename=logo.png&content_type=image/png&file_size=48210" \
-H "Authorization: Bearer xqr_pk_a1b2c3d4.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
# Step 2: Upload file to the returned URL
curl -X PUT "https://storage.example.com/presigned-url..." \
-H "Content-Type: image/png" \
--data-binary @logo.png

Response

200 OK

The presigned upload details.

{
"data": {
"asset_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"upload_url": "https://us-east-1.linodeobjects.com/xqr-private/tenants/ws_abc/originals/a1b2c3d4.png?X-Amz-Algorithm=...",
"method": "PUT",
"headers": {
"Content-Type": "image/png"
}
},
"meta": {
"request_id": "req_2b3c4d5e6f7a8b90",
"rate_limit": {
"limit": 600,
"remaining": 596,
"reset": 1742572800
}
}
}

Was this page helpful?