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

ChampTypeObligatoireDescription
idstringnonUnique event id, e.g. "message.received:<uuid>". Equals X-SmartChat-Delivery.
eventstring ("contact.created", "message.received", "conversation.created")non
created_atstringnon
format date-time
dataobjectnon
data.idstringnon
format uuid
data.namestringnon
data.emailstringnonEmpty string "" if none.
data.phonestringnonE.164; empty string "" if none.
data.optin_whatsappstring ("none", "pending", "confirmed", "opted_out")non
data.optin_emailstring ("none", "pending", "confirmed", "opted_out")non
data.tagsarray of stringnon
data.languagestringnon
data.sourcestringnon
data.created_atstringnonThere is no updated_at on contacts.
format date-time

message.received

An inbound message was received

ChampTypeObligatoireDescription
idstringnonUnique event id, e.g. "message.received:<uuid>". Equals X-SmartChat-Delivery.
eventstring ("contact.created", "message.received", "conversation.created")non
created_atstringnon
format date-time
dataobjectnonItem of GET /messages; also the data of the message.received webhook event.
data.idstringnon
format uuid
data.conversation_idstringnon
format uuid
data.contact_idstringnon
format uuid
data.channelstringnonwhatsapp, email, ...
data.directionstring ("inbound", "outbound")non
data.typestringnontext, or a media type: image, video, audio, document, sticker, ...
data.textstringnon
data.media_urlstringnon
data.media_mimestringnon
data.created_atstringnon
format date-time

conversation.created

A conversation was created

ChampTypeObligatoireDescription
idstringnonUnique event id, e.g. "message.received:<uuid>". Equals X-SmartChat-Delivery.
eventstring ("contact.created", "message.received", "conversation.created")non
created_atstringnon
format date-time
dataobjectnon
data.idstringnon
format uuid
data.contact_idstringnon
format uuid
data.channelstringnon
data.created_atstringnon
format date-time

Des questions ?

Écris-nous à support@smartchat.marketing