One agent definition. It answers in the chat panel on a page, it answers on a phone call, and a conversation can move between the two without starting over. The channel is the SignalWire chat product. Not SMS, not WhatsApp, and not a general-purpose assistant.
curl -s -X POST https://ai-chat-demo.signalwire.me/chat/ \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer demo-key' \
-H 'Origin: https://ai-chat-demo.signalwire.me' \
-d '{"method":"chat","message":"4417"}'
The Origin header matters: the gateway refuses
origins it was not told about, and a missing one is refused too.
| Order | Status | Due | Address |
|---|---|---|---|
| 4417 | out for delivery | today before 6pm | 12 Bridge Street, Bristol |
| 5120 | packed | Thursday | 88 Wren Avenue, Leeds |
| 6001 | delayed | Monday | 4 Kiln Road, Sheffield |
Ask about anything else and it declines, on purpose.
| Route | What it does | |
|---|---|---|
| GET / | This page. | |
| GET /health | Liveness. | |
| GET /demo/ | The chat page. Start here. | |
| GET /state/{id} | What the agent knows, and every leg of the thread. | |
| GET /swml | The agent, for a voice call. | basic auth |
| POST /chat/ | Text conversation. JSON-RPC. | bearer key |
| POST /chat | Redirects to /chat/ so a mis-derived URL still works. | 307 |
| POST /chat/handoff | Voice call to text. | nonce |
| POST /chat/escalate | Text to voice call. | handle |
| POST /chat/say | Type into a live call. | nonce |
handoff_nonce in its user variables, which needs a
number pointed at this agent. That is the part worth seeing and it has not run
yet.