Communications API Reference

Queue a transactional email, WhatsApp or SMS with your team token, then fetch the same record to read its delivery status.

Base URL
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.

Authentication

All requests require team token authentication. Include the token in the Authorization header:

Authorization: Bearer YOUR_API_TOKEN
Note: The send is asynchronous. The create response returns status pending. Poll GET until status is sent or failed.
Available Endpoints
POST Send a communication
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[].

Request body
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.
Example request (email)
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"
Example request (email JSON, no files)
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" }
  }'
Example request (WhatsApp)
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"
Example request (WhatsApp JSON, no files)
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ó."
  }'
Example request (SMS)
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 response (201)
{
  "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"
      }
    ]
  }
}
Error responses
HTTP When
401 Missing or invalid team API token
422 Validation error (channel, recipient, subject, phone or attachments)
GET Get a communication
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.

Example request
curl "https://staging.humano.app/api/team/communications/1842" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Accept: application/json"
Success response (200)
{
  "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"
      }
    ]
  }
}
Status values
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.
Error responses
HTTP When
401 Missing or invalid team API token
404 Communication not found for this team