Webhooks
Subscribe to events with POST /v1/webhook-subscriptions. SmartChat then sends a signed POST to your address for each event. Any 2xx answer confirms the delivery.
The technical reference below is in English, exactly as the names and fields appear in the API and 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
| Field | Type | Required | Description |
|---|---|---|---|
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
| Field | Type | Required | Description |
|---|---|---|---|
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
| Field | Type | Required | Description |
|---|---|---|---|
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 |
Questions?
Email us at support@smartchat.marketing