User Assets
Create upload link
Step 1 of uploading an asset: get a link to upload the file to, and the fileKey to confirm it with.
https://api.sangtao.ai/v2/user-assets/presignAuthorization
X-Api-Keystring · headerrequiredYour API key, from the API keys page of your account.
Upload and manage user media assets (videos, images, audio). Assets are used as intro/outro videos, logos, watermarks, background music, voiceovers, and thumbnails in video creation.
Files here are kept until you delete them, within each category's limits. Only need an image as a reference for the next image you create? Upload a reference image (temporary, deleted after 1 day).
Body
fileNamestringrequiredOriginal file name (e.g. "logo.png")
contentTypestringrequiredMIME type (e.g. "image/png", "video/mp4")
Response
uploadUrlstringWhere to send the file (step 2). Write access to this one file only; no X-Api-Key needed
methodstringThe method for that request: "PUT"
headersobjectSend exactly these headers with the file (Content-Type, and x-ms-blob-type when it is there) — read them from here, do not write them in your code
urlstringWhere the file can be read once uploaded
fileKeystringThe file's key — send it to confirm (step 3)
expiresInnumberSeconds until uploadUrl stops working (600). Use this one.
expiresAtstringThe same moment as a UTC time (ISO 8601) — kept for compatibility.
categorystringCategory worked out from contentType
Available options:
videoimageaudiodocumentmaxSizeBytesnumberLargest file allowed for this category, in bytes
allowedContentTypesstring[]MIME types this category takes
Errors
| Status | errorCode | When |
|---|---|---|
| 400 | UNSUPPORTED_FILE_TYPE | The content type is not allowed for this category (see Category Limits) |
| 429 | QUOTA_EXCEEDED | The category's file count or storage cap is reached |
| 500 | UPLOAD_FAILED | The upload link could not be created (storage error) — try again |
Upload Flow
1. POST /user-assets/presign → uploadUrl, method, headers, fileKey
2. PUT uploadUrl (the file) → with exactly those headers
3. POST /user-assets/confirm → fileKey: the file becomes an assetStep 2: Upload the file
Send the file to uploadUrl with the method and exactly the headers the presign response gives. Then confirm it with fileKey — until then it is not an asset.
curl -X PUT "UPLOAD_URL" \
-H "Content-Type: image/png" \
-H "x-ms-blob-type: BlockBlob" \
--data-binary @my-logo.pngPurpose Values
| Purpose | Used for |
|---|---|
| outro_video | Appended at end of rendered videos |
| intro_video | Prepended at start of rendered videos |
| logo | Overlay logo on video during render |
| watermark | Watermark overlay in render pipeline |
| background_music | Custom background music for all video types |
| voiceover | User-uploaded voice file (replaces TTS) |
| thumbnail | Custom thumbnail for published jobs |
| general | General reference files |
Category Limits
| Category | Content Types | Max Size | Max Items |
|---|---|---|---|
| video | video/mp4, video/webm | 500 MB | 20 |
| image | image/png, jpeg, webp, svg+xml, gif | 50 MB | 100 |
| audio | audio/mpeg, wav, ogg, aac | 100 MB | 30 |
| document | application/pdf, text/csv, application/json | 50 MB | 20 |
Next, once the file is uploaded: Confirm upload registers it as an asset.
/user-assets/presigncurl -X POST "https://api.sangtao.ai/v2/user-assets/presign" \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"fileName": "my-logo.png",
"contentType": "image/png"
}'{
"success": true,
"data": {
"uploadUrl": "https://…/user-assets/1e65….png?sv=…&sig=…",
"method": "PUT",
"headers": {
"Content-Type": "image/png",
"x-ms-blob-type": "BlockBlob"
},
"url": "https://cdn.sangtao.ai/user-assets/1e65….png",
"fileKey": "d15ed…/user-assets/1e65….png",
"expiresIn": 600,
"expiresAt": "2026-06-08T12:30:00Z",
"category": "image",
"maxSizeBytes": 52428800,
"allowedContentTypes": [
"image/png",
"image/jpeg",
"image/webp",
"image/svg+xml",
"image/gif"
]
}
}/user-assets/presigncurl -X POST "https://api.sangtao.ai/v2/user-assets/presign" \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"fileName": "my-logo.png",
"contentType": "image/png"
}'{
"success": true,
"data": {
"uploadUrl": "https://…/user-assets/1e65….png?sv=…&sig=…",
"method": "PUT",
"headers": {
"Content-Type": "image/png",
"x-ms-blob-type": "BlockBlob"
},
"url": "https://cdn.sangtao.ai/user-assets/1e65….png",
"fileKey": "d15ed…/user-assets/1e65….png",
"expiresIn": 600,
"expiresAt": "2026-06-08T12:30:00Z",
"category": "image",
"maxSizeBytes": 52428800,
"allowedContentTypes": [
"image/png",
"image/jpeg",
"image/webp",
"image/svg+xml",
"image/gif"
]
}
}