Skip to the page

REST API

Webhooks

Webhooks: 9 endpoints of the REST API.

GET/webhooks

List webhook endpoints

Endpoints of this environment, newest first. Secrets are never included.

Secret key scope (any of): webhooks:write

Parameters

FieldTypeDescription
limit (query)integer

Items per page (1–100).

cursor (query)string

next_cursor of the previous page; omit for the first page. A cursor only works with the sort order it was issued for.

Responses

200 A page of endpoints.

FieldTypeDescription
datarequiredobject[]
data[].idrequiredstring
data[].environmentrequired"test" | "live"
data[].urlrequiredstring
data[].descriptionrequiredstring | null
data[].eventsrequired"click.created" | "install.attributed" | "install.organic" | "open.reengaged" | "event.tracked" | "link.created" | "link.updated" | "link.disabled" | "link.blocked" | "campaign.created" | "campaign.ended" | "domain.verified" | "domain.failed"[]
data[].statusrequired"active" | "disabled" | "auto_disabled"

active receives events. disabled: turned off by a user. auto_disabled: turned off after 3 days of failing deliveries; enable it again once the receiver works.

data[].disabled_atrequiredstring (date-time) | null
data[].disabled_reasonrequiredstring | null
data[].failing_sincerequiredstring (date-time) | null

Start of the current failure streak; null while deliveries succeed.

data[].previous_secret_expires_atrequiredstring (date-time) | null

While set (24 hours after a rotation) deliveries carry a signature for the old secret as well as the new one.

data[].created_atrequiredstring (date-time)
data[].updated_atrequiredstring (date-time)
next_cursorrequiredstring | null

Pass as cursor to get the next page; null on the last page.

Example

Bash
POST/webhooks

Create a webhook endpoint

Registers an https endpoint for a set of event types and returns its signing secret.

Secret reveal. The response secret (whsec_…) is returned exactly once, here and when you rotate it: store it now. It is the HMAC-SHA256 key of the X-BeckLink-Signature header (t=<unix>,v1=<hex>, signed over <t>.<raw body>).

The URL must be https with a public host name (no IP addresses, local names or private networks). An environment holds at most 20 endpoints (409 conflict). click.created is high volume: subscribe to it deliberately.

Secret key scope (any of): webhooks:write

Request body

FieldTypeDescription
urlrequiredstring

The https URL events are POSTed to. Must use a public host name: IP addresses, local names and addresses that resolve to private networks are refused.

descriptionstring
eventsrequired"click.created" | "install.attributed" | "install.organic" | "open.reengaged" | "event.tracked" | "link.created" | "link.updated" | "link.disabled" | "link.blocked" | "campaign.created" | "campaign.ended" | "domain.verified" | "domain.failed"[]

Event types the endpoint receives.

Responses

201 The endpoint with its secret.

FieldTypeDescription
idrequiredstring
environmentrequired"test" | "live"
urlrequiredstring
descriptionrequiredstring | null
eventsrequired"click.created" | "install.attributed" | "install.organic" | "open.reengaged" | "event.tracked" | "link.created" | "link.updated" | "link.disabled" | "link.blocked" | "campaign.created" | "campaign.ended" | "domain.verified" | "domain.failed"[]
statusrequired"active" | "disabled" | "auto_disabled"

active receives events. disabled: turned off by a user. auto_disabled: turned off after 3 days of failing deliveries; enable it again once the receiver works.

disabled_atrequiredstring (date-time) | null
disabled_reasonrequiredstring | null
failing_sincerequiredstring (date-time) | null

Start of the current failure streak; null while deliveries succeed.

previous_secret_expires_atrequiredstring (date-time) | null

While set (24 hours after a rotation) deliveries carry a signature for the old secret as well as the new one.

created_atrequiredstring (date-time)
updated_atrequiredstring (date-time)
secretrequiredstring

The signing secret (whsec_…). Returned only by this response: store it now. Use it as the HMAC-SHA256 key to verify X-BeckLink-Signature.

Example

Bash
GET/webhooks/{webhook}

Get a webhook endpoint

One endpoint with its subscription, status and failure streak (no secret).

Secret key scope (any of): webhooks:write

Parameters

FieldTypeDescription
webhook (path)requiredstring

The ID of the webhook endpoint.

Responses

200 The endpoint.

