REST API
Webhooks
Webhooks: 9 endpoints of the REST API.
/webhooksList webhook endpoints
Endpoints of this environment, newest first. Secrets are never included.
Secret key scope (any of): webhooks:write
Parameters
| Field | Type | Description |
|---|---|---|
limit (query) | integer | Items per page (1–100). |
cursor (query) | string |
|
Responses
200 A page of endpoints.
| Field | Type | Description |
|---|---|---|
datarequired | object[] | |
data[].idrequired | string | |
data[].environmentrequired | "test" | "live" | |
data[].urlrequired | string | |
data[].descriptionrequired | string | 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" |
|
data[].disabled_atrequired | string (date-time) | null | |
data[].disabled_reasonrequired | string | null | |
data[].failing_sincerequired | string (date-time) | null | Start of the current failure streak; |
data[].previous_secret_expires_atrequired | string (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_atrequired | string (date-time) | |
data[].updated_atrequired | string (date-time) | |
next_cursorrequired | string | null | Pass as |
Example
curl -X GET "https://api.becklinks.com/v1/webhooks" \
-H "Authorization: Bearer $SECRET_KEY"/webhooksCreate 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
| Field | Type | Description |
|---|---|---|
urlrequired | string | 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. |
description | string | |
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.
| Field | Type | Description |
|---|---|---|
idrequired | string | |
environmentrequired | "test" | "live" | |
urlrequired | string | |
descriptionrequired | string | 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" |
|
disabled_atrequired | string (date-time) | null | |
disabled_reasonrequired | string | null | |
failing_sincerequired | string (date-time) | null | Start of the current failure streak; |
previous_secret_expires_atrequired | string (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_atrequired | string (date-time) | |
updated_atrequired | string (date-time) | |
secretrequired | string | The signing secret ( |
Example
curl -X POST "https://api.becklinks.com/v1/webhooks" \
-H "Authorization: Bearer $SECRET_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"url":"string","events":["click.created"]}'/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
| Field | Type | Description |
|---|---|---|
webhook (path)required | string | The ID of the webhook endpoint. |
Responses
200 The endpoint.
| Field | Type | Description |
|---|---|---|
idrequired | string | |
environmentrequired | "test" | "live" | |
urlrequired | string | |
descriptionrequired | string | 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" |
|
disabled_atrequired | string (date-time) | null | |
disabled_reasonrequired | string | null | |
failing_sincerequired | string (date-time) | null | Start of the current failure streak; |
previous_secret_expires_atrequired | string (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_atrequired | string (date-time) | |
updated_atrequired | string (date-time) |
Example
curl -X GET "https://api.becklinks.com/v1/webhooks/{webhook}" \
-H "Authorization: Bearer $SECRET_KEY"/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
| Field | Type | Description |
|---|---|---|
webhook (path)required | string | The ID of the webhook endpoint. |
Request body
| Field | Type | Description |
|---|---|---|
url | string | 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. |
description | string | null |
|
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" |
|
Responses
200 The updated endpoint.
| Field | Type | Description |
|---|---|---|
idrequired | string | |
environmentrequired | "test" | "live" | |
urlrequired | string | |
descriptionrequired | string | 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" |
|
disabled_atrequired | string (date-time) | null | |
disabled_reasonrequired | string | null | |
failing_sincerequired | string (date-time) | null | Start of the current failure streak; |
previous_secret_expires_atrequired | string (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_atrequired | string (date-time) | |
updated_atrequired | string (date-time) |
Example
curl -X PATCH "https://api.becklinks.com/v1/webhooks/{webhook}" \
-H "Authorization: Bearer $SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{}'/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
| Field | Type | Description |
|---|---|---|
webhook (path)required | string | The ID of the webhook endpoint. |
Responses
204 The endpoint is deleted.
Example
curl -X DELETE "https://api.becklinks.com/v1/webhooks/{webhook}" \
-H "Authorization: Bearer $SECRET_KEY"/webhooks/{webhook}/deliveriesList 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
| Field | Type | Description |
|---|---|---|
webhook (path)required | string | The ID of the webhook endpoint. |
limit (query) | integer | Items per page (1–100). |
cursor (query) | string |
|
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.
| Field | Type | Description |
|---|---|---|
datarequired | object[] | |
data[].idrequired | string | |
data[].webhook_idrequired | string | |
data[].event_idrequired | string | The |
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[].attemptrequired | integer | |
data[].statusrequired | "pending" | "succeeded" | "failed" | "retrying" | "abandoned" | |
data[].request_bodyrequired | string | null | First 2 KB of the body sent. |
data[].response_coderequired | integer | null | |
data[].response_bodyrequired | string | null | First 2 KB of the response. |
data[].latency_msrequired | integer | null | |
data[].errorrequired | string | null | Why the attempt failed without an HTTP response (timeout, DNS, TLS, …). |
data[].next_attempt_atrequired | string (date-time) | null | |
data[].created_atrequired | string (date-time) | |
next_cursorrequired | string | null | Pass as |
Example
curl -X GET "https://api.becklinks.com/v1/webhooks/{webhook}/deliveries" \
-H "Authorization: Bearer $SECRET_KEY"/webhooks/{webhook}/deliveries/{delivery}/replayReplay 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
| Field | Type | Description |
|---|---|---|
delivery (path)required | string | The ID of the delivery. |
webhook (path)required | string | The ID of the webhook endpoint. |
Responses
202 The queued attempt.
Example
curl -X POST "https://api.becklinks.com/v1/webhooks/{webhook}/deliveries/{delivery}/replay" \
-H "Authorization: Bearer $SECRET_KEY" \
-H "Idempotency-Key: $(uuidgen)"/webhooks/{webhook}/rotate-secretRotate 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
| Field | Type | Description |
|---|---|---|
webhook (path)required | string | The ID of the webhook endpoint. |
Responses
200 The endpoint with its new secret.
| Field | Type | Description |
|---|---|---|
idrequired | string | |
environmentrequired | "test" | "live" | |
urlrequired | string | |
descriptionrequired | string | 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" |
|
disabled_atrequired | string (date-time) | null | |
disabled_reasonrequired | string | null | |
failing_sincerequired | string (date-time) | null | Start of the current failure streak; |
previous_secret_expires_atrequired | string (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_atrequired | string (date-time) | |
updated_atrequired | string (date-time) | |
secretrequired | string | The signing secret ( |
Example
curl -X POST "https://api.becklinks.com/v1/webhooks/{webhook}/rotate-secret" \
-H "Authorization: Bearer $SECRET_KEY" \
-H "Idempotency-Key: $(uuidgen)"/webhooks/{webhook}/testSend 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
| Field | Type | Description |
|---|---|---|
webhook (path)required | string | The ID of the webhook endpoint. |
Responses
202 The queued attempt.
Example
curl -X POST "https://api.becklinks.com/v1/webhooks/{webhook}/test" \
-H "Authorization: Bearer $SECRET_KEY" \
-H "Idempotency-Key: $(uuidgen)"