API reference · Webhook endpoints

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.

POST https://api.framera.ai/v1/webhook-endpoints
GET https://api.framera.ai/v1/webhook-endpoints
GET https://api.framera.ai/v1/webhook-endpoints/:id
POST https://api.framera.ai/v1/webhook-endpoints/:id
DELETE https://api.framera.ai/v1/webhook-endpoints/:id
POST https://api.framera.ai/v1/webhook-endpoints/:id/roll-secret

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

idstring
we_…
objectstring
Always webhook_endpoint.
urlstring
The public https URL we POST events to.
eventsstring[]
The event types it receives, or ["*"] for all: job.succeeded, job.failed, job.cancelled, balance.low, balance.topped_up and balance.recharge_failed.
descriptionstring | null
Your own note, such as "Production backend".
secretstring
whsec_…, the secret that signs its events. Only in the answer to create and to roll-secret.
disabledboolean
true when the endpoint receives nothing.
createdAtstring
When it was created.

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.

urlstringrequired
A public https URL.
eventsstring[]
The event types to send. Default ["*"], every event.
descriptionstring
Your own note, up to 200 characters.

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

StatusCodeWhen
400invalid_requestA field is missing, wrong or out of range. The message says which; details.issues lists the fields.
401unauthorizedThe key is missing, wrong or revoked.
403permission_deniedThe 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.
404not_foundNo such object on your account.
429rate_limitedToo many requests. Retry after Retry-After seconds.