diff --git a/fern/chat/sms-chat.mdx b/fern/chat/sms-chat.mdx new file mode 100644 index 000000000..4e8d729f0 --- /dev/null +++ b/fern/chat/sms-chat.mdx @@ -0,0 +1,126 @@ +--- +title: SMS chat +subtitle: Enable text-based conversations with assistants via SMS messaging +slug: chat/sms-chat +--- + +## Overview + +Let customers chat with your Vapi assistants through SMS text messages. Perfect for businesses that want to provide AI support through familiar messaging channels. + +**What You'll Enable:** +* Text-based conversations through SMS +* Automatic session management for each customer +* Context-aware responses across message exchanges + + +SMS chat requires a **10DLC-approved Twilio number**. Only customers can initiate conversations - assistants cannot send the first message. + + +## Prerequisites + +* A [Vapi account](https://dashboard.vapi.ai/) with an existing assistant +* A **10DLC-approved Twilio phone number** (required for assistant responses) +* Basic understanding of [phone number management](/phone-numbers) + +--- + +## Setup Steps + + + + Bring your approved Twilio number into Vapi so we can manage SMS messaging. + + + SMS is **enabled by default** when importing Twilio numbers. + + + See: [Import number from Twilio](/phone-numbers/import-twilio) and [Inbound SMS setup](/phone-numbers/inbound-sms) + + + Assign the assistant that will handle SMS conversations for this number. + + When customers text your number, they'll automatically start a chat session with this assistant. + + + Send a text message to your phone number to verify the assistant responds correctly. + + + + +View all SMS conversations in the [Session Logs](https://dashboard.vapi.ai/logs/session) page of your dashboard. Each SMS conversation creates a session where you can see the full message history and conversation flow. + + +--- + +## How It Works + +When a customer texts your number: + +1. **Session Creation**: Vapi automatically creates a chat session for the customer +2. **Context Management**: All messages maintain conversation context within the session +3. **Response Delivery**: Assistant responses are sent back as SMS messages +4. **Session Expiry**: Sessions expire after 24 hours of inactivity, then create fresh sessions for new conversations + +```mermaid +sequenceDiagram + participant Customer + participant Twilio + participant Vapi + participant Assistant + + Customer->>Twilio: "Hi, I need help" + Twilio->>Vapi: SMS webhook + Vapi->>Vapi: Create/find session + Vapi->>Assistant: Process message + Assistant->>Vapi: Generate response + Vapi->>Twilio: Send SMS response + Twilio->>Customer: "Hello! How can I help?" +``` + +--- + +## Session Management + +SMS conversations use automatic session management: + + + + * **New customers**: Get a fresh session on first text + * **Returning customers**: Continue existing session if under 24 hours + * **Session expiry**: After 24 hours, new session created automatically + * **Context preservation**: Full conversation history maintained within session + + + You cannot manually manage SMS sessions - they're handled automatically by Vapi's SMS infrastructure. + + For programmatic chat with manual session control, use the [Chat API](/chat/quickstart) directly. + + + +--- + +## Limitations + + +**Current SMS chat limitations:** +- **10DLC requirement**: Only 10DLC-approved Twilio numbers support assistant responses +- **Customer-initiated**: Assistants cannot send the first message to customers +- **Query tool**: Knowledge-base searches are not supported (same as Chat API) +- **Twilio only**: Other SMS providers are not currently supported + + +--- + +## Next Steps + +Enhance your SMS chat implementation: + +* **[Chat API](/chat/quickstart)** - Understand the underlying chat technology +* **[Session management](/chat/session-management)** - Learn how sessions work in detail +* **[Phone number management](/phone-numbers)** - Configure advanced telephony features +* **[Assistant configuration](/assistants/quickstart)** - Optimize your assistant for text conversations + + +For the best SMS experience, configure your assistant with concise responses and clear conversation flows. SMS users expect quick, direct answers. + diff --git a/fern/docs.yml b/fern/docs.yml index b074d0b42..12fb055b9 100644 --- a/fern/docs.yml +++ b/fern/docs.yml @@ -436,6 +436,9 @@ navigation: - page: Session management path: chat/session-management.mdx icon: fa-light fa-layer-group + - page: SMS chat + path: chat/sms-chat.mdx + icon: fa-light fa-comment-sms - page: Web widget path: chat/web-widget.mdx icon: fa-light fa-window-maximize diff --git a/fern/phone-numbers/inbound-sms.mdx b/fern/phone-numbers/inbound-sms.mdx index 5ee78d1d9..a1a75e05a 100644 --- a/fern/phone-numbers/inbound-sms.mdx +++ b/fern/phone-numbers/inbound-sms.mdx @@ -71,3 +71,11 @@ Update your number to set `smsEnabled: true` if it was previously disabled. For full endpoint details, see the [OpenAPI reference](/api-reference/openapi). +## Next steps + +Now that you have inbound SMS enabled: + +* **[SMS chat](/chat/sms-chat)** - Learn how customers can have full conversations with your assistants via SMS +* **[Session management](/chat/session-management)** - Understand how SMS conversations maintain context automatically +* **[Chat quickstart](/chat/quickstart)** - Explore the underlying chat technology powering SMS interactions +