Queue a transactional email, WhatsApp or SMS with your team token, then fetch the same record to read its delivery status.
https://staging.humano.app/api/team/communications
This endpoint uses team token authentication. The team is determined by the Bearer token, not by a team_id parameter.
All requests require team token authentication. Include the token in the Authorization header:
Authorization: Bearer YOUR_API_TOKEN
https://staging.humano.app/api/team/communications
Queue one message to one recipient. Email requires recipient_email and subject. WhatsApp and SMS require recipient_phone (10–15 digits). Attachments are allowed on email and WhatsApp (max 5 files, 10 MB each). SMS returns 422 if files are sent. JSON cannot carry files: send attachments as multipart with attachments[].
| Field | Tipo | Required | Descripción |
|---|---|---|---|
channel |
string | Sí | email, whatsapp or sms |
message |
string | Sí | Message body |
recipient_email |
string | If email | Recipient email address |
subject |
string | If email | Email subject (max 255) |
recipient_phone |
string | If WhatsApp/SMS | Phone number, 10–15 digits. Non-digits are stripped. |
recipient_name |
string | No | Display name |
contact_id |
integer | No | Existing contact in the same team. Otherwise matched by email or phone. |
metadata |
object | No | Arbitrary JSON. In multipart, send a JSON string. |
attachments |
file[] | No | Email and WhatsApp. Field name attachments[]. SMS returns 422 if files are sent. |
curl -X POST "https://staging.humano.app/api/team/communications" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Accept: application/json" \
-F "channel=email" \
-F "recipient_email=ada@example.com" \
-F "recipient_name=Tester" \
-F "subject=Tu factura" \
-F "message=Adjuntamos la factura y el recibo de pago. https://idoneo.dev" \
-F "metadata={\"source\":\"erp\",\"external_id\":\"INV-1042\"}" \
-F "attachments[]=@./factura.pdf" \
-F "attachments[]=@./recibo-de-pago.pdf"
curl -X POST "https://staging.humano.app/api/team/communications" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"channel": "email",
"recipient_email": "ada@example.com",
"recipient_name": "Tester",
"subject": "Tu factura",
"message": "Tu factura del período está lista. https://idoneo.dev",
"metadata": { "source": "erp", "external_id": "INV-1042" }
}'
curl -X POST "https://staging.humano.app/api/team/communications" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Accept: application/json" \
-F "channel=whatsapp" \
-F "recipient_phone=+34 600 111 222" \
-F "message=Adjuntamos la factura y el recibo de pago." \
-F "attachments[]=@./factura.pdf" \
-F "attachments[]=@./recibo-de-pago.pdf"
curl -X POST "https://staging.humano.app/api/team/communications" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"channel": "whatsapp",
"recipient_phone": "+34 600 111 222",
"message": "Hola, tu pedido ya salió."
}'
curl -X POST "https://staging.humano.app/api/team/communications" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"channel": "sms",
"recipient_phone": "34600111222",
"message": "Código 4821. Caduca en 10 minutos."
}'
{
"success": true,
"message": "Communication queued successfully",
"data": {
"id": 1842,
"channel": "email",
"channel_label": "Email",
"status": "pending",
"status_label": "Pendiente",
"recipient_email": "ada@example.com",
"recipient_phone": null,
"recipient_name": "Tester",
"subject": "Tu factura",
"message": "Adjuntamos la factura y el recibo de pago. https://idoneo.dev",
"error_message": null,
"metadata": { "source": "erp", "external_id": "INV-1042" },
"sent_at": null,
"created_at": "2026-09-18T13:54:00+00:00",
"contact": null,
"attachments": [
{
"id": 12,
"file_name": "factura.pdf",
"mime_type": "application/pdf",
"size": 122880,
"url": "https://staging.humano.app/storage/12/factura.pdf"
},
{
"id": 13,
"file_name": "recibo-de-pago.pdf",
"mime_type": "application/pdf",
"size": 81920,
"url": "https://staging.humano.app/storage/13/recibo-de-pago.pdf"
}
]
}
}
| HTTP | When |
|---|---|
401 |
Missing or invalid team API token |
422 |
Validation error (channel, recipient, subject, phone or attachments) |
https://staging.humano.app/api/team/communications/{id}
Returns the queued message, attachments and delivery status. Use data.status: pending, sent or failed. When failed, read data.error_message. When sent, data.sent_at is ISO-8601.
curl "https://staging.humano.app/api/team/communications/1842" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Accept: application/json"
{
"success": true,
"data": {
"id": 1842,
"channel": "email",
"status": "sent",
"status_label": "Enviado",
"recipient_email": "ada@example.com",
"subject": "Tu factura",
"message": "Adjuntamos la factura y el recibo de pago. https://idoneo.dev",
"error_message": null,
"sent_at": "2026-09-18T13:54:08+00:00",
"created_at": "2026-09-18T13:54:00+00:00",
"contact": {
"id": 88,
"name": "Tester",
"email": "ada@example.com",
"phone": null
},
"attachments": [
{
"id": 12,
"file_name": "factura.pdf",
"mime_type": "application/pdf",
"size": 122880,
"url": "https://staging.humano.app/storage/12/factura.pdf"
},
{
"id": 13,
"file_name": "recibo-de-pago.pdf",
"mime_type": "application/pdf",
"size": 81920,
"url": "https://staging.humano.app/storage/13/recibo-de-pago.pdf"
}
]
}
}
| Estado | Descripción |
|---|---|
pending |
Queued or retrying. sent_at is null. |
sent |
Delivered to the provider. sent_at is set. |
failed |
Did not send. Reason in error_message. WhatsApp outside the 24h window fails without automatic retries. |
| HTTP | When |
|---|---|
401 |
Missing or invalid team API token |
404 |
Communication not found for this team |