project_id and the external_ref of the project it came from. You route by your own ID, without keeping a lookup table.
Set the endpoint
PUT /v1/partner/webhook creates or replaces the endpoint. Required scope: webhooks:write.
In
subscribed_types, use an exact event type, such as message.delivered, or the wildcard of a group: message.*, channel.* or template.*. A bare * is not accepted. See the types in Event types.
Creation and updates
PUT is idempotent:
- On the first call, Routa creates the endpoint and responds
201with the signing secret. The secret is shown only once. Store it. - On later calls, Routa replaces the URL and the types, re-enables the endpoint and responds
200, without the secret. The existing secret does not change.
PUT is how you bring it back after it was disabled for consecutive failures.
GET /v1/partner/webhook retrieves the endpoint and never returns the secret. If no endpoint was set, the response is 404 webhook_endpoint_not_found.
The envelope
The events have the same format as the events of a project. Two fields identify the customer:external_ref is null.
You can also keep webhook endpoints on individual projects. In that case, you receive both deliveries.
Signatures and retries
Deliveries are signed, retried and replayed exactly like those of a project. Verify each one with the secret of the organization endpoint: In the Node.js SDK,partner.webhook.constructEvent() verifies the signature and returns the typed event. See Receive the events of every customer.
Rotate the secret
POST /v1/partner/webhook/rotate_secret issues a new secret and returns it only once. The previous secret keeps signing deliveries for 24 hours, so you can swap it without losing events. Required scope: webhooks:write.
404 webhook_endpoint_not_found. An Owner or Admin can also see the state of the endpoint and rotate the secret in the dashboard, under Settings, on the Partner tab, in the Webhook section.