https://retellai.com/?utm_source=discord&utm_medium=seo logo
y
@AI Evy Hi! I need to enable Retell API v2 in my workspace. I only have legacy API keys (key_xxxxx), and I need server keys for outbound calls and the endpoint /v2/phone-call/create.
a
Thanks for tagging me @yeye_30087. I'll look through relevant sources and get back to you shortly.
[(1) ]() If you're experiencing issues with the API key or getting 404 errors, verify that: - Your phone number is properly configured in your Retell AI account [(4) ]() [(5) ]() - You're using the correct API key [(3) ]() - Your
from_number
is a phone number you've purchased and configured through Retell AI [(4) ]() [(5) ]() I don't have specific information in the sources about migrating from legacy API keys to server keys. For assistance with API key migration or workspace configuration, I recommend reaching out to Retell support: - Visit [Contact Sales]() - Visit [)
### Answer The v2 API endpoint for creating phone calls is
/v2/create-phone-call
[(1) ]() . To use this endpoint, you need your API key for authorization [(2) ]() . The correct endpoint structure is:
Copy code
POST /v2/create-phone-call
[(1) ]() When making requests, ensure you include your API key in the Authorization header as a Bearer token [(3) ]() :
Copy code
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
Here's the basic request format for creating an outbound call:
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) ;
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.