FieldTypeDescription
idrequiredstring
environmentrequired"test" | "live"
urlrequiredstring
descriptionrequiredstring | null
eventsrequired"click.created" | "install.attributed" | "install.organic" | "open.reengaged" | "event.tracked" | "link.created" | "link.updated" | "link.disabled" | "link.blocked" | "campaign.created" | "campaign.ended" | "domain.verified" | "domain.failed"[]
statusrequired"active" | "disabled" | "auto_disabled"

active receives events. disabled: turned off by a user. auto_disabled: turned off after 3 days of failing deliveries; enable it again once the receiver works.

disabled_atrequiredstring (date-time) | null
disabled_reasonrequiredstring | null
failing_sincerequiredstring (date-time) | null

Start of the current failure streak; null while deliveries succeed.

previous_secret_expires_atrequiredstring (date-time) | null

While set (24 hours after a rotation) deliveries carry a signature for the old secret as well as the new one.

created_atrequiredstring (date-time)
updated_atrequiredstring (date-time)

Example

Bash
PATCH/webhooks/{webhook}

Update a webhook endpoint

Changes the URL, description, event types or status. status: "active" also turns an endpoint on that was disabled, automatically included, and clears its failure streak. A changed URL is checked like on creation.

Secret key scope (any of): webhooks:write

Parameters

FieldTypeDescription
webhook (path)requiredstring

The ID of the webhook endpoint.

Request body

FieldTypeDescription
urlstring

The https URL events are POSTed to. Must use a public host name: IP addresses, local names and addresses that resolve to private networks are refused.

descriptionstring | null

null removes the description.

events"click.created" | "install.attributed" | "install.organic" | "open.reengaged" | "event.tracked" | "link.created" | "link.updated" | "link.disabled" | "link.blocked" | "campaign.created" | "campaign.ended" | "domain.verified" | "domain.failed"[]

Event types the endpoint receives.

status"active" | "disabled"

active also enables an endpoint that was disabled automatically and clears its failure streak.

Responses

200 The updated endpoint.

FieldTypeDescription
idrequiredstring
environmentrequired"test" | "live"
urlrequiredstring
descriptionrequiredstring | null
eventsrequired"click.created" | "install.attributed" | "install.organic" | "open.reengaged" | "event.tracked" | "link.created" | "link.updated" | "link.disabled" | "link.blocked" | "campaign.created" | "campaign.ended" | "domain.verified" | "domain.failed"[]
statusrequired"active" | "disabled" | "auto_disabled"

active receives events. disabled: turned off by a user. auto_disabled: turned off after 3 days of failing deliveries; enable it again once the receiver works.

disabled_atrequiredstring (date-time) | null
disabled_reasonrequiredstring | null
failing_sincerequiredstring (date-time) | null

Start of the current failure streak; null while deliveries succeed.

previous_secret_expires_atrequiredstring (date-time) | null

While set (24 hours after a rotation) deliveries carry a signature for the old secret as well as the new one.

created_atrequiredstring (date-time)
updated_atrequiredstring (date-time)

Example

Bash
DELETE/webhooks/{webhook}

Delete a webhook endpoint

Deletes the endpoint and its delivery log for good. Events already queued for it are dropped. Disable the endpoint instead to keep the log.

Secret key scope (any of): webhooks:write

Parameters

FieldTypeDescription
webhook (path)requiredstring

The ID of the webhook endpoint.

Responses

204 The endpoint is deleted.

Example

Bash
GET/webhooks/{webhook}/deliveries

List deliveries

The delivery log of an endpoint, newest first, with the first 2 KB of request and response. Kept 30 days. from and to bound the time window (default: the last 7 days; at most 30 days wide); filter by status and event_type.

Secret key scope (any of): webhooks:write

Parameters

FieldTypeDescription
webhook (path)requiredstring

The ID of the webhook endpoint.

limit (query)integer

Items per page (1–100).

cursor (query)string

next_cursor of the previous page; omit for the first page. A cursor only works with the sort order it was issued for.

status (query)"pending" | "succeeded" | "failed" | "retrying" | "abandoned"
event_type (query)"click.created" | "install.attributed" | "install.organic" | "open.reengaged" | "event.tracked" | "link.created" | "link.updated" | "link.disabled" | "link.blocked" | "campaign.created" | "campaign.ended" | "domain.verified" | "domain.failed"
from (query)string (date-time)

