Webhooks (management API)
Endpoints Tolinku sends events to. Reading them needs Read and write; changing them needs Full. A signing secret is returned once, when you create the endpoint or make a new secret, and never again. For what each setting does, see the user guide.
Every path also works under /v1/manage/appspaces/{appspace}, which you need when an OAuth token reaches more than one Appspace. See the management API overview for signing in, errors, dry runs and paging.
| Method | Path | What it does | Permission |
|---|---|---|---|
GET | /v1/manage/webhooks | List webhook endpoints | Read and write |
POST | /v1/manage/webhooks | Add a webhook endpoint | Full |
GET | /v1/manage/webhooks/{webhook} | Get a webhook endpoint | Read and write |
PATCH | /v1/manage/webhooks/{webhook} | Change a webhook endpoint | Full |
DELETE | /v1/manage/webhooks/{webhook} | Delete a webhook endpoint | Full |
POST | /v1/manage/webhooks/{webhook}/activate | Turn a webhook endpoint on | Full |
POST | /v1/manage/webhooks/{webhook}/deactivate | Turn a webhook endpoint off | Full |
POST | /v1/manage/webhooks/{webhook}/rotate-secret | Make a new signing secret | Full |
POST | /v1/manage/webhooks/{webhook}/test | Send a test event | Full |
POST | /v1/manage/webhooks/{webhook}/restore | Restore a deleted webhook endpoint | Full |
List webhook endpoints
Section titled “List webhook endpoints”/v1/manage/webhooksPermission: Read and write.
The Appspace’s webhook endpoints, oldest first, paged with cursor. Never their signing secrets.
Query parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
limit | integer | No | How many to return, 1 to 100 (default 50). |
cursor | string | No | From the previous page’s next_cursor, to get the page after it. |
Response 200: a page of results in data, and next_cursor for the next page (see Paging). Each item:
| Field | Type | Description |
|---|---|---|
id | string | The webhook’s id. Any endpoint taking {webhook} also takes its name. |
name | string | |
url | string | |
host | string | |
events | array of link.clicked, deferred_link.claimed, install.tracked, referral.created, referral.completed, ecommerce.purchase, ecommerce.refund, ecommerce.cart_abandoned, ecommerce.add_to_cart, ecommerce.begin_checkout, ecommerce.add_to_wishlist, ecommerce.fraud_flagged | |
active | boolean | |
last_triggered_at | string or null | |
last_status_code | number or null | |
has_secret | boolean | Whether it has a signing secret. The secret itself is only ever in the answer that made it. |
created | string | |
updated_at | string | Send as expected_updated_at when changing it. |
Add a webhook endpoint
Section titled “Add a webhook endpoint”/v1/manage/webhooksPermission: Full. Changes something: takes dry_run and Idempotency-Key, and needs the Standard plan or above.
The dashboard’s rules apply: a name, a public HTTPS address (no localhost, IP addresses or internal names), at least one event, and Free’s one webhook. A new endpoint is on unless active is false. The answer carries its signing secret, once. Send Idempotency-Key so a retry never makes two. With dry_run, nothing changes: the answer is { dry_run: true, before, after, changes, warnings }.
Query parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
dry_run | true, false | No | true: check and preview the change without making it (the same as dry_run in the body). |
Request body (JSON):
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | A name for your team, such as “Production server”. |
url | string | Yes | Where events are posted: a public HTTPS address. Must answer 2xx within 10 seconds. |
events | array of link.clicked, deferred_link.claimed, install.tracked, referral.created, referral.completed, ecommerce.purchase, ecommerce.refund, ecommerce.cart_abandoned, ecommerce.add_to_cart, ecommerce.begin_checkout, ecommerce.add_to_wishlist, ecommerce.fraud_flagged | Yes | Which events are sent to it, at least one: link.clicked, deferred_link.claimed, install.tracked, referral.created, referral.completed, ecommerce.purchase, ecommerce.refund, ecommerce.cart_abandoned, ecommerce.add_to_cart, ecommerce.begin_checkout, ecommerce.add_to_wishlist, ecommerce.fraud_flagged. |
active | boolean | No | Whether events are sent to it straight away. Default true, as in the dashboard. |
Response 201: the result in data, with warnings. With dry_run, a preview instead.
| Field | Type | Description |
|---|---|---|
id | string | The webhook’s id. Any endpoint taking {webhook} also takes its name. |
name | string | |
url | string | |
host | string | |
events | array of link.clicked, deferred_link.claimed, install.tracked, referral.created, referral.completed, ecommerce.purchase, ecommerce.refund, ecommerce.cart_abandoned, ecommerce.add_to_cart, ecommerce.begin_checkout, ecommerce.add_to_wishlist, ecommerce.fraud_flagged | |
active | boolean | |
last_triggered_at | string or null | |
last_status_code | number or null | |
has_secret | boolean | Whether it has a signing secret. The secret itself is only ever in the answer that made it. |
created | string | |
updated_at | string | Send as expected_updated_at when changing it. |
secret | string | The signing secret (whsec_…): each request carries X-Webhook-Signature, the HMAC-SHA256 of the raw body with it, in hex. Shown in this answer only; store it now. |
Get a webhook endpoint
Section titled “Get a webhook endpoint”/v1/manage/webhooks/{webhook}Permission: Read and write.
One endpoint: every field a change takes, by the same names. Never its signing secret.
Path parameters:
| Parameter | Description |
|---|---|
webhook | The webhook: its id or its name. URL-encode a name. |
Response 200: the result in data.
| Field | Type | Description |
|---|---|---|
id | string | The webhook’s id. Any endpoint taking {webhook} also takes its name. |
name | string | |
url | string | |
host | string | |
events | array of link.clicked, deferred_link.claimed, install.tracked, referral.created, referral.completed, ecommerce.purchase, ecommerce.refund, ecommerce.cart_abandoned, ecommerce.add_to_cart, ecommerce.begin_checkout, ecommerce.add_to_wishlist, ecommerce.fraud_flagged | |
active | boolean | |
last_triggered_at | string or null | |
last_status_code | number or null | |
has_secret | boolean | Whether it has a signing secret. The secret itself is only ever in the answer that made it. |
created | string | |
updated_at | string | Send as expected_updated_at when changing it. |
Change a webhook endpoint
Section titled “Change a webhook endpoint”/v1/manage/webhooks/{webhook}Permission: Full. Changes something: takes dry_run and Idempotency-Key, and needs the Standard plan or above.
Only the fields sent change. A new address is checked again. Send expected_updated_at and a change made in the meantime is refused with 412. With dry_run, nothing changes: the answer is { dry_run: true, before, after, changes, warnings }.
Path parameters:
| Parameter | Description |
|---|---|
webhook | The webhook: its id or its name. URL-encode a name. |
Query parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
dry_run | true, false | No | true: check and preview the change without making it (the same as dry_run in the body). |
Request body (JSON):
| Field | Type | Required | Description |
|---|---|---|---|
name | string | No | A new name. |
url | string | No | A new address, checked again: public HTTPS only. |
events | array of link.clicked, deferred_link.claimed, install.tracked, referral.created, referral.completed, ecommerce.purchase, ecommerce.refund, ecommerce.cart_abandoned, ecommerce.add_to_cart, ecommerce.begin_checkout, ecommerce.add_to_wishlist, ecommerce.fraud_flagged | No | Which events are sent to it, at least one: link.clicked, deferred_link.claimed, install.tracked, referral.created, referral.completed, ecommerce.purchase, ecommerce.refund, ecommerce.cart_abandoned, ecommerce.add_to_cart, ecommerce.begin_checkout, ecommerce.add_to_wishlist, ecommerce.fraud_flagged. |
active | boolean | No | true: events are sent to it. false: they aren’t (nor queued). |
expected_updated_at | string | No | The updated_at you read. If the thing has changed since, nothing is saved and the answer is 412 precondition_failed: read it again and retry. |
Response 200: the result in data, with warnings. With dry_run, a preview instead.
| Field | Type | Description |
|---|---|---|
id | string | The webhook’s id. Any endpoint taking {webhook} also takes its name. |
name | string | |
url | string | |
host | string | |
events | array of link.clicked, deferred_link.claimed, install.tracked, referral.created, referral.completed, ecommerce.purchase, ecommerce.refund, ecommerce.cart_abandoned, ecommerce.add_to_cart, ecommerce.begin_checkout, ecommerce.add_to_wishlist, ecommerce.fraud_flagged | |
active | boolean | |
last_triggered_at | string or null | |
last_status_code | number or null | |
has_secret | boolean | Whether it has a signing secret. The secret itself is only ever in the answer that made it. |
created | string | |
updated_at | string | Send as expected_updated_at when changing it. |
Delete a webhook endpoint
Section titled “Delete a webhook endpoint”/v1/manage/webhooks/{webhook}Permission: Full. Changes something: takes dry_run and Idempotency-Key, and needs the Standard plan or above.
Events stop at once. It goes to the trash and can be restored for 30 days, with its signing secret; its delivery log is deleted. With dry_run, nothing changes: the answer is { dry_run: true, before, after, changes, warnings }.
Path parameters:
| Parameter | Description |
|---|---|
webhook | The webhook: its id or its name. URL-encode a name. |
Query parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
dry_run | true, false | No | true: check and preview the change without making it (the same as dry_run in the body). |
Response 200: the result in data, with warnings. With dry_run, a preview instead.
| Field | Type | Description |
|---|---|---|
deleted | true | |
id | string | |
name | string | |
trash_id | string | The trash entry: POST /webhooks/{webhook}/restore brings it back. |
restorable_until | string |
Turn a webhook endpoint on
Section titled “Turn a webhook endpoint on”/v1/manage/webhooks/{webhook}/activatePermission: Full. Changes something: takes dry_run and Idempotency-Key, and needs the Standard plan or above.
Events are sent to it from now. With dry_run, nothing changes: the answer is { dry_run: true, before, after, changes, warnings }.
Path parameters:
| Parameter | Description |
|---|---|
webhook | The webhook: its id or its name. URL-encode a name. |
Query parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
dry_run | true, false | No | true: check and preview the change without making it (the same as dry_run in the body). |
Response 200: the result in data, with warnings. With dry_run, a preview instead.
| Field | Type | Description |
|---|---|---|
id | string | The webhook’s id. Any endpoint taking {webhook} also takes its name. |
name | string | |
url | string | |
host | string | |
events | array of link.clicked, deferred_link.claimed, install.tracked, referral.created, referral.completed, ecommerce.purchase, ecommerce.refund, ecommerce.cart_abandoned, ecommerce.add_to_cart, ecommerce.begin_checkout, ecommerce.add_to_wishlist, ecommerce.fraud_flagged | |
active | boolean | |
last_triggered_at | string or null | |
last_status_code | number or null | |
has_secret | boolean | Whether it has a signing secret. The secret itself is only ever in the answer that made it. |
created | string | |
updated_at | string | Send as expected_updated_at when changing it. |
Turn a webhook endpoint off
Section titled “Turn a webhook endpoint off”/v1/manage/webhooks/{webhook}/deactivatePermission: Full. Changes something: takes dry_run and Idempotency-Key, and needs the Standard plan or above.
Events stop being sent to it at once, and aren’t queued. With dry_run, nothing changes: the answer is { dry_run: true, before, after, changes, warnings }.
Path parameters:
| Parameter | Description |
|---|---|
webhook | The webhook: its id or its name. URL-encode a name. |
Query parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
dry_run | true, false | No | true: check and preview the change without making it (the same as dry_run in the body). |
Response 200: the result in data, with warnings. With dry_run, a preview instead.
| Field | Type | Description |
|---|---|---|
id | string | The webhook’s id. Any endpoint taking {webhook} also takes its name. |
name | string | |
url | string | |
host | string | |
events | array of link.clicked, deferred_link.claimed, install.tracked, referral.created, referral.completed, ecommerce.purchase, ecommerce.refund, ecommerce.cart_abandoned, ecommerce.add_to_cart, ecommerce.begin_checkout, ecommerce.add_to_wishlist, ecommerce.fraud_flagged | |
active | boolean | |
last_triggered_at | string or null | |
last_status_code | number or null | |
has_secret | boolean | Whether it has a signing secret. The secret itself is only ever in the answer that made it. |
created | string | |
updated_at | string | Send as expected_updated_at when changing it. |
Make a new signing secret
Section titled “Make a new signing secret”/v1/manage/webhooks/{webhook}/rotate-secretPermission: Full. Changes something: takes dry_run and Idempotency-Key, and needs the Standard plan or above.
The current secret stops working at once. The answer carries the new one, once. With dry_run, nothing changes: the answer is { dry_run: true, before, after, changes, warnings }.
Path parameters:
| Parameter | Description |
|---|---|
webhook | The webhook: its id or its name. URL-encode a name. |
Query parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
dry_run | true, false | No | true: check and preview the change without making it (the same as dry_run in the body). |
Response 200: the result in data, with warnings. With dry_run, a preview instead.
| Field | Type | Description |
|---|---|---|
id | string | The webhook’s id. Any endpoint taking {webhook} also takes its name. |
name | string | |
url | string | |
host | string | |
events | array of link.clicked, deferred_link.claimed, install.tracked, referral.created, referral.completed, ecommerce.purchase, ecommerce.refund, ecommerce.cart_abandoned, ecommerce.add_to_cart, ecommerce.begin_checkout, ecommerce.add_to_wishlist, ecommerce.fraud_flagged | |
active | boolean | |
last_triggered_at | string or null | |
last_status_code | number or null | |
has_secret | boolean | Whether it has a signing secret. The secret itself is only ever in the answer that made it. |
created | string | |
updated_at | string | Send as expected_updated_at when changing it. |
secret | string | The signing secret (whsec_…): each request carries X-Webhook-Signature, the HMAC-SHA256 of the raw body with it, in hex. Shown in this answer only; store it now. |
Send a test event
Section titled “Send a test event”/v1/manage/webhooks/{webhook}/testPermission: Full. Changes something: takes dry_run and Idempotency-Key, and needs the Standard plan or above.
Sends one test event (event “test”) to the endpoint now, signed with its secret, exactly as the dashboard’s Send test does, and answers with what came back. It shows in the delivery log (attempt 0). With dry_run, nothing is sent.
Path parameters:
| Parameter | Description |
|---|---|
webhook | The webhook: its id or its name. URL-encode a name. |
Query parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
dry_run | true, false | No | true: check and preview the change without making it (the same as dry_run in the body). |
Response 200: the result in data, with warnings. With dry_run, a preview instead.
| Field | Type | Description |
|---|---|---|
delivered | boolean | |
status_code | number or null | |
error | string or null | |
response_time_ms | number or null |
Restore a deleted webhook endpoint
Section titled “Restore a deleted webhook endpoint”/v1/manage/webhooks/{webhook}/restorePermission: Full. Changes something: takes dry_run and Idempotency-Key, and needs the Standard plan or above.
Brings back an endpoint deleted in the last 30 days, with the same id, events and signing secret, on or off as it was. {webhook} is its old id or name, or the trash entry’s id. On Free, refused with 409 conflict while there’s another webhook. With dry_run, nothing changes: the answer is { dry_run: true, before, after, changes, warnings }.
Path parameters:
| Parameter | Description |
|---|---|
webhook | The webhook: its id or its name. URL-encode a name. |
Query parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
dry_run | true, false | No | true: check and preview the change without making it (the same as dry_run in the body). |
Response 200: the result in data, with warnings. With dry_run, a preview instead.
| Field | Type | Description |
|---|---|---|
id | string | The webhook’s id. Any endpoint taking {webhook} also takes its name. |
name | string | |
url | string | |
host | string | |
events | array of link.clicked, deferred_link.claimed, install.tracked, referral.created, referral.completed, ecommerce.purchase, ecommerce.refund, ecommerce.cart_abandoned, ecommerce.add_to_cart, ecommerce.begin_checkout, ecommerce.add_to_wishlist, ecommerce.fraud_flagged | |
active | boolean | |
last_triggered_at | string or null | |
last_status_code | number or null | |
has_secret | boolean | Whether it has a signing secret. The secret itself is only ever in the answer that made it. |
created | string | |
updated_at | string | Send as expected_updated_at when changing it. |