API: webhooks
Get a request sent to your server the moment something happens, verify it really came from us, and handle retries.
A webhook sends a POST request to your server whenever something happens in your account, such as a new contact or an incoming text. It is faster and cheaper than asking the API for changes over and over.
Permission: webhooks:manage. All paths below start with https://YOUR-CRM-ADDRESS.
Method | Path | What it does |
|---|---|---|
|
| List your subscriptions |
|
| Create a subscription |
|
| Change its address, events, description or on/off |
|
| Delete it |
|
| Get a new signing secret |
Create a subscription
curl -X POST "https://YOUR-CRM-ADDRESS/api/v1/webhooks" \
-H "Authorization: Bearer sk_live_YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"url": "https://your-server.example.com/hooks/crm",
"events": ["contact.created", "message.received"],
"description": "Chatbot integration"
}'{
"data": {
"id": "kw1a2b3c4d5e6f7g8h9i0j1k",
"url": "https://your-server.example.com/hooks/crm",
"events": ["contact.created", "message.received"],
"isActive": true,
"description": "Chatbot integration",
"secret": "3f9c2a7e5b1d4c8a9e6f0b2d7a4c1e8f5b3d9a6c2e7f1b4d8a5c3e9f6b2d7a1c",
"createdAt": 1774621800000,
"updatedAt": 1774621800000
}
}Save the secret now. It is shown only when you create the subscription or regenerate the secret, never when you list them.
The address must be a public
https://address. Private and internal network addresses are refused.An account can have up to 50 subscriptions.
If your server answers with a redirect to a different address, we don't follow it, so the signed request only ever reaches the address you gave.
Outgoing webhooks aren't available on HIPAA accounts yet.
Events you can subscribe to
Area | Events |
|---|---|
Contacts |
|
Messages |
|
Appointments |
|
Opportunities |
|
Tasks |
|
Forms and invoices |
|
Community |
|
What we send
Every delivery is a JSON POST with the same envelope:
{
"event": "message.received",
"timestamp": "2026-03-27T14:34:00.000Z",
"data": {
"subAccountId": "ks9z8y7x6w5v4u3t2s1r0q9p",
"contactId": "jd7a1b2c3d4e5f6g7h8i9j0k",
"messageId": "km1a2b3c4d5e6f7g8h9i0j1k",
"conversationId": "kc4d5e6f7g8h9i0j1k2l3m4n",
"channel": "sms",
"bodyText": "Hi, I'd like to schedule an appointment",
"fromAddress": "+15559876543",
"direction": "inbound",
"tags": ["website-lead"]
}
}With these headers:
Header | What it is |
|---|---|
| The event name, for example |
|
|
|
|
| When we sent it, in Unix milliseconds. |
| The same for every retry of one event. Use it to skip duplicates. |
| Different on every attempt. Useful when talking to support. |
Verify every request
Anyone can send a request to your address, so check the signature before you trust it. Compute the HMAC over the raw body bytes, before parsing the JSON, and compare it in constant time:
import crypto from 'node:crypto';
function isValid(rawBody, headers, secret) {
const timestamp = headers['x-webhook-timestamp'];
const expected = crypto
.createHmac('sha256', secret)
.update(`${timestamp}.${rawBody}`)
.digest('hex');
const received = (headers['x-webhook-signature-v2'] || '').replace('sha256=', '');
const fresh = Math.abs(Date.now() - Number(timestamp)) < 5 * 60 * 1000;
return (
fresh &&
received.length === expected.length &&
crypto.timingSafeEqual(Buffer.from(received), Buffer.from(expected))
);
}The older X-Webhook-Signature header signs the body alone (HMAC(secret, rawBody)) and is still sent for existing integrations.
Answer quickly
Reply with any 2xx status within 10 seconds. Do the slow work after you reply, or in a queue.
Retries and automatic switch-off
A delivery that times out or gets a non-
2xxanswer is tried up to 5 times in all, waiting about 30 seconds, 2 minutes, 10 minutes and 30 minutes between tries.The same event can arrive more than once. Skip any
X-Webhook-Event-Idyou have already handled.Events can arrive out of order. Use the body's
timestampif order matters.After 20 events in a row fail every retry, the subscription is switched off and your account admins are told. Fix your server, then turn it back on with
PATCH /api/v1/webhooks/{id}and{ "isActive": true }.
Change or rotate
PATCH /api/v1/webhooks/{id}with any ofurl,events,descriptionorisActive.POST /api/v1/webhooks/{id}/regenerate-secretreturns a newsecret. The old one stops working at once, so update your server straight away.
Paused accounts
While an account is paused, deliveries are held, not sent. They go out once the account is resumed.
Was this article helpful?
Your answer helps us improve this article.
Related articles
- Getting started with the APIWhat the API does, the address to call, and how to make your first request in a few minutes.
- API: contactsCreate, find, update, tag and delete contacts, add notes, and read your custom fields through the API.
- API: conversations and messagesStart or find a conversation, read its messages, send a text or email, and close or reassign it through the API.
- API rate limitsHow many requests a token may send each minute, how to read the limit headers, and what to do when you hit 429.