sangtao.ai
API key

Characters

Update a character

Change a character's name, appearance, biography and other names — all at once.

PUThttps://api.sangtao.ai/v2/characters/{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.

Replaces everything: a field you leave out becomes null. To keep a value, send it again. Reference images are not changed.

Body

  • namestringrequired

    Up to 100 characters

  • appearanceDescriptionstring

    Up to 1,000 characters

  • biographystring

    Up to 2,000 characters

  • aliasesstring

    Up to 200 characters

Response

The Character after the change.

Errors

StatuserrorCodeWhen
400VALIDATION_ERRORInvalid data — name missing, or a field over its limit
404CHARACTER_NOT_FOUNDNo such character, or it is not yours

An error has success: false, errorCode as above, and error is a sentence saying what went wrong.

PUT/characters/{id}
curl -X PUT "https://api.sangtao.ai/v2/characters/ch_3kT9qPz0B" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Mèo Mướp",
    "appearanceDescription": "orange tabby cat, chubby body, green eyes",
    "biography": null,
    "aliases": "Mướp"
  }'
{
  "success": true,
  "data": {
    "id": "ch_3kT9qPz0B",
    "name": "Mèo Mướp",
    "appearanceDescription": "orange tabby cat, chubby body, green eyes",
    "biography": null,
    "aliases": "Mướp",
    "publishStatus": null,
    "createdAt": "2026-11-08T09:12:44Z",
    "updatedAt": "2026-11-08T09:20:01Z",
    "refImages": [
      {
        "id": "ci_8hQ2mZr4K",
        "imageUrl": "https://…/a.png",
        "thumbnailUrl": "https://…/a_thumb.webp",
        "sortOrder": 0
      }
    ]
  }
}