Outgoing notifications: we'll alert you
The platform calls your server when something happens.
It's the opposite of the API: instead of you asking repeatedly, we call your address when something occurs. It avoids having a program asking 'Is there anything new?' every minute.
You register an address, choose which events you want, and receive a POST with the details. Every notification is signed so you can verify it comes from us.
If your server fails, we retry, and you can see deliveries and retry one manually.
What you can do
- Receive a notification when a contact is created or a message arrives.
- Receive a notification when an opportunity changes stage.
- Receive catalog notifications: product created, modified, deleted, or stock changed.
- View delivery history and retry failed ones.
- Rotate the signing secret without re-registering the notification.
Events you can listen to
| Event | When it triggers |
|---|---|
| contact.created | A contact is created, no matter how they write. |
| message.received | A message from a customer arrives. |
| opportunity.stage_changed | An opportunity changes stage. |
| product.created | A product is created in the catalog. |
| product.updated | A product is modified. |
| product.deleted | A product is deleted. |
| product.stock_changed | A product's stock changes. |
Register a notification
curl -X POST https://platform.chatlevel.ai/api/v1/webhooks \
-H "X-ACCESS-TOKEN: tu_clave" \
-H "Content-Type: application/json" \
-d '{
"url": "https://mi-servidor.com/hooks/chat",
"events": ["contact.created", "message.received"]
}'What your server receives
POST /hooks/chat
X-Signature: sha256=...
{
"event": "message.received",
"data": {
"conversation_id": "cnv_123",
"contact": { "id": "cnt_abc", "name": "Ana López" },
"text": "¿Tenéis la talla M?"
}
}An example
Alert the ERP of each sale
- You register a notification for opportunity.stage_changed.
- When an opportunity reaches 'won', your server receives the POST.
- Verify the signature, reply with 200 right away, and queue the work.
- Then create the invoice in the ERP, without keeping our notification waiting.
Recommendations
- Reply with 200 quickly and process afterward. If you take too long, it counts as a failure and we retry.
- Always verify the signature. Without it, anyone who knows your address can send you fake notifications.
- Rotate the secret if you ever shared it.
Watch out for this
- A notification might reach you twice. Store the identifier and discard duplicates.
- If your address fails for a long time, deliveries pile up. Check the history before you assume an event is lost.
