Webhooks
Abonne-toi aux événements avec POST /v1/webhook-subscriptions. SmartChat envoie ensuite un POST signé à ton adresse pour chaque événement. Toute réponse 2xx confirme la livraison.
La référence technique ci-dessous est en anglais, exactement comme les noms et champs apparaissent dans l'API et dans Claude.
curl -X POST https://api.smartchat.marketing/v1/webhook-subscriptions \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com/hook", "events": ["contact.created"]}'contact.created
A contact was created
| Champ | Type | Obligatoire | Description |
|---|---|---|---|
id | string | non | Unique event id, e.g. "message.received:<uuid>". Equals X-SmartChat-Delivery. |
event | string ("contact.created", "message.received", "conversation.created") | non | |
created_at | string | non | format date-time |
data | object | non | |
data.id | string | non | format uuid |
data.name | string | non | |
data.email | string | non | Empty string "" if none. |
data.phone | string | non | E.164; empty string "" if none. |
data.optin_whatsapp | string ("none", "pending", "confirmed", "opted_out") | non | |
data.optin_email | string ("none", "pending", "confirmed", "opted_out") | non | |
data.tags | array of string | non | |
data.language | string | non | |
data.source | string | non | |
data.created_at | string | non | There is no updated_at on contacts. format date-time |
message.received
An inbound message was received
| Champ | Type | Obligatoire | Description |
|---|---|---|---|
id | string | non | Unique event id, e.g. "message.received:<uuid>". Equals X-SmartChat-Delivery. |
event | string ("contact.created", "message.received", "conversation.created") | non | |
created_at | string | non | format date-time |
data | object | non | Item of GET /messages; also the data of the message.received webhook event. |
data.id | string | non | format uuid |
data.conversation_id | string | non | format uuid |
data.contact_id | string | non | format uuid |
data.channel | string | non | whatsapp, email, ... |
data.direction | string ("inbound", "outbound") | non | |
data.type | string | non | text, or a media type: image, video, audio, document, sticker, ... |
data.text | string | non | |
data.media_url | string | non | |
data.media_mime | string | non | |
data.created_at | string | non | format date-time |
conversation.created
A conversation was created
| Champ | Type | Obligatoire | Description |
|---|---|---|---|
id | string | non | Unique event id, e.g. "message.received:<uuid>". Equals X-SmartChat-Delivery. |
event | string ("contact.created", "message.received", "conversation.created") | non | |
created_at | string | non | format date-time |
data | object | non | |
data.id | string | non | format uuid |
data.contact_id | string | non | format uuid |
data.channel | string | non | |
data.created_at | string | non | format date-time |
Des questions ?
Écris-nous à support@smartchat.marketing