The 404 error you’re encountering is most commonly caused by an improperly configured phone number in your Retell AI account(1). The endpoint path itself appears correct (/v2/create-phone-call is the current endpoint), so the issue is likely with your phone number setup or payload structure(1).
Key Points to Verify
Phone Number Configuration: Your from_number (+1 (201) 379-9352) must be properly configured in Retell AI with an outbound_agent_id, or you need to use the override_agent_id parameter in your request(1).
Correct Payload Structure: Ensure you’re using the correct parameter names(1):
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);
(1)
Use override_agent_id instead of agent_id, and retell_llm_dynamic_variables instead of custom_data(1):
{
"from_number": "+16504144521",
"to_number": "your_target_number",
"override_agent_id": "agent_71724df7636716ceb3a7e244c8",
"retell_llm_dynamic_variables": {
"name": "Sarah"
}
}
(1)
Phone Number Setup
If your Telnyx number isn’t properly imported into Retell AI, you’ll need to configure it(1). To update an existing phone number for outbound calls(1):
const phoneNumberResponse = await client.phoneNumber.update('+14157774444', {
inbound_agent_id: 'oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD',
nickname: 'Frontdesk Number',
(1)
Verify that your phone number has been purchased/imported and configured through Retell AI—you cannot use arbitrary numbers for the from_number parameter(1).
For further assistance with workspace-level permissions or Telnyx integration specifics, visit Contact Sales, ask questions on Discord, or visit https://github.com/RetellAI/.