Start of the time window. Default: 7 days ago; the log keeps 30 days.

to (query)string (date-time)

End of the time window. Default: now.

Responses

200 A page of deliveries.

FieldTypeDescription
datarequiredobject[]
data[].idrequiredstring
data[].webhook_idrequiredstring
data[].event_idrequiredstring

The id of the event payload (the idempotency key receivers deduplicate on).

data[].event_typerequired"click.created" | "install.attributed" | "install.organic" | "open.reengaged" | "event.tracked" | "link.created" | "link.updated" | "link.disabled" | "link.blocked" | "campaign.created" | "campaign.ended" | "domain.verified" | "domain.failed"
data[].kindrequired"automatic" | "replay" | "test"
data[].attemptrequiredinteger
data[].statusrequired"pending" | "succeeded" | "failed" | "retrying" | "abandoned"
data[].request_bodyrequiredstring | null

First 2 KB of the body sent.

data[].response_coderequiredinteger | null
data[].response_bodyrequiredstring | null

First 2 KB of the response.

data[].latency_msrequiredinteger | null
data[].errorrequiredstring | null

Why the attempt failed without an HTTP response (timeout, DNS, TLS, …).

data[].next_attempt_atrequiredstring (date-time) | null
data[].created_atrequiredstring (date-time)
next_cursorrequiredstring | null

Pass as cursor to get the next page; null on the last page.

Example

Bash
POST/webhooks/{webhook}/deliveries/{delivery}/replay

Replay a delivery

Sends the event of a finished delivery again as one more attempt (same event id, so receivers can deduplicate). A replay is a single attempt without automatic retries. The attempt is queued for the delivery worker; the returned delivery is pending and finishes within seconds (list the deliveries to see the result). Answers 503 service_unavailable, writing nothing, when the server has no job queue connection.

Secret key scope (any of): webhooks:write

Parameters

FieldTypeDescription
delivery (path)requiredstring

The ID of the delivery.

webhook (path)requiredstring

The ID of the webhook endpoint.

Responses

202 The queued attempt.

Example

Bash
POST/webhooks/{webhook}/rotate-secret

Rotate the signing secret

Generates a new signing secret and returns it once. The previous secret keeps working for 24 hours: during that time every delivery carries two v1 signatures (new first), so you can switch your receiver at any moment. Rotating again replaces the previous secret.

Secret key scope (any of): webhooks:write

Parameters

FieldTypeDescription
webhook (path)requiredstring

The ID of the webhook endpoint.

Responses

200 The endpoint with its new secret.

FieldTypeDescription
idrequiredstring
environmentrequired"test" | "live"
urlrequiredstring
descriptionrequiredstring | null
eventsrequired"click.created" | "install.attributed" | "install.organic" | "open.reengaged" | "event.tracked" | "link.created" | "link.updated" | "link.disabled" | "link.blocked" | "campaign.created" | "campaign.ended" | "domain.verified" | "domain.failed"[]
statusrequired"active" | "disabled" | "auto_disabled"

active receives events. disabled: turned off by a user. auto_disabled: turned off after 3 days of failing deliveries; enable it again once the receiver works.

disabled_atrequiredstring (date-time) | null
disabled_reasonrequiredstring | null
failing_sincerequiredstring (date-time) | null

Start of the current failure streak; null while deliveries succeed.

previous_secret_expires_atrequiredstring (date-time) | null

While set (24 hours after a rotation) deliveries carry a signature for the old secret as well as the new one.

created_atrequiredstring (date-time)
updated_atrequiredstring (date-time)
secretrequiredstring

The signing secret (whsec_…). Returned only by this response: store it now. Use it as the HMAC-SHA256 key to verify X-BeckLink-Signature.

Example

Bash
POST/webhooks/{webhook}/test

Send a test event

Sends a sample event (a fresh event id, labelled test data) of the endpoint’s first subscribed type. Single attempt, no retries. The attempt is queued for the delivery worker; the returned delivery is pending and finishes within seconds (list the deliveries to see the result). Answers 503 service_unavailable, writing nothing, when the server has no job queue connection.

Secret key scope (any of): webhooks:write

Parameters

FieldTypeDescription
webhook (path)requiredstring

The ID of the webhook endpoint.

Responses

202 The queued attempt.

Example

Bash