SMS Flow
Enable SMS on a Phone Number
Setsms_enabled: true when binding a phone number. TurnCall auto-configures the Twilio SMS webhook.
The same number handles both voice calls and SMS.
Chat API
Use the Chat API for programmatic text conversations:Endpoints
| Method | Path | Description |
|---|---|---|
| POST | /v1/chat | Send message, get LLM reply |
| GET | /v1/chat/sessions | List sessions |
| GET | /v1/chat/sessions/:id | Get session detail |
| GET | /v1/chat/sessions/:id/messages | List messages |
| DELETE | /v1/chat/sessions/:id | Expire session |
Context Threading
Usesession_id (group messages) or previous_chat_id (linear chain) to maintain conversation context. Cannot use both.
Session Management
- Auto-created on first inbound SMS or Chat API call
- Resumed if same (customer_number, turncall_number) pair and <24h since last activity
- Expired after 24h inactivity (lazy on lookup + background cleanup every 15 min)
Webhook Events
session.createdsession.updatedsession.deletedchat.created