sangtao.ai
API key

User Assets

Confirm upload

Step 3 of uploading an asset: register the uploaded file as an asset.

POSThttps://api.sangtao.ai/v2/user-assets/confirm

Authorization

  • X-Api-Keystring · headerrequired

    Your API key, from the API keys page of your account.

Body

  • fileKeystringrequired

    The fileKey presign gave back

  • fileNamestringrequired

    Original file name

  • contentTypestringrequired

    MIME type

  • fileSizeBytesnumberrequired

    File size in bytes

  • purposestring

    Asset purpose — what each is used for: Purpose values under Create upload link

    Available options:outro_videointro_videologowatermarkbackground_musicvoiceoverthumbnailgeneral

  • labelstring

    Display label

  • durationSecnumber

    Duration in seconds (video/audio)

  • aspectRatiostring

    Aspect ratio (e.g. "16:9")

Response

The asset, with these fields:

  • idstringrequired

    Asset ID, ua_ followed by 9 letters and digits (e.g. "ua_3kT9qPz0B")

  • urlstringrequired

    Public URL of the asset

  • fileNamestringrequired

    Original file name

  • mimeTypestringrequired

    MIME type (e.g. "video/mp4")

  • fileSizeBytesnumberrequired

    File size in bytes

  • categorystringrequired

    Auto-detected

    Available options:videoimageaudiodocument

  • purposestringrequired

    Asset purpose

    Available options:outro_videointro_videologowatermarkbackground_musicvoiceoverthumbnailgeneral

  • labelstring

    Display label (nullable)

  • thumbnailUrlstring

    Thumbnail URL (nullable)

  • durationSecnumber

    Duration in seconds (video/audio)

  • aspectRatiostring

    Aspect ratio

  • hasAudioboolean

    Whether file has audio track (video/audio)

  • createdAtstring

    ISO 8601 creation timestamp

Errors

StatuserrorCodeWhen
400UNSUPPORTED_FILE_TYPEThe content type is not allowed for this category (see Category Limits)
400VALIDATION_ERRORfileKey is missing
400UPLOAD_FAILEDThe uploaded file could not be confirmed (storage error) — try again
409ASSET_ALREADY_CONFIRMEDThis fileKey has already been confirmed
429QUOTA_EXCEEDEDThe category's file count or storage cap is reached
POST/user-assets/confirm
curl -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"
  }
}