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 '{
"endpoint_id": "ep_abc123",
"status": "DELIVERY_STATUS_FAILED",
"created_after": "2026-08-01T00:00:00Z",
"per_page": 50
}'

All filters are optional and combine: endpoint_id, subscription_id, event_id, status, created_after, created_before, plus page / per_page.

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 '{ "delivery_id": "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.