Ir a la documentación
Abrir panel
En esta página

Webhooks

Verifica la firma sobre la marca de tiempo, un punto y el cuerpo original exacto. Guarda los ID de eventos para ignorar duplicados. Reintentar una entrega no repite la generación.

Añadir 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"  ]}'
Configuración
curl --version

Elige una clave o conexión con webhooks:manage y operations:read.

Verificar firma#

HTTP
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)

Historial de entregas#

HTTP
POST /v1/webhook-endpoints/{id}/rotate-secretGET /v1/webhook-endpoints/{id}/deliveriesPOST /v1/webhook-endpoints/{id}/deliveries/{delivery_id}/retry