Webhooks
The endpoints events are sent to, the event names, the log of the events sent, and retrying one.
Verifying a deliverylink
Every event is POSTed as JSON with the headers OIIS-Event-Id (the eventId of the body), OIIS-Event-Type, OIIS-Timestamp (UTC, YYYY-MM-DDTHH:mm:ssZ), OIIS-Key-Id (the id of the current signing secret), OIIS-Delivery-Attempt and OIIS-Signature.
OIIS-Signature is a comma-separated list of v1=<digest> values, one per active signing secret: two during the 24 hours after a rotation, otherwise one. Each digest is the lowercase hex HMAC-SHA256, keyed with the whole signing secret (its whsec_ prefix included), of the bytes <OIIS-Timestamp>.<OIIS-Event-Id>. followed by the raw request body exactly as it arrived. Recompute it over the raw body before parsing the JSON, compare it with each v1= value in constant time and accept the delivery when one matches; refusing a timestamp more than five minutes away from your clock stops replays.
Testing an endpointlink
POST /webhook-endpoints/{endpointId}/test sends a signed webhook.test event to one endpoint straight away and answers what your endpoint replied. A 2xx answer from an endpoint registered with a test key completes the webhook step of the production activation checklist.
/webhooks/deliveriesList webhook deliveries
Every event this API has sent, or is still trying to send, to the webhook endpoint of this business in this environment, newest first. Deliveries of another business are never listed, and neither the signing secret nor the endpoint of anyone else is ever part of a row.
Requires API key authentication. The API key issued to the business, sent as `<keyId>:<secret>`, for example `sk_test_0123456789abcdef0123456789abcdef:<secret>`. The key id prefix selects the environment: `sk_test_` keys read and write test data, `sk_live_` keys production data.
Responses
One page of deliveries.
{
"items": [],
"pagination": null
}/api/v1/webhooks/deliveriesCode samples
curl -X GET '/api/v1/webhooks/deliveries'/webhooks/deliveries/{deliveryId}Read one webhook delivery
The same row the list serves, plus the exact event body that was signed and the endpoint it was sent to. A delivery this business does not own is a 404, indistinguishable from one that never existed.
Requires API key authentication. The API key issued to the business, sent as `<keyId>:<secret>`, for example `sk_test_0123456789abcdef0123456789abcdef:<secret>`. The key id prefix selects the environment: `sk_test_` keys read and write test data, `sk_live_` keys production data.
Responses
The delivery, with its payload.
{
"delivery": null
}/api/v1/webhooks/deliveries/{deliveryId}Code samples
curl -X GET '/api/v1/webhooks/deliveries/{deliveryId}'/webhooks/deliveries/{deliveryId}/retryRetry a webhook delivery
Queues the delivery again from a clean slate: the status goes back to PENDING, the attempt counter to zero, the last failure is cleared and the next sweep sends it. PENDING, FAILED and DEAD deliveries can be retried; one that already succeeded is 409 INVALID_STATE_TRANSITION. No attempt is made while your request is open, so a 200 means queued, not delivered. The retry is recorded against your Idempotency-Key, so repeating that key replays the stored result with Idempotency-Replayed: true; the delivery is queued once, and a key repeated after the delivery has since succeeded still replays that stored result rather than answering 409.
Requires API key authentication. The API key issued to the business, sent as `<keyId>:<secret>`, for example `sk_test_0123456789abcdef0123456789abcdef:<secret>`. The key id prefix selects the environment: `sk_test_` keys read and write test data, `sk_live_` keys production data.
Responses
The delivery as it now stands, queued for the next sweep.
{
"delivery": null
}/api/v1/webhooks/deliveries/{deliveryId}/retryRequest body
Code samples
curl -X POST '/api/v1/webhooks/deliveries/{deliveryId}/retry'/webhook-endpointsList webhook endpoints
The endpoints of this business in the environment of the key, oldest first. A business holds at most 10 endpoints per environment, so the list is not paged. Signing secrets are never part of a row.
Requires API key authentication. The API key issued to the business, sent as `<keyId>:<secret>`, for example `sk_test_0123456789abcdef0123456789abcdef:<secret>`. The key id prefix selects the environment: `sk_test_` keys read and write test data, `sk_live_` keys production data.
Responses
Every endpoint of this business in this environment.
{
"items": []
}/api/v1/webhook-endpointsCode samples
curl -X GET '/api/v1/webhook-endpoints'/webhook-endpointsCreate a webhook endpoint
Registers an endpoint in the environment of the key and mints its signing secret. The secret is returned in this response only: store it now. Events are sent to the endpoint only when their name is in events; ["*"] subscribes to every event, including ones added later. The URL must be https and reach a public host. Repeating the Idempotency-Key replays the stored endpoint with 200, Idempotency-Replayed: true and without secret, since the plaintext secret is never stored; recover it by rotating the secret with POST /webhook-endpoints/{endpointId}/rotate-secret, which returns a new secret once. More than 10 endpoints per environment, an unknown event name or a URL the policy refuses is 422 VALIDATION_FAILED.
Requires API key authentication. The API key issued to the business, sent as `<keyId>:<secret>`, for example `sk_test_0123456789abcdef0123456789abcdef:<secret>`. The key id prefix selects the environment: `sk_test_` keys read and write test data, `sk_live_` keys production data.
Request body
application/jsonnullResponses
A replay of an earlier request with the same Idempotency-Key: the stored endpoint, without secret. The plaintext secret is never stored; if the first response was lost, get a new one from POST /webhook-endpoints/{endpointId}/rotate-secret.
{
"endpoint": null
}/api/v1/webhook-endpointsRequest body
Code samples
curl -X POST '/api/v1/webhook-endpoints'/webhook-endpoints/{endpointId}Read a webhook endpoint
One endpoint of this business in the environment of the key. An endpoint of another business or of the other environment is 404.
Requires API key authentication. The API key issued to the business, sent as `<keyId>:<secret>`, for example `sk_test_0123456789abcdef0123456789abcdef:<secret>`. The key id prefix selects the environment: `sk_test_` keys read and write test data, `sk_live_` keys production data.
Responses
The endpoint.
{
"endpoint": null
}/api/v1/webhook-endpoints/{endpointId}Code samples
curl -X GET '/api/v1/webhook-endpoints/{endpointId}'/webhook-endpoints/{endpointId}Delete a webhook endpoint
Removes the endpoint. Nothing more is sent to its URL: deliveries still pending for it stop with FAILED.
Requires API key authentication. The API key issued to the business, sent as `<keyId>:<secret>`, for example `sk_test_0123456789abcdef0123456789abcdef:<secret>`. The key id prefix selects the environment: `sk_test_` keys read and write test data, `sk_live_` keys production data.
Responses
The endpoint is gone.
null/api/v1/webhook-endpoints/{endpointId}Code samples
curl -X DELETE '/api/v1/webhook-endpoints/{endpointId}'/webhook-endpoints/{endpointId}Update a webhook endpoint
Changes the fields sent and leaves the others as they are. A null description clears it. Disabling an endpoint stops new deliveries to it, and deliveries still pending for it stop with FAILED. Fields other than url, events, description and enabled are ignored.
Requires API key authentication. The API key issued to the business, sent as `<keyId>:<secret>`, for example `sk_test_0123456789abcdef0123456789abcdef:<secret>`. The key id prefix selects the environment: `sk_test_` keys read and write test data, `sk_live_` keys production data.
Request body
application/jsonnullResponses
The endpoint as it now stands.
{
"endpoint": null
}/api/v1/webhook-endpoints/{endpointId}Request body
Code samples
curl -X PATCH '/api/v1/webhook-endpoints/{endpointId}'/webhook-endpoints/{endpointId}/rotate-secretRotate the signing secret of an endpoint
Mints a new signing secret and returns it in this response only. The previous secret keeps signing alongside the new one for 24 hours, so your receiver can switch over without dropping events: during that window every event carries a signature for each secret.
Requires API key authentication. The API key issued to the business, sent as `<keyId>:<secret>`, for example `sk_test_0123456789abcdef0123456789abcdef:<secret>`. The key id prefix selects the environment: `sk_test_` keys read and write test data, `sk_live_` keys production data.
Responses
The endpoint and its new signing secret.
{
"endpoint": null,
"secret": null
}/api/v1/webhook-endpoints/{endpointId}/rotate-secretRequest body
Code samples
curl -X POST '/api/v1/webhook-endpoints/{endpointId}/rotate-secret'/webhook-endpoints/{endpointId}/testSend a test event to an endpoint
Sends a signed webhook.test event to the endpoint now, whatever events it subscribes to, and answers what your endpoint replied. The event is not queued, retried or written to the delivery log. A 2xx answer from an endpoint of the test environment completes the webhook step of the production activation checklist, exactly as a real delivery does. A disabled endpoint, or one whose signing secret was revoked, is sent nothing.
Requires API key authentication. The API key issued to the business, sent as `<keyId>:<secret>`, for example `sk_test_0123456789abcdef0123456789abcdef:<secret>`. The key id prefix selects the environment: `sk_test_` keys read and write test data, `sk_live_` keys production data.
Responses
What happened to the test event, delivered or not.
null/api/v1/webhook-endpoints/{endpointId}/testRequest body
Code samples
curl -X POST '/api/v1/webhook-endpoints/{endpointId}/test'/webhook-eventsList webhook event names
Every event name an endpoint can subscribe to, and the wildcard that subscribes to all of them.
Requires API key authentication. The API key issued to the business, sent as `<keyId>:<secret>`, for example `sk_test_0123456789abcdef0123456789abcdef:<secret>`. The key id prefix selects the environment: `sk_test_` keys read and write test data, `sk_live_` keys production data.
Responses
The event names.
{
"events": [],
"allEvents": ""
}/api/v1/webhook-eventsCode samples
curl -X GET '/api/v1/webhook-events'