Webhook endpoints overview
How to register a webhook endpoint, handle its signing secret, test it, change it and remove it.
A webhook endpoint is a URL of yours that Localoy sends events to, for every partner connected to you. You manage endpoints through the API. Every call needs a provider key and ignores the partner header.
| Endpoint | What it does |
|---|---|
GET /webhooks/events | Lists the event types you can subscribe to. |
POST /webhooks | Creates an endpoint and returns its secret. |
GET /webhooks, GET /webhooks/{id} | Read endpoints. |
PATCH /webhooks/{id} | Changes URL, events or description, or enables and disables it. |
GET / POST /webhooks/{id}/secret | Reveals or rotates the signing secret. |
POST /webhooks/{id}/test | Sends a signed ping now. |
DELETE /webhooks/{id} | Deletes it and its delivery history. |
The flow#
- Your platform → Localoy: GET /webhooks/events
- Localoy → Your platform: 200 subscribable event names
- Your platform → Localoy: POST /webhooks { url, events }
- Localoy → Your platform: 201 endpoint + whsec_ secret
- Your platform → Your receiver: Store the secret
- Your platform → Localoy: POST /webhooks/{id}/test
- Localoy → Your receiver: Signed ping
- Your receiver → Localoy: 2xx
- Localoy → Your platform: 200 data.ok true
- — Maintaining it —
- Your platform → Localoy: PATCH /webhooks/{id}
- Your platform → Localoy: POST /webhooks/{id}/secret
- Localoy → Your platform: 200 new secret, old one stops
- Your platform → Your receiver: Deploy the new secret now
- Choose events.
eventsmust be a non-empty list of known names (400 invalid_events, withdetails.allowed);pingis not subscribable. The URL must behttpsand public. - Create. One endpoint per URL per environment (
409 webhook_endpoint_duplicate), at most 10 (409 webhook_endpoint_limit_reached). The create response and the rotate response are the only ones that carry the secret, besidesGET …/secret. - Test. The test is sent immediately, not queued, even to a disabled endpoint, and is not retried.
It always answers
200; readdata.okfor the outcome. - Change.
PATCHchanges only what you send.environmentis fixed (400 environment_immutable); create an endpoint in the other environment instead. Usestatus: "DISABLED"to pause deliveries. - Rotate with care. The new secret applies at once and the old one stops verifying, so deploy it straight away. Deliveries that fail verification meanwhile are retried for about five minutes.
- Delete. Permanent, with the delivery history; queued retries are not sent. Deleting twice
answers
404 webhook_endpoint_not_found.
Guide: Webhooks for providers. To verify signatures, see Verifying signatures.