User Assets
Confirm upload
Step 3 of uploading an asset: register the uploaded file as an asset.
https://api.sangtao.ai/v2/user-assets/confirmAuthorization
X-Api-Keystring · headerrequiredYour API key, from the API keys page of your account.
Body
fileKeystringrequiredThe fileKey presign gave back
fileNamestringrequiredOriginal file name
contentTypestringrequiredMIME type
fileSizeBytesnumberrequiredFile size in bytes
purposestringAsset purpose — what each is used for: Purpose values under Create upload link
Available options:
outro_videointro_videologowatermarkbackground_musicvoiceoverthumbnailgenerallabelstringDisplay label
durationSecnumberDuration in seconds (video/audio)
aspectRatiostringAspect ratio (e.g. "16:9")
Response
The asset, with these fields:
idstringrequiredAsset ID, ua_ followed by 9 letters and digits (e.g. "ua_3kT9qPz0B")
urlstringrequiredPublic URL of the asset
fileNamestringrequiredOriginal file name
mimeTypestringrequiredMIME type (e.g. "video/mp4")
fileSizeBytesnumberrequiredFile size in bytes
categorystringrequiredAuto-detected
Available options:
videoimageaudiodocumentpurposestringrequiredAsset purpose
Available options:
outro_videointro_videologowatermarkbackground_musicvoiceoverthumbnailgenerallabelstringDisplay label (nullable)
thumbnailUrlstringThumbnail URL (nullable)
durationSecnumberDuration in seconds (video/audio)
aspectRatiostringAspect ratio
hasAudiobooleanWhether file has audio track (video/audio)
createdAtstringISO 8601 creation timestamp
Errors
| Status | errorCode | When |
|---|---|---|
| 400 | UNSUPPORTED_FILE_TYPE | The content type is not allowed for this category (see Category Limits) |
| 400 | VALIDATION_ERROR | fileKey is missing |
| 400 | UPLOAD_FAILED | The uploaded file could not be confirmed (storage error) — try again |
| 409 | ASSET_ALREADY_CONFIRMED | This fileKey has already been confirmed |
| 429 | QUOTA_EXCEEDED | The category's file count or storage cap is reached |
/user-assets/confirmcurl -X POST "https://api.sangtao.ai/v2/user-assets/confirm" \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"fileKey": "d15ed…/user-assets/1e65….png",
"fileName": "my-logo.png",
"contentType": "image/png",
"fileSizeBytes": 245000,
"purpose": "logo"
}'{
"success": true,
"data": {
"id": "ua_3kT9qPz0B",
"url": "https://blob.sangtao.ai/user-assets/abc123/my-logo.png",
"fileName": "my-logo.png",
"mimeType": "image/png",
"fileSizeBytes": 245000,
"category": "image",
"purpose": "logo",
"label": "My Brand Logo",
"thumbnailUrl": null,
"durationSec": null,
"aspectRatio": null,
"hasAudio": false,
"createdAt": "2026-06-08T10:30:00Z"
}
}/user-assets/confirmcurl -X POST "https://api.sangtao.ai/v2/user-assets/confirm" \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"fileKey": "d15ed…/user-assets/1e65….png",
"fileName": "my-logo.png",
"contentType": "image/png",
"fileSizeBytes": 245000,
"purpose": "logo"
}'{
"success": true,
"data": {
"id": "ua_3kT9qPz0B",
"url": "https://blob.sangtao.ai/user-assets/abc123/my-logo.png",
"fileName": "my-logo.png",
"mimeType": "image/png",
"fileSizeBytes": 245000,
"category": "image",
"purpose": "logo",
"label": "My Brand Logo",
"thumbnailUrl": null,
"durationSec": null,
"aspectRatio": null,
"hasAudio": false,
"createdAt": "2026-06-08T10:30:00Z"
}
}