thesnowguru
12/04/2025, 11:22 AMAI Evy
12/04/2025, 11:22 AMAI Evy
12/04/2025, 11:22 AMAI Evy
12/04/2025, 11:22 AMAI Evy
12/04/2025, 11:22 AMthesnowguru
12/10/2025, 3:15 PMAI Evy
12/10/2025, 3:16 PMAI Evy
12/10/2025, 3:16 PMjavascript
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const phoneNumberResponse = await client.phoneNumber.create() ;
console.log(phoneNumberResponse.inbound_agent_id) ;
Key parameters you can specify:
- `area_code`: 3-digit US area code (e.g., 415)
- `inbound_agent_id`: Agent ID to handle inbound calls
- `outbound_agent_id`: Agent ID for outbound calls
- `number_provider`: Choose "twilio" or "telnyx" (defaults to Twilio)
- `country_code`: "US" or "CA" (defaults to US)
- `toll_free`: Set to true for toll-free numbers
- `nickname`: For your reference
Pricing: [(2) ]()
- US/Canadian numbers (Twilio or Telnyx) : $2/month
- US toll-free numbers (Twilio) : $5/month
Phone numbers are yours once purchased and can be used indefinitely.AI Evy
12/10/2025, 3:16 PMAI Evy
12/10/2025, 3:16 PMthesnowguru
12/10/2025, 3:17 PMAI Evy
12/10/2025, 3:17 PMAI Evy
12/10/2025, 3:18 PMjavascript
const phoneNumberResponse = await retell.phoneNumber.create({
inbound_agent_id: "oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD", // replace with the agent id you want to assign
outbound_agent_id: "oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD", // replace with the agent id you want to assign
}) ;
console.log(phoneNumberResponse) ;
The response will include the purchased phone number details and the assigned agent IDs.
### 2. Creating an Outbound Call
Once you have a number, use the Create Phone Call API: [(2) ]()
javascript
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const phoneCallResponse = await client.call.createPhoneCall({
from_number: '+14157774444',
to_number: '+12137774445',
}) ;
console.log(phoneCallResponse.agent_id) ;AI Evy
12/10/2025, 3:18 PM{"customer_name": "John Doe"}
- `metadata`: Store custom data for tracking
### 3. Adding to a Workspace
I don't have specific documentation on how to programmatically add a phone number to a specific workspace via API. The sources only cover purchasing numbers and making calls.
For workspace-specific configuration, I'd suggest:
- Check the [Create Phone Number API Reference]() for any workspace parameters [(1) ]()
- Visit [Contact Sales]() for additional support
Would you like me to try providing a general answer about workspace management?AI Evy
12/10/2025, 3:18 PMAI Evy
12/10/2025, 3:18 PMthesnowguru
12/10/2025, 3:19 PMAI Evy
12/10/2025, 3:19 PMAI Evy
12/10/2025, 3:19 PMjavascript
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const phoneNumberResponse = await client.phoneNumber.create() ;
console.log(phoneNumberResponse.inbound_agent_id) ;
However, I don't have the full payload options or response schema in my current sources.
Check out these potentially useful sources:
- [Create Phone Number API Reference]()
- [Purchase phone number]()
For additional support:
- Visit [Contact Sales]()
- Visit [)
Would you like me to try providing a general answer based on my knowledge instead?AI Evy
12/10/2025, 3:20 PMAI Evy
12/10/2025, 3:20 PM