Add a webhook to a campaign
POST
/api/v1/campaigns/{uid}/webhooks
From now on, each event of this type is posted to endpoint as JSON, signed in the
X-Webhook-Signature header: sha256= followed by the HMAC-SHA256 of the raw body,
keyed with the webhook's secret. A delivery is tried 5 times.
Parameters
uid
string
required
path
The campaign's uid.
Request body application/x-www-form-urlencoded
type
string
required
One of:
open, click, unsubscribe, bounce, complaint.
endpoint
string (uri)
required
The URL the events are posted to, at most 2048 characters.
is_active
boolean
Default:
1Responses
201
The webhook, with its uid and secret.
401
The token is missing or wrong (
Unauthenticated.), or its user may not act on
this object (Unauthorized). Without the Accept: application/json header, a
missing or wrong token answers with a redirect to the sign-in page instead.
403
The campaign is not the token's.
404
No campaign has this uid.
422
A field is wrong. The first message, then every one.
Add a webhook to a campaign
1
2
3
4
5
6
curl -X POST 'https://your-domain/api/v1/campaigns/6adaabd2b4753/webhooks' \
-H "Accept: application/json" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
--data-urlencode 'type=bounce' \
--data-urlencode 'endpoint=https://crm.example.com/hooks/bounce' \
--data-urlencode 'is_active=1'
Response
{
"uid": "6af7d91dd5d06",
"type": "bounce",
"endpoint": "https://crm.example.com/hooks/bounce",
"secret": "3f1c9a0b7e2d4c6f8a1b3c5d7e9f0a2b",
"is_active": true,
"consecutive_failures": 0,
"last_attempt_at": null,
"last_status_code": null,
"last_error": null,
"created_at": "2026-11-14T10:00:00+00:00",
"updated_at": "2026-11-14T10:00:00+00:00"
}