Capabilities
Receive a message
Inbound SMS and WhatsApp to any of your numbers are handled twice over:
- The agent replies. The number's owning agent answers using the same playbook and knowledge that drive its calls — a text-message receptionist for free.
- You get the event. Every inbound message is persisted and emitted as a
message.receivedevent.
Consuming inbound programmatically
Push — subscribe a webhook:
curl -X POST https://klaw-voice.netlify.app/api/v1/webhooks \
-H "Authorization: Bearer $KLAW_KEY" -H "Content-Type: application/json" \
-d '{"url": "https://example.com/hooks/klaw", "events": ["message.received"]}'
Block until it arrives — long-poll, ideal for agents waiting on a reply or a verification code:
curl -X POST https://klaw-voice.netlify.app/api/v1/events/wait \
-H "Authorization: Bearer $KLAW_KEY" -H "Content-Type: application/json" \
-d '{"types": ["message.received"], "timeout_ms": 55000}'
Returns {"event": {...}} as soon as a message lands, or {"event": null, "timed_out": true} after the timeout — loop as needed.
Stream — server-sent events; see Events.
The MCP tool wait_for_event wraps the long-poll for MCP clients.