Skip to main content

Deliveries

Deliveries

Every attempt to POST an event to an endpoint is recorded, and the history is queryable:

curl -X POST https://api.travila.ai/api/v1/webhooks/list-deliveries \
-H "X-API-Key: sk_your_key_here" \
-H "Content-Type: application/json" \
-d '{
"endpointId": "ep_abc123",
"status": "DELIVERY_STATUS_FAILED",
"createdAfter": "2026-08-01T00:00:00Z",
"perPage": 50
}'

All filters are optional and combine: endpointId, subscriptionId, eventId, status, createdAfter, createdBefore, plus page / perPage.

StatusMeaning
DELIVERY_STATUS_SCHEDULEDQueued, not yet attempted
DELIVERY_STATUS_PROCESSINGAttempt in flight
DELIVERY_STATUS_SUCCESSYour endpoint accepted it
DELIVERY_STATUS_RETRYFailed, will be retried automatically
DELIVERY_STATUS_FAILEDRetries exhausted
DELIVERY_STATUS_DISCARDEDNot attempted — e.g. the endpoint was disabled

Retrying

RETRY deliveries are re-attempted for you. Re-queue a FAILED or DISCARDED one by hand once you have fixed the receiving side:

curl -X POST https://api.travila.ai/api/v1/webhooks/retry-delivery \
-H "X-API-Key: sk_your_key_here" \
-H "Content-Type: application/json" \
-d '{ "deliveryId": "del_xyz789" }'

Receiving webhooks

Write your handler to survive the real world:

  • Return 2xx quickly. Acknowledge first, process afterwards. A slow handler burns the delivery attempt and earns a retry.
  • Expect duplicates. Retries mean the same event can arrive more than once. Deduplicate on the event id rather than assuming exactly-once.
  • Expect out-of-order arrival. A retried event can land after a newer one. Use the event's own timestamp, not receipt order.
  • Fail loudly, not silently. A non-2xx marks the delivery for retry, which is what you want when your downstream is briefly unavailable.