Webhook
Iscriviti agli eventi con POST /v1/webhook-subscriptions. SmartChat invia poi un POST firmato al tuo indirizzo per ogni evento. Qualsiasi risposta 2xx conferma la consegna.
Il riferimento tecnico qui sotto è in inglese, esattamente come nomi e campi appaiono nell'API e in 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
| Campo | Tipo | Obbligatorio | Descrizione |
|---|---|---|---|
id | string | no | Unique event id, e.g. "message.received:<uuid>". Equals X-SmartChat-Delivery. |
event | string ("contact.created", "message.received", "conversation.created") | no | |
created_at | string | no | format date-time |
data | object | no | |
data.id | string | no | format uuid |
data.name | string | no | |
data.email | string | no | Empty string "" if none. |
data.phone | string | no | E.164; empty string "" if none. |
data.optin_whatsapp | string ("none", "pending", "confirmed", "opted_out") | no | |
data.optin_email | string ("none", "pending", "confirmed", "opted_out") | no | |
data.tags | array of string | no | |
data.language | string | no | |
data.source | string | no | |
data.created_at | string | no | There is no updated_at on contacts. format date-time |
message.received
An inbound message was received
| Campo | Tipo | Obbligatorio | Descrizione |
|---|---|---|---|
id | string | no | Unique event id, e.g. "message.received:<uuid>". Equals X-SmartChat-Delivery. |
event | string ("contact.created", "message.received", "conversation.created") | no | |
created_at | string | no | format date-time |
data | object | no | Item of GET /messages; also the data of the message.received webhook event. |
data.id | string | no | format uuid |
data.conversation_id | string | no | format uuid |
data.contact_id | string | no | format uuid |
data.channel | string | no | whatsapp, email, ... |
data.direction | string ("inbound", "outbound") | no | |
data.type | string | no | text, or a media type: image, video, audio, document, sticker, ... |
data.text | string | no | |
data.media_url | string | no | |
data.media_mime | string | no | |
data.created_at | string | no | format date-time |
conversation.created
A conversation was created
| Campo | Tipo | Obbligatorio | Descrizione |
|---|---|---|---|
id | string | no | Unique event id, e.g. "message.received:<uuid>". Equals X-SmartChat-Delivery. |
event | string ("contact.created", "message.received", "conversation.created") | no | |
created_at | string | no | format date-time |
data | object | no | |
data.id | string | no | format uuid |
data.contact_id | string | no | format uuid |
data.channel | string | no | |
data.created_at | string | no | format date-time |
Domande?
Scrivici a support@smartchat.marketing