POST /v1/webhooks. Supported events are prompt.completed, prompt.failed, prompt.cancelled, prompt.paused, conversion.completed, conversion.failed, and conversion.cancelled.
signing_secret securely. It is returned on creation and idempotent replay, not on ordinary list responses.
Authenticate deliveries
Deliveries includewebhook-id, webhook-timestamp, and webhook-signature headers. To verify a signature:
- Remove
whsec_from the signing secret and base64-decode the rest into key bytes. - Preserve the raw request body. Do not parse and reserialize JSON before verification.
- Compute HMAC-SHA256 over the bytes of
webhook-id + "." + webhook-timestamp + "." + rawBody. - Base64-encode the digest and compare the
v1,signature using a constant-time comparison. - Enforce a timestamp tolerance suitable for your service and deduplicate accepted event IDs to prevent replay and duplicate processing.
Retention and delivery management
When usingretention.delete_after_webhook_id, the endpoint must belong to your account and subscribe to the matching completion event. Download and durably store the result before acknowledging that completion event with 2xx, because acknowledgement can delete its retained content.
List delivery attempts with GET /v1/webhooks/{id}/deliveries. Retry an eligible failed delivery explicitly with POST /v1/webhooks/{id}/deliveries/{delivery_id}/retry and its own idempotency key. Webhook receipt does not remove your ability to poll a job.