Capabilities

Send a message

Two-way SMS ships with every number. The sender is resolved from the numbers your agents own.

curl -X POST https://klaw-voice.netlify.app/api/v1/messages \
  -H "Authorization: Bearer $KLAW_KEY" -H "Content-Type: application/json" \
  -d '{
    "to": "+14155550132",
    "body": "Hi Sarah — confirming your cleaning Thursday at 2pm. Reply C to confirm.",
    "idempotency_key": "confirm-4821"
  }'
  • to and body (≤1600 chars) are required.
  • from (an E.164 you own) or from_number_id picks the sending number when you have several; with one number you can omit both.
  • idempotency_key makes retries safe.

Response 201: {"id", "status", "provider_sid", "to", "from"}. A message.sent event is emitted on success.

Listing traffic

GET /api/v1/messages?direction=outbound&limit=50 — filter by direction (inbound/outbound) and limit.

WhatsApp

Inbound WhatsApp to your number is handled by the owning agent automatically and emitted as message.received. Outbound WhatsApp is available from the dashboard WhatsApp inbox; a v1 WhatsApp send endpoint is on the roadmap.