.manthu
08/02/2025, 12:18 AMAI Evy
08/02/2025, 12:18 AMAI Evy
08/02/2025, 12:18 AMPOST /v2/create-phone-call [(2) ]() .
Here's the proper implementation:
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) ;
Before making outbound calls, ensure:
1. Phone number is properly bound to an agent - You need to assign an outbound_agent_id to your phone number [(3) ]() . If outbound_agent_id is null, the number cannot initiate outbound calls without an agent id override [(4) ]() .
2. **Required parameters are included**:
- `from_number`: Your Retell number in E.164 format [(2) ]()
- `to_number`: The destination number in E.164 format
3. **Authorization header is correct**: Use Bearer YOUR_RETELL_API_KEY format
If you're still getting 404 errors, verify your phone number is properly configured by listing your phone numbers first:
javascript
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const phoneNumberResponses = await client.phoneNumber.list() ;
console.log(phoneNumberResponses) ;
[(1) ]()AI Evy
08/02/2025, 12:18 AMAI Evy
08/02/2025, 12:18 AM