API — Mensagens

Envio de mensagens externas vinculadas a um frete.

POST /messages

Dispara uma mensagem por um canal externo (WhatsApp, SMS, e-mail).

bash
curl -X POST https://freteflow.fr.com.br/api/public/v1/messages \
  -H "X-API-Key: ff_live_xxx..." \
  -H "Content-Type: application/json" \
  -d '{
    "channel": "whatsapp",
    "to": "+5511999999999",
    "freight_id": "FR-1234",
    "template": "driver_assigned",
    "variables": { "driver_name": "João" }
  }'
json
{
  "id": "msg_abc123",
  "status": "queued",
  "channel": "whatsapp",
  "created_at": "2026-05-06T10:11:12Z"
}

Você pode enviar texto livre (campo body) em vez de template, mas recomendamos templates por consistência e auditoria.