Skip to main content
With the Partner API, you do not need to register a webhook endpoint per customer. The organization webhook is a single endpoint that receives the events of every project in the organization. Each event carries the project_id and the external_ref of the project it came from. You route by your own ID, without keeping a lookup table.
The Partner API is experimental in the SDK. The Node.js examples use @routa-chat/sdk/partner.

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 201 with 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.
Re-enabling the endpoint with a 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:
See every field in Events. The organization endpoint receives the events of every project in the organization, including projects created in the dashboard. For those, 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.
If no endpoint was set, the response is 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.

Concurrency

An endpoint with many customers is the bottleneck of all of them. That is why Routa keeps at most 32 concurrent deliveries to the organization endpoint, against 8 to the endpoint of a project. Answer fast and process the work on a queue on your side.