cosmickai_
10/14/2025, 4:00 PMAI Evy
10/14/2025, 4:00 PMAI Evy
10/14/2025, 4:00 PMjavascript
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) ;
Your request body format looks correct, but make sure you're using the right endpoint URL .
One additional consideration from the community: if your from_number is assigned to an agent in the dashboard, it will override your agent_id parameter in the API call [(2) ]() . Make sure the from_number isn't bound to a different agent than the one you're trying to use.AI Evy
10/14/2025, 4:00 PMAI Evy
10/14/2025, 4:00 PMcosmickai_
10/14/2025, 4:03 PMcosmickai_
10/14/2025, 4:04 PMAI Evy
10/14/2025, 4:04 PMAI Evy
10/14/2025, 4:04 PMjson
{
"from_number": "+14157774444",
"to_number": "+12137774445",
"agent_id": "oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD"
}
Make sure you're using:
- Method: POST
- Authorization header: "Bearer YOUR_API_KEY"
- Content-Type: application/json
The endpoint you were originally using (` is missing the /call/ path segment, which would cause the "resource not found" error you encountered .AI Evy
10/14/2025, 4:04 PMAI Evy
10/14/2025, 4:04 PMcosmickai_
10/14/2025, 4:08 PMAI Evy
10/14/2025, 4:08 PMAI Evy
10/14/2025, 4:09 PMAI Evy
10/14/2025, 4:09 PM