SMS Flow
No Pipecat pipeline is involved — this is a text path throughservices/.
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.
A number routed to call-init (routing_target_type: "webhook") asks your server
which agent answers, once per conversation, and keeps its variables and
knowledge_context for every reply. See Pre-Call Init.
Chat API
Use the Chat API for programmatic text conversations:Template variables
variables fill {{placeholders}} in the agent’s system prompt and tool
descriptions, as call-init’s do on a call. They are kept on the session and
merged: send them on any message, a name sent again replaces its value, and a
message without them leaves them as they are. The agent’s own metadata fills
any name the session does not set.
422)
and for the session they add up to (400).
Endpoints
The two lists take
limit (sessions: 50 by default, messages: 100) up to 500; a larger one is cut to 500, and the response’s limit is the one applied.
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)
- Holds the agent’s skills: resolved on the session’s first message, and a skill loaded in one message stays loaded for the next. See Skills in a text conversation
- Rate-limited by the project’s
messages_per_minute, if set: past it the Chat API answers429 rate_limited, and an SMS or WhatsApp message is not answered or sent to the LLM. See Limits
Webhook Events
session.createdsession.updatedsession.deletedchat.created
customer_number and turncall_number included. See Redaction in Server Events.