https://retellai.com/?utm_source=discord&utm_medium=seo logo
when creating an SMS chat conversation via API, d...
# ❓・ai-evy-support
s
@AI Evy when creating an SMS chat conversation via API, do you set a to_number and from_number simiplar to create phone call function or how do I initiate an SMS conversation via api?
a
Thanks for tagging me @scott_90906. I'll look through relevant sources and get back to you shortly.
### Answer For SMS chat conversations via API, you don't use
to_number
and
from_number
parameters like phone calls [(1) ]() . Instead, you use the Create Chat API endpoint which requires different parameters . To initiate an SMS conversation via API, you use the
create-chat
endpoint with these key parameters : -
agent_id
(required) : The chat agent to use for the conversation -
agent_version
(optional) : The version of the chat agent to use -
metadata
(optional) : An arbitrary object for storage purposes -
retell_llm_dynamic_variables
(optional) : Dynamic variables in key-value pairs that inject into your Response Engine prompt The API returns a
chat_id
that you use for subsequent requests in the conversation [(1) ]() [(2) ]() . For SMS functionality specifically, you need to enable SMS on your phone number through Retell's SMS addon [(3) ]() . Once enabled, you can trigger outbound SMS using SMS-capable Twilio numbers provisioned through Retell . The chat creation process is separate from phone number configuration - you create the chat session first, then the SMS delivery happens through your configured SMS-enabled phone number [(2) ]() [(3) ]() .
​ To learn more, see the sources I considered: [[1] Create Chat](https://docs.retellai.com/api-references/create-chat) [[2] Create Chat Completion](https://docs.retellai.com/deploy/create-chat-completion) [[3] Creating an SMS chatbot from an form submission](https://discord.com/channels/1186424376300679209/1399735172525588521) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
s
I get that, but when initiating it via API, how does the agent know who to send the message to to initiate the chat? I have SMS enabled on the phone numbers I want to use.
@AI Evy I get that, but when initiating it via API, how does the agent know who to send the message to to initiate the chat? I have SMS enabled on the phone numbers I want to use.
a
Thanks for the follow-up, @scott_90906. I'll get back to you soon.
### Answer Based on the available sources, the Create Chat API only creates a chat session but doesn't specify the recipient's phone number [(1) ]() . The API call looks like this:
Copy code
javascript
import Retell from 'retell-sdk';
const client = new Retell({
 apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const chatResponse = await client.chat.create({ agent_id: 'oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD' }) ;
console.log(chatResponse.agent_id) ;
Based on community discussions, SMS functionality appears to be in beta testing and doesn't offer full API integration yet [(2) ]() . One community member mentioned needing to connect external APIs to allow Retell to handle SMS properly . The sources don't provide specific information about how to specify the recipient's phone number when initiating SMS conversations via API. This appears to be a limitation or gap in the current SMS implementation. I don't have sufficient information in the available sources to explain exactly how the agent determines who to send the SMS message to when initiating via API. You might want to check: - [Create Chat]() - [Create Phone Number]() Would you like me to try to provide a general answer based on my knowledge instead?
​ To learn more, see the sources I considered: [[1] Create Chat](https://docs.retellai.com/api-references/create-chat) [[2] Discord message from @elders7130 on 2025-07-29](https://discord.com/channels/1186424376300679209/1186462578310910112/1399769388499865740) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.