sangtao.ai
API key

Webhooks

Get a delivery

One delivery: every attempt and the body sent.

GEThttps://api.sangtao.ai/v2/webhooks/deliveries/{deliveryId}

Authorization

  • X-Api-Keystring · headerrequired

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

Path parameters

  • deliveryIdstringrequired

    The deliveryId in the path.

Response

  • idstringrequired

    The delivery, dlv_…

  • eventIdstringrequired

    The event, evt_… — the same on a retry

  • eventTypestringrequired

    e.g. image.completed

  • statusstringrequired

    canceled: the endpoint was deleted or turned off before it went

    Available options:pendingsucceededfailedcanceled

  • attemptCountnumberrequired

    Attempts so far

  • lastHttpStatusnumber | null

    What your URL answered last

  • lastErrorstring | null

    Why the last attempt failed

  • nextAttemptAtstring | null

    The next retry. Only while pending

  • createdAtstringrequired

    When the delivery was queued

  • completedAtstring | null

    When it ended: succeeded, failed or canceled

  • attemptsobject[]required

    Every attempt, oldest first

    Show child attributes
    • atstringrequired

      When

    • httpStatusnumber | null

      What your URL answered. null: not reached

    • durationMsnumberrequired

      How long it took

    • responseSnippetstring | null

      The first 1 KB of your URL’s answer

    • errorstring | null

      A network error or timeout

  • payloadobjectrequired

    The body that was sent, parsed

  • bodystringrequired

    The body exactly as sent. Check a signature against this, not against payload

  • targetUrlstring

    The webhookUrl it went to. Only for way B (a delivery for a request’s webhookUrl)

Errors

StatuserrorCodeWhen
404DELIVERY_NOT_FOUNDNo delivery of yours with this id
GET/webhooks/deliveries/{deliveryId}
curl "https://api.sangtao.ai/v2/webhooks/deliveries/dlv_5Vt1kRm9P" \
  -H "X-Api-Key: YOUR_API_KEY"
{
  "success": true,
  "data": {
    "id": "dlv_5Vt1kRm9P",
    "eventId": "evt_8Kq2mXa7T",
    "eventType": "image.completed",
    "status": "succeeded",
    "attemptCount": 1,
    "lastHttpStatus": 200,
    "lastError": null,
    "nextAttemptAt": null,
    "createdAt": "2026-11-10T09:43:31Z",
    "completedAt": "2026-11-10T09:43:32Z",
    "attempts": [
      {
        "at": "2026-11-10T09:43:32Z",
        "httpStatus": 200,
        "durationMs": 143,
        "responseSnippet": "ok",
        "error": null
      }
    ],
    "payload": {
      "id": "evt_8Kq2mXa7T",
      "type": "image.completed",
      "createdAt": "2026-11-10T09:43:31Z",
      "apiVersion": "v2",
      "data": {
        "jobId": "acff47cbfacf4e27bbc08770c9ea246d",
        "status": "complete",
        "source": "api"
      }
    },
    "body": "{\"id\":\"evt_8Kq2mXa7T\",\"type\":\"image.completed\",\"createdAt\":\"2026-11-10T09:43:31Z\",\"apiVersion\":\"v2\",\"data\":{\"jobId\":\"acff47cbfacf4e27bbc08770c9ea246d\",\"status\":\"complete\",\"source\":\"api\"}}"
  }
}