#{ "success": false, "message": "HTTP 401 error: Unable to create record: Authenticate", "conv
1 messages · Page 1 of 1 (latest)
Short answer: the 401 means authentication failed before a CallSid was created.
Most common causes (and how to fix them), per ElevenLabs docs:
- Missing/invalid xi-api-key header. Add a valid API key in the xi-api-key header for every API call. (elevenlabs.io)
- Hitting quota with your API key (returns a 400/401). Check for invalid_api_key or quota_exceeded and top up/enable usage-based billing if needed. (elevenlabs.io)
- Twilio credentials not configured/valid on the imported phone number (native integration). Ensure your Twilio number is imported in the Phone Numbers tab and the Twilio Account SID and Auth Token are correct. (elevenlabs.io)
- Calling the Twilio outbound endpoint without required fields or with the wrong phone number record; ensure agent_id, agent_phone_number_id, and to_number are set. (elevenlabs.io)
- Regional blocks (rare, but will also prevent authenticated access). Verify you’re not connecting from a restricted country/IP. (help.elevenlabs.io)
What to check right now
- Re-run the request with a known-good xi-api-key and confirm the header is present. (elevenlabs.io)
- In Conversational AI > Phone Numbers, re-enter the Twilio SID/Auth Token for the number you’re using. (elevenlabs.io)
- Review the Calls History page to see the exact failure reason for this attempt. (help.elevenlabs.io)
- If still failing, confirm your key hasn’t exceeded quota and try again. (elevenlabs.io)
If you share which endpoint you called and the phone_number_id/agent_id (no secrets), I can point to the exact step to fix next.
Sources:
Authentication | ElevenLabs Documentation
Error messages | ElevenLabs Documentation
Twilio native integration | ElevenLabs Documentation
Outbound call via twilio | ElevenLabs Documentation
Do you restrict access to the service and platform for any specific countries? – ElevenLabs
Authentication | ElevenLabs Documentation
Twilio native integration | ElevenLabs Documentation
Where can I locate the reason for my call failing? – ElevenLabs
Error messages | ElevenLabs Documentation
this responce to get from the official doc test api
https://elevenlabs.io/docs/conversational-ai/api-reference/twilio/outbound-call?explorer=true
this issue will be occured and to fix it!
Likely causes of “HTTP 401: Unable to create record: Authenticate” when calling POST /v1/convai/twilio/outbound-call and how to fix them:
-
Missing or invalid ElevenLabs API key header
- The endpoint requires xi-api-key in the request. Add a valid API key header and retry. (elevenlabs.io)
-
Twilio credentials not set or no longer valid on the imported phone number
- Outbound calling uses your imported Twilio number. When importing, you must provide your Twilio Account SID and Auth Token in the Phone Numbers tab. If these are wrong or rotated in Twilio, update them in ElevenLabs and try again. (elevenlabs.io)
-
Using a number that doesn’t support outbound
- ElevenLabs distinguishes purchased Twilio numbers (inbound+outbound) and Verified Caller IDs (outbound only). Ensure the imported number is detected with outbound capability. (elevenlabs.io)
-
Incorrect identifiers in the request
- Verify agent_id and agent_phone_number_id are valid IDs from your workspace and correspond to the imported Twilio number you intend to call from. (elevenlabs.io)
How to verify and debug
- Send the request with the required header and fields:
- xi-api-key: YOUR_API_KEY
- JSON: { "agent_id": "...", "agent_phone_number_id": "...", "to_number": "..." } (elevenlabs.io)
-
In the dashboard, re-open the imported Twilio number and re-enter the Twilio SID/Auth Token from the Twilio console; save and retry the call. (elevenlabs.io)
-
Check the Calls History page for the specific failure message for the attempt; it will display why the call failed. (help.elevenlabs.io)
References:
- Outbound call via Twilio API (required header/fields) (elevenlabs.io)
- API authentication (xi-api-key) (elevenlabs.io)
- Twilio native integration (import number, SID/Auth Token, capabilities)
okay how to setup and configure this purpose fron the api key
Here’s the minimal, verified setup to make the Twilio outbound-call endpoint work and avoid HTTP 401.
- Get and use your ElevenLabs API key
- Create an API key in the dashboard and pass it in the xi-api-key header on every request. Example:
curl -X POST https://api.elevenlabs.io/v1/convai/twilio/outbound-call
-H "Content-Type: application/json"
-H "xi-api-key: YOUR_API_KEY"
-d '{"agent_id":"AGENT_ID","agent_phone_number_id":"PHONE_NUMBER_ID","to_number":"+15551234567"}'
This header is required by the API; 401 occurs if it’s missing/invalid. (elevenlabs.io)
- Import and verify your Twilio number in ElevenLabs (needed for agent_phone_number_id)
- In the Conversational AI dashboard, import your Twilio number using your Twilio Account SID and Auth Token. ElevenLabs will auto-configure the number and detect whether it supports outbound (verified caller ID) or inbound+outbound (purchased number). (elevenlabs.io)
- You can also import via API and then fetch the phone_number_id to use as agent_phone_number_id in the outbound call:
- POST /v1/convai/phone-numbers/create (Twilio: phone_number, sid, token, label)
- GET /v1/convai/phone-numbers to list your numbers and obtain their IDs
- GET /v1/convai/phone-numbers/{phone_number_id} to check supports_outbound
All require xi-api-key. (elevenlabs.io)
- Configure your agent for Twilio audio
- In the agent settings: set both TTS output and input format to ÎĽ-law 8000 Hz (required for Twilio). (elevenlabs.io)
- Call the outbound endpoint
- Use POST /v1/convai/twilio/outbound-call with:
- agent_id: your agent’s ID
- agent_phone_number_id: the imported Twilio phone number’s ID
- to_number: E.164 format (e.g., +15551234567)
Include xi-api-key. The response returns success, conversation_id, and callSid. (elevenlabs.io)
Why you saw “HTTP 401 … Authenticate” and how to fix
- Missing/invalid xi-api-key in the request → add the correct API key header. (elevenlabs.io)
- Twilio credentials not configured or incorrect for the imported number → re-import or update the number with the correct Twilio SID/Auth Token in ElevenLabs so the platform can create the call on your behalf. (elevenlabs.io)
- Using an unverified or unsupported number for outbound → ensure the phone number shows supports_outbound=true before calling. (elevenlabs.io)
Optional: use the native Twilio integration flow
- ElevenLabs provides a native Twilio integration (import number, assign agent, enable outbound). This is the recommended path for outbound calling. (elevenlabs.io)
Reference: You can also trigger outbound calls with the official SDKs using your API key (client.conversational_ai.twilio.outbound_call). (elevenlabs.io)
If you need, I can help you verify your phone_number_id (agent_phone_number_id) and supports_outbound via the list/get phone numbers endpoints. (elevenlabs.io
Each API key can be scoped to one of the following:
Scope restriction: Set access restrictions by limiting which API endpoints the key can access.
explain the details
Here’s what “Scope restriction” on ElevenLabs API keys means and how it works, per the official docs:
What it is
- Per‑key access control that limits which API areas a key can call. This lets you issue keys that only work for specific products/endpoints and block everything else. (elevenlabs.io)
What you can restrict
- Product/feature access (e.g., enable Text to Speech, Dubbing, Audio Native, etc.). Workspace keys also support access levels like “Read” or “Read & Write” for certain resources (User, Workspace, History). (elevenlabs.io)
- You can additionally set a monthly credit quota per key (separate from scope, but configured alongside it). (elevenlabs.io)
Where to configure it
- Dashboard: By default new keys are restricted—explicitly select the features you want to allow, or disable the “Restrict key” toggle if you want a fully open key. You can also set optional credit limits here. (help.elevenlabs.io)
- API (service accounts): Create or update keys with an explicit permissions list or use "all" for no restriction; you can also set character_limit on the key:
- Create: POST /v1/service-accounts/:service_account_user_id/api-keys (body includes name, permissions[], optional character_limit). Example permission: "text_to_speech". (elevenlabs.io)
- Update: PATCH /v1/service-accounts/:service_account_user_id/api-keys/:api_key_id (modify permissions, enable/disable, character_limit). (elevenlabs.io)
- Note: Service account keys are managed by workspace admins and are intended for backend, scoped access. (elevenlabs.io)
Behavior to expect
- Calls must include the key in the xi-api-key header. If the key is missing/invalid you’ll get a 401. If a key is restricted from a product/endpoint you try to use, the request will be rejected according to its configured access. (elevenlabs.io)
Recent changes (for context)
- Workspace API keys now have the same permission controls as user keys, and you can set “Access/No Access” per product plus credit limits, all from the new key management pages. (elevenlabs.io)
If you want, share which products/endpoints you need and whether you’re using user keys or
i want to be make the elevenlabs conv ai outbound call ? throutgh this api config?
Yes—you can place an ElevenLabs Conversational AI outbound call via the Twilio outbound-call API. Below is the minimal, documented setup and the exact request to make.
Prerequisites
- An API key and the xi-api-key header on every request. Keys can be restricted by scope (which endpoints they can call) and optionally limited by credit quota. Enable the “Conversational AI” features for the key you’ll use. Keys are restricted by default in the UI. (elevenlabs.io, help.elevenlabs.io)
- A Conversational AI Agent (you need its agent_id). You can list agents via GET /v1/convai/agents. (elevenlabs.io)
- A Twilio phone number imported into ElevenLabs (gives you agent_phone_number_id/phone_number_id). Purchased Twilio numbers support inbound+outbound; Verified Caller IDs support outbound only. You can import in the dashboard or via API (POST /v1/convai/phone-numbers/create with your Twilio SID/Auth Token), then retrieve the phone_number_id via GET /v1/convai/phone-numbers. (elevenlabs.io)
Make the outbound call
- Endpoint: POST https://api.elevenlabs.io/v1/convai/twilio/outbound-call
- Headers: xi-api-key: YOUR_API_KEY; Content-Type: application/json
- Body: { "agent_id": "...", "agent_phone_number_id": "...", "to_number": "..." }
The response returns success plus a Twilio callSid (and in some references also a conversation_id). (elevenlabs.io)
Example (cURL)
curl -X POST https://api.elevenlabs.io/v1/convai/twilio/outbound-call
-H "xi-api-key: YOUR_API_KEY"
-H "Content-Type: application/json"
-d '{
"agent_id": "YOUR_AGENT_ID",
"agent_phone_number_id": "YOUR_IMPORTED_TWILIO_PHONE_NUMBER_ID",
"to_number": "DESTINATION_NUMBER"
}'
(elevenlabs.io)
Why you saw HTTP 401 “Authenticate”
- The API requires xi-api-key on every request; a missing/invalid key or a key without the needed product permissions will fail authentication. Confirm your header and that the key has access to Conversational AI endpoints. Also confirm the key is enabled in your workspace. (elevenlabs.io, help.elevenlabs.io)
Quick checklist
- Get agent_id (GET /v1/convai/agents). (elevenlabs.io)
- Import your Twilio number (dashboard or POST /v1/convai/phone-numbers/create), then note phone_number_id; ensure supports_outbound=true when you list phone numbers. (elevenlabs.io)
- Call POST /v1/convai/twilio/outbound-call with xi-api-key and the three required fields. (elevenlabs.io)
Notes
- ElevenLabs added the “Initiate outbound call” endpoint in March 2025; use the /v1/convai/twilio/outbound-call path shown above. (elevenlabs.io)
If anything in your environment differs from the above (e
An API key and the xi-api-key header on every request. Keys can be restricted by scope (which endpoints they can call) and optionally limited by credit quota. Enable the “Conversational AI” features for the key you’ll use. Keys are restricted by default in the UI. (elevenlabs.io, help.elevenlabs.io)
how i will be configure this api for to make outbound call.