sangtao.ai
API key

Webhooks

Update an endpoint

Change an endpoint’s URL, events or note, or turn it off and on.

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

Body

  • urlstring

    A new URL, checked as when creating

  • eventsstring[]

    Replaces the list

    Available options:*image.completedimage.failedvideo.completedvideo.failedpost.publishedpost.failedsocial_account.needs_attention

  • descriptionstring

    Up to 200 characters

  • enabledboolean

    false stops deliveries. true turns it back on, also after disabled_failing

Send only what changes. The answer is the whole endpoint.

Errors

StatuserrorCodeWhen
404WEBHOOK_NOT_FOUNDNo endpoint of yours with this id
422INVALID_WEBHOOK_URLurl is not a public https URL on port 443, or carries a user or password
422INVALID_WEBHOOK_EVENTevents is empty or has an unknown type — the allowed ones in details[0].params.allowed
422VALIDATION_ERRORdescription is over 200 characters
PATCH/webhooks/{id}
curl -X PATCH "https://api.sangtao.ai/v2/webhooks/whk_4nP8rT2xK" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "events": [
      "*"
    ]
  }'
{
  "success": true,
  "data": {
    "id": "whk_4nP8rT2xK",
    "url": "https://example.com/webhooks/sangtao",
    "events": [
      "*"
    ],
    "description": "Production",
    "enabled": true,
    "status": "active",
    "createdAt": "2026-11-10T08:00:00Z",
    "lastDeliveryAt": "2026-11-10T09:43:32Z",
    "lastSuccessAt": "2026-11-10T09:43:32Z",
    "lastFailureAt": null
  }
}