sangtao.ai
API key

User Assets

Update asset

Change an asset's label or purpose.

PUThttps://api.sangtao.ai/v2/user-assets/{id}

Authorization

  • X-Api-Keystring · headerrequired

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

Path parameters

  • idstringrequired

    The ID in the path.

The {id} in the path is the asset's id, e.g. ua_3kT9qPz0B. Old numeric ids are still accepted.

Body

  • labelstring

    New display label

  • purposestring

    New purpose

    Available options:outro_videointro_videologowatermarkbackground_musicvoiceoverthumbnailgeneral

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
404ASSET_NOT_FOUNDAsset not found or doesn't belong to user
PUT/user-assets/{id}
curl -X PUT "https://api.sangtao.ai/v2/user-assets/ua_3kT9qPz0B" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "label": "New Label",
    "purpose": "watermark"
  }'
{
  "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": "watermark",
    "label": "New Label",
    "thumbnailUrl": null,
    "durationSec": null,
    "aspectRatio": null,
    "hasAudio": false,
    "createdAt": "2026-06-08T10:30:00Z"
  }
}