Skip to content

Webhooks (management API)

View as Markdown

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.

MethodPathWhat it doesPermission
GET/v1/manage/webhooksList webhook endpointsRead and write
POST/v1/manage/webhooksAdd a webhook endpointFull
GET/v1/manage/webhooks/{webhook}Get a webhook endpointRead and write
PATCH/v1/manage/webhooks/{webhook}Change a webhook endpointFull
DELETE/v1/manage/webhooks/{webhook}Delete a webhook endpointFull
POST/v1/manage/webhooks/{webhook}/activateTurn a webhook endpoint onFull
POST/v1/manage/webhooks/{webhook}/deactivateTurn a webhook endpoint offFull
POST/v1/manage/webhooks/{webhook}/rotate-secretMake a new signing secretFull
POST/v1/manage/webhooks/{webhook}/testSend a test eventFull
POST/v1/manage/webhooks/{webhook}/restoreRestore a deleted webhook endpointFull
GET/v1/manage/webhooks

Permission: Read and write.

The Appspace’s webhook endpoints, oldest first, paged with cursor. Never their signing secrets.

Query parameters:

ParameterTypeRequiredDescription
limitintegerNoHow many to return, 1 to 100 (default 50).
cursorstringNoFrom 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:

FieldTypeDescription
idstringThe webhook’s id. Any endpoint taking {webhook} also takes its name.
namestring
urlstring
hoststring
eventsarray 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
activeboolean
last_triggered_atstring or null
last_status_codenumber or null
has_secretbooleanWhether it has a signing secret. The secret itself is only ever in the answer that made it.
createdstring
updated_atstringSend as expected_updated_at when changing it.
POST/v1/manage/webhooks

Permission: 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:

ParameterTypeRequiredDescription
dry_runtrue, falseNotrue: check and preview the change without making it (the same as dry_run in the body).

Request body (JSON):

FieldTypeRequiredDescription
namestringYesA name for your team, such as “Production server”.
urlstringYesWhere events are posted: a public HTTPS address. Must answer 2xx within 10 seconds.
eventsarray 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_flaggedYesWhich 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.
activebooleanNoWhether 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.

FieldTypeDescription
idstringThe webhook’s id. Any endpoint taking {webhook} also takes its name.
namestring
urlstring
hoststring
eventsarray 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
activeboolean
last_triggered_atstring or null
last_status_codenumber or null
has_secretbooleanWhether it has a signing secret. The secret itself is only ever in the answer that made it.
createdstring
updated_atstringSend as expected_updated_at when changing it.
secretstringThe 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/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:

ParameterDescription
webhookThe webhook: its id or its name. URL-encode a name.

Response 200: the result in data.

FieldTypeDescription
idstringThe webhook’s id. Any endpoint taking {webhook} also takes its name.
namestring
urlstring
hoststring
eventsarray 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
activeboolean
last_triggered_atstring or null
last_status_codenumber or null
has_secretbooleanWhether it has a signing secret. The secret itself is only ever in the answer that made it.
createdstring
updated_atstringSend as expected_updated_at when changing it.
PATCH/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:

ParameterDescription
webhookThe webhook: its id or its name. URL-encode a name.

Query parameters:

ParameterTypeRequiredDescription
dry_runtrue, falseNotrue: check and preview the change without making it (the same as dry_run in the body).

Request body (JSON):

FieldTypeRequiredDescription
namestringNoA new name.
urlstringNoA new address, checked again: public HTTPS only.
eventsarray 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_flaggedNoWhich 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.
activebooleanNotrue: events are sent to it. false: they aren’t (nor queued).
expected_updated_atstringNoThe 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.

FieldTypeDescription
idstringThe webhook’s id. Any endpoint taking {webhook} also takes its name.
namestring
urlstring
hoststring
eventsarray 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
activeboolean
last_triggered_atstring or null
last_status_codenumber or null
has_secretbooleanWhether it has a signing secret. The secret itself is only ever in the answer that made it.
createdstring
updated_atstringSend as expected_updated_at when changing it.
DELETE/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:

ParameterDescription
webhookThe webhook: its id or its name. URL-encode a name.

Query parameters:

ParameterTypeRequiredDescription
dry_runtrue, falseNotrue: 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.

FieldTypeDescription
deletedtrue
idstring
namestring
trash_idstringThe trash entry: POST /webhooks/{webhook}/restore brings it back.
restorable_untilstring
POST/v1/manage/webhooks/{webhook}/activate

Permission: 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:

ParameterDescription
webhookThe webhook: its id or its name. URL-encode a name.

Query parameters:

ParameterTypeRequiredDescription
dry_runtrue, falseNotrue: 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.

FieldTypeDescription
idstringThe webhook’s id. Any endpoint taking {webhook} also takes its name.
namestring
urlstring
hoststring
eventsarray 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
activeboolean
last_triggered_atstring or null
last_status_codenumber or null
has_secretbooleanWhether it has a signing secret. The secret itself is only ever in the answer that made it.
createdstring
updated_atstringSend as expected_updated_at when changing it.
POST/v1/manage/webhooks/{webhook}/deactivate

Permission: 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:

ParameterDescription
webhookThe webhook: its id or its name. URL-encode a name.

Query parameters:

ParameterTypeRequiredDescription
dry_runtrue, falseNotrue: 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.

FieldTypeDescription
idstringThe webhook’s id. Any endpoint taking {webhook} also takes its name.
namestring
urlstring
hoststring
eventsarray 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
activeboolean
last_triggered_atstring or null
last_status_codenumber or null
has_secretbooleanWhether it has a signing secret. The secret itself is only ever in the answer that made it.
createdstring
updated_atstringSend as expected_updated_at when changing it.
POST/v1/manage/webhooks/{webhook}/rotate-secret

Permission: 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:

ParameterDescription
webhookThe webhook: its id or its name. URL-encode a name.

Query parameters:

ParameterTypeRequiredDescription
dry_runtrue, falseNotrue: 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.

FieldTypeDescription
idstringThe webhook’s id. Any endpoint taking {webhook} also takes its name.
namestring
urlstring
hoststring
eventsarray 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
activeboolean
last_triggered_atstring or null
last_status_codenumber or null
has_secretbooleanWhether it has a signing secret. The secret itself is only ever in the answer that made it.
createdstring
updated_atstringSend as expected_updated_at when changing it.
secretstringThe 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.
POST/v1/manage/webhooks/{webhook}/test

Permission: 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:

ParameterDescription
webhookThe webhook: its id or its name. URL-encode a name.

Query parameters:

ParameterTypeRequiredDescription
dry_runtrue, falseNotrue: 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.

FieldTypeDescription
deliveredboolean
status_codenumber or null
errorstring or null
response_time_msnumber or null
POST/v1/manage/webhooks/{webhook}/restore

Permission: 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:

ParameterDescription
webhookThe webhook: its id or its name. URL-encode a name.

Query parameters:

ParameterTypeRequiredDescription
dry_runtrue, falseNotrue: 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.

FieldTypeDescription
idstringThe webhook’s id. Any endpoint taking {webhook} also takes its name.
namestring
urlstring
hoststring
eventsarray 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
activeboolean
last_triggered_atstring or null
last_status_codenumber or null
has_secretbooleanWhether it has a signing secret. The secret itself is only ever in the answer that made it.
createdstring
updated_atstringSend as expected_updated_at when changing it.
Was this page helpful?