https://retellai.com/?utm_source=discord&utm_medium=seo logo
i created a new workspace and now my API calls `c...
# ❓・ai-evy-support
h
@AI Evy i created a new workspace and now my API calls
create-phone-call
get a 404 message. I have changed the API Key to the one used by the new workspace. API calls to the older workspace work fine
a
Thanks for tagging me @hemiw_. I'll look through relevant sources and get back to you shortly.
### Answer When you create a new workspace, the 404 error on
create-phone-call
is typically caused by missing phone number configuration in the new workspace. [(1) ]() [(2) ]() The
from_number
parameter must be a phone number purchased from Retell or imported to Retell. [(3) ]() Since you created a new workspace, you likely don't have any phone numbers configured there yet. [(1) ]() To resolve this: 1. Verify your phone number exists in the new workspace Check that you have a phone number configured in your new workspace. You can purchase or import one if needed. [(1) ]() [(2) ]() 2. Ensure the phone number has proper agent binding The phone number should have an
outbound_agent_id
configured, or use the
override_agent_id
parameter in your request. 3. Verify your API call structure Your create phone call request should look like this: [(3) ]()
Copy code
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) ;
4. Use correct parameter names Use
override_agent_id
instead of
agent_id
, and
retell_llm_dynamic_variables
instead of
custom_data
. [(1) ]() [(2) ]() The key issue is that your new workspace needs its own phone number configuration - the phone numbers from your old workspace don't automatically transfer. [(1) ]() [(1) ]()
​ To learn more, see the sources I considered: [[1] 404 Error on Create a Phone Call](https://retell.discourse.group/t/404-error-on-create-a-phone-call/22) [[2] Here is how that can be fixed](https://retell.discourse.group/t/here-is-how-that-can-be-fixed/23) [[3] Create Phone Call](https://docs.retellai.com/api-references/create-phone-call) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
h
Phone number setup is fine bc I was able to initiate a call from the retell dashboard
@AI Evy Phone number setup is fine bc I was able to initiate a call from the retell dashboard
a
Thanks for the follow-up, @hemiw_. I'll get back to you soon.
### Answer Since the phone number works from the dashboard, let's check a few other potential causes for the 404 error: Verify your API endpoint URL Ensure you're using the correct endpoint format. The endpoint should be: [(1) ]()
Copy code
POST <https://api.retellai.com/v2/create-phone-call>
Check your Authorization header format Your Authorization header must follow this exact format: [(2) ]()
Copy code
Authorization: Bearer YOUR_API_KEY
Verify your request body parameters The required parameters are
from_number
and
to_number
in E.164 format. [(1) ]() Here's the correct request structure:
Copy code
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) ;
Common issues that cause 404 even with configured phone numbers: - Using
agent_id
instead of
override_agent_id
in your request body [(3) ]() [(4) ]() - Missing or incorrect Content-Type header (should be
application/json
) [(5) ]() - Trailing slash in the URL [(3) ]() Double-check that your API key is correctly copied from the new workspace without any extra spaces or characters. [(2) ]()
​ To learn more, see the sources I considered: [[1] Create Phone Call](https://docs.retellai.com/api-references/create-phone-call) [[2] API Key Overview](https://docs.retellai.com/accounts/api-keys-overview) [[3] 404 Error on Create a Phone Call](https://retell.discourse.group/t/404-error-on-create-a-phone-call/22) [[4] Here is how that can be fixed](https://retell.discourse.group/t/here-is-how-that-can-be-fixed/23) [[5] Getting a 404 error when trying to use create-phone-call through HTTP in make.com](https://discord.com/channels/1186424376300679209/1370700007765704785) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.