Webhooks
Verify the signature over the timestamp, a period, and the exact raw body. Store event IDs to ignore duplicate deliveries. Retrying a delivery never repeats generation.
Add webhook#
curl -X POST 'https://platform.tongai.io/v1/webhook-endpoints' \ -H "Authorization: Bearer $TONG_API_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: 45be69f1-c266-4a09-a82c-bf3c6303eb03" \ -d '{ "url": "https://your-app.example/tong/events", "events": [ "operation.succeeded", "operation.failed", "operation.review_required", "usage.settled" ]}'Configuration
curl --versionChoose a key or connection with webhooks:manage and operations:read.
Verify the signature#
Tong-Event-Id: {event_uuid}Tong-Timestamp: {unix_seconds}Tong-Key-Version: 1Tong-Signature: v1={hex_hmac_sha256}
HMAC_SHA256(signing_secret, timestamp + "." + raw_body)Delivery history#
POST /v1/webhook-endpoints/{id}/rotate-secretGET /v1/webhook-endpoints/{id}/deliveriesPOST /v1/webhook-endpoints/{id}/deliveries/{delivery_id}/retryGET /v1/webhook-endpointsRead the selected owned resource or current workflow state without starting a new generation.POST /v1/webhook-endpointsUse the documented request fields and permissions for this HTTP endpoint.PATCH /v1/webhook-endpoints/{id}Use the documented request fields and permissions for this HTTP endpoint.POST /v1/webhook-endpoints/{id}/rotate-secretUse the documented request fields and permissions for this HTTP endpoint.GET /v1/webhook-endpoints/{id}/deliveriesRead the selected owned resource or current workflow state without starting a new generation.POST /v1/webhook-endpoints/{id}/deliveries/{delivery_id}/retryUse the documented request fields and permissions for this HTTP endpoint.