message.delivered, message.received…), never provider payloads. You write a single integration, whatever the channel.
Required scope to manage endpoints:
webhooks:write.How it works
1
Register an endpoint
Provide the HTTPS URL and the event types you want to receive.
2
Store the secret
The response carries the signing
secret. It is shown only once.3
Verify every delivery
Validate the
Routa-Signature header over the raw body before you trust the event. See Signatures.4
Answer 2xx
Return a
2xx status within 10 seconds. Any other response counts as a failure and is retried.Register an endpoint
Response (201 Created)
Subscribed types
subscribed_types needs at least one item. Each item is an exact event type (message.delivered, for example) or a per-resource wildcard: message.*, channel.* or template.*. A bare wildcard (*) or a type that does not exist returns 422 invalid_subscribed_types. The full list is in Event types.
To change the subscription later, use PATCH /v1/webhook_endpoints/{id}.
URL requirements
- In a live project, the URL must use HTTPS.
- Private, loopback and link-local addresses are rejected (
invalid_webhook_url). Routa also checks DNS again at the time of each delivery, and does not follow redirects. http://localhostis accepted only in test projects.- Each project can have up to 5 endpoints. Beyond that, creation returns
422 too_many_webhook_endpoints.
What Routa sends
Each delivery is aPOST with a single event in the body and these headers:
The body is the event object. There is no batching: one event per request.
Delivery semantics
- At least once. The same event can arrive more than once. Deduplicate by
id. - No global order. Events can arrive out of order. Treat the status as monotonic.
- Success is any
2xxwithin 10 seconds. The response body is ignored. - Failures are retried with growing delays for about 20 hours. See Retries and replay.
Best practices
Answer fast
Validate, put the event on a queue and return
200. Process it afterwards.Verify the signature
Never trust an event without validating
Routa-Signature over the raw body.Deduplicate
Keep the
id of processed events for at least 24 hours.Tolerate the unknown
Ignore new types and fields. Routa only makes additive changes within
v1.