Webhooks

Suscríbete a eventos con POST /v1/webhook-subscriptions. SmartChat envía entonces un POST firmado a tu dirección por cada evento. Cualquier respuesta 2xx confirma la entrega.

La referencia técnica de abajo está en inglés, exactamente como aparecen los nombres y campos en la API y en 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

CampoTipoObligatorioDescripción
idstringnoUnique event id, e.g. "message.received:<uuid>". Equals X-SmartChat-Delivery.
eventstring ("contact.created", "message.received", "conversation.created")no
created_atstringno
format date-time
dataobjectno
data.idstringno
format uuid
data.namestringno
data.emailstringnoEmpty string "" if none.
data.phonestringnoE.164; empty string "" if none.
data.optin_whatsappstring ("none", "pending", "confirmed", "opted_out")no
data.optin_emailstring ("none", "pending", "confirmed", "opted_out")no
data.tagsarray of stringno
data.languagestringno
data.sourcestringno
data.created_atstringnoThere is no updated_at on contacts.
format date-time

message.received

An inbound message was received

CampoTipoObligatorioDescripción
idstringnoUnique event id, e.g. "message.received:<uuid>". Equals X-SmartChat-Delivery.
eventstring ("contact.created", "message.received", "conversation.created")no
created_atstringno
format date-time
dataobjectnoItem of GET /messages; also the data of the message.received webhook event.
data.idstringno
format uuid
data.conversation_idstringno
format uuid
data.contact_idstringno
format uuid
data.channelstringnowhatsapp, email, ...
data.directionstring ("inbound", "outbound")no
data.typestringnotext, or a media type: image, video, audio, document, sticker, ...
data.textstringno
data.media_urlstringno
data.media_mimestringno
data.created_atstringno
format date-time

conversation.created

A conversation was created

CampoTipoObligatorioDescripción
idstringnoUnique event id, e.g. "message.received:<uuid>". Equals X-SmartChat-Delivery.
eventstring ("contact.created", "message.received", "conversation.created")no
created_atstringno
format date-time
dataobjectno
data.idstringno
format uuid
data.contact_idstringno
format uuid
data.channelstringno
data.created_atstringno
format date-time

¿Preguntas?

Escríbenos a support@smartchat.marketing