POST
/v1/webhooksCreate a webhook
Creates a webhook endpoint for event, audience, delivery, or alert notifications.
Authentication
Requires Authorization: Bearer ${API_KEY}. Create and rotate keys from the TrackLayer dashboard.
Request body schema
{
"url": "string",
"events": [
"string"
],
"enabled": "boolean"
}Response schema · 201
{
"id": "wh_123",
"signing_secret": "whsec_..."
}Response example
{
"id": "wh_123",
"signing_secret": "whsec_..."
}Code examples
curl https://api.tracklayer.com/v1/webhooks \
-X POST \
-H "Authorization: Bearer ${API_KEY}" \
-H "Content-Type: application/json" \
-d '{"event_name":"purchase","user_id":"u_123","properties":{"order_id":"100045","value":129}}'Try it out
Use the dashboard to create an API key, then run one of the examples above with TRACKLAYER_API_KEY set in your environment.