curl --request POST \
--url https://chat.trysetter.com/api/v1/webhooks/lead-events \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"organizationId": 42,
"eventType": "mastery_purchase",
"events": [
{
"phoneE164": "+15551234567",
"occurredAt": "2026-05-12T18:34:00Z",
"metadata": {
"orderId": "ord_9F2",
"amountUsd": 297
}
}
]
}
'{
"status": "accepted",
"received": 3,
"inserted": 3,
"duplicates": 0,
"rejected": 0,
"rejects": []
}Campaigns
Send Lead Event
Record a per-phone event so future campaign sends can include or exclude that lead
POST
/
api
/
v1
/
webhooks
/
lead-events
curl --request POST \
--url https://chat.trysetter.com/api/v1/webhooks/lead-events \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"organizationId": 42,
"eventType": "mastery_purchase",
"events": [
{
"phoneE164": "+15551234567",
"occurredAt": "2026-05-12T18:34:00Z",
"metadata": {
"orderId": "ord_9F2",
"amountUsd": 297
}
}
]
}
'{
"status": "accepted",
"received": 3,
"inserted": 3,
"duplicates": 0,
"rejected": 0,
"rejects": []
}Overview
Generic per-phone event stream. Use this to tell Setter “this phone number did event X at time T” so future campaign sends can include or exclude that lead based on whether the event happened (optionally within a time window). Typical event types:mastery_purchase, webinar_attended, trial_started, cart_abandoned. You choose the names — they’re free strings scoped to your organization.
Shape-agnostic: this endpoint accepts either real-time per-event POSTs (one event per call) or bulk batches (up to 50,000 events per call). Both produce the same rows; the filter logic doesn’t care which shape was used.
Authentication
Pick the auth mode for inbound webhooks once per organization, in Settings → Webhooks:- API key (default) — Bearer-token auth using any active org-level API key.
- HMAC — generate a signing key, sign the raw request body with HMAC-SHA256, send as
X-Setter-Signature: sha256=<hex>. Multiple signing keys can be active concurrently for rotation.
How sends consume these events
When configuring a send under Campaigns → Sequence → Add a send, enable Event filter and pick:- Mode —
exclude(skip leads that have the event) orinclude(only send to leads that have the event). - Event type — must match the
eventTypeyou POST. - Within last (minutes, optional) — only consider events whose
occurredAtis within this many minutes of the send firing.
- Skip anyone who’s ever purchased Mastery:
{ mode: "exclude", eventType: "mastery_purchase" }(no window — sticky event) - Skip anyone currently in the live event:
{ mode: "exclude", eventType: "webinar_attended", within: { minutes: 120 } }(windowed — “currently attending”)
Idempotency and validation
The unique key(organizationId, phoneE164, eventType, occurredAt) makes retries safe — re-POSTing the same batch returns duplicates = received and inserted = 0.
Invalid rows (bad phone, missing/invalid occurredAt, oversize metadata) are rejected per-row, not per-batch — you get a structured rejects[] array back rather than a 400 for the whole call. The first 50 rejection reasons are returned for debugging.
Phone normalization
phoneE164 is parsed via libphonenumber. Accepts the value with or without leading + and tolerates common formatting variants. Numbers that don’t parse are reported in rejects[] with reason invalid phoneE164.
Caps
| Limit | Value |
|---|---|
| Events per request | 50,000 |
| Request body size | 10 MB |
eventType length | 128 chars |
metadata per event (encoded) | 8 KB |
Example Usage
Real-time single event (Bearer API key)
curl -X POST https://chat.trysetter.com/api/v1/webhooks/lead-events \
-H "Authorization: Bearer your_api_key" \
-H "Content-Type: application/json" \
-d '{
"organizationId": 42,
"eventType": "mastery_purchase",
"events": [
{
"phoneE164": "+15551234567",
"occurredAt": "2026-05-12T18:34:00Z",
"metadata": { "orderId": "ord_9F2", "amountUsd": 297 }
}
]
}'
Bulk batch (HMAC signature)
SECRET="your-signing-secret"
BODY='{"organizationId":42,"eventType":"webinar_attended","events":[{"phoneE164":"+15551234567","occurredAt":"2026-05-15T13:00:00Z"},{"phoneE164":"+447700900123","occurredAt":"2026-05-15T13:05:11Z"}]}'
SIG=$(printf '%s' "$BODY" | openssl dgst -sha256 -hmac "$SECRET" -binary | xxd -p -c 256)
curl -X POST https://chat.trysetter.com/api/v1/webhooks/lead-events \
-H "Content-Type: application/json" \
-H "X-Setter-Signature: sha256=$SIG" \
--data-raw "$BODY"
Authorizations
bearerAuthsignatureAuth
Body
application/json
Response
Batch processed. Inspect inserted / duplicates / rejected for outcome detail.

