curl --request POST \
--url https://api-v2.sofiachat.com/api/v1/messages \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"channelId": 12,
"to": "+521 55 1234 5678",
"type": "template",
"template": {
"name": "recordatorio_cita",
"language": "es_MX",
"parameters": {
"nombre": "Juan",
"fecha": "3 de agosto"
}
}
}
'Mensajes
Envía un mensaje de WhatsApp (texto, plantilla, imagen o documento)
POST
/
messages
curl --request POST \
--url https://api-v2.sofiachat.com/api/v1/messages \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"channelId": 12,
"to": "+521 55 1234 5678",
"type": "template",
"template": {
"name": "recordatorio_cita",
"language": "es_MX",
"parameters": {
"nombre": "Juan",
"fecha": "3 de agosto"
}
}
}
'Authorizations
Body
application/json
ID de la integración (canal) de WhatsApp de la organización
Example:
12
Tipo de mensaje a enviar
Available options:
text, template, image, document Example:
"text"
Teléfono destino (se normaliza a E.164). Exactamente uno de to/contactId/chatUserId.
Example:
"+521 55 1234 5678"
ID de contacto de la organización
Example:
345
ID de ChatUser existente
Example:
678
Texto del mensaje (type=text) o caption (image/document)
Example:
"Hola, ¿en qué podemos ayudarte?"
Payload de la plantilla (obligatorio cuando type=template)
Show child attributes
Show child attributes
URL del media (type=image|document)
Example:
"https://cdn.sofiachat.com/media/promo-agosto.jpg"
Si true, la conversación pasa a intervención humana (HITL)
Example:
false
Metadatos libres que se guardan junto al mensaje
Example:
{ "source": "crm", "ticketId": "A-1001" }
Response
201 - undefined

