Webhook endpoints
Set up the URLs we send events to once, instead of passing webhookUrl on every request. Create, retrieve, update, list, delete and roll secrets.
You can also manage endpoints in the console. Creating, updating and deleting them needs a key with the all permission. How to check signatures is in Webhooks.
The webhook endpoint object
we_…webhook_endpoint.["*"] for all: job.succeeded, job.failed, job.cancelled, balance.low, balance.topped_up and balance.recharge_failed.whsec_…, the secret that signs its events. Only in the answer to create and to roll-secret.true when the endpoint receives nothing.Create an endpoint
POST /v1/webhook-endpoints answers 201 with the endpoint and its secret. Store the secret on your server: it is not shown again. Up to 16 endpoints per account.
["*"], every event.Update an endpoint
POST /v1/webhook-endpoints/:id changes any of url, events, description (or null to clear it) and disabled, and returns the endpoint. Set disabled: true to pause deliveries without deleting it.
List, retrieve and delete
GET /v1/webhook-endpoints lists your endpoints as { object: "list", data, hasMore }. GET /v1/webhook-endpoints/:id returns one. DELETE /v1/webhook-endpoints/:id deletes it and returns { id, object: "webhook_endpoint", deleted: true }; nothing more is sent to it.
Roll the signing secret
POST /v1/webhook-endpoints/:id/roll-secret makes a new secret and returns the endpoint with it. The old secret stops working at once, so update your server straight after rolling.
Per-request webhook URLs
A webhookUrl on a create call keeps working alongside endpoints. Those deliveries are signed with your account's webhook secret, the same for every key on the account: GET /v1/webhook-secret returns it as { object: "webhook_secret", secret, signatureHeader: "Framera-Signature" }.
Errors
| Status | Code | When |
|---|---|---|
| 400 | invalid_request | A field is missing, wrong or out of range. The message says which; details.issues lists the fields. |
| 401 | unauthorized | The key is missing, wrong or revoked. |
| 403 | permission_denied | The key lacks the permission, a monthly limit would be passed, or the address is not allowed. details.reason says which: key_permission, key_monthly_limit, monthly_limit or ip_not_allowed. |
| 404 | not_found | No such object on your account. |
| 429 | rate_limited | Too many requests. Retry after Retry-After seconds. |