Issue
This article addresses the common issue where users encounter error code 20003: Authentication Error – No credentials provided when configuring a Twilio Studio Flow with a Twilio phone number. This typically occurs when the REST API URL is used instead of the required Webhook URL in the phone number’s configuration.
Symptoms
- Incoming calls or messages to a Twilio number do not trigger the expected Studio Flow.
- Studio Flow execution logs or Twilio error logs show:
code: 20003message: Authentication Error – No credentials provided- HTTP status: 401
Cause
This error occurs when the REST API URL for the Studio Flow is used in the phone number’s configuration instead of the Webhook URL.
- REST API URL: Used for programmatic triggering of Flows via API calls (requires authentication).
- Webhook URL: Used to connect a Flow to a Twilio phone number or messaging service (does not require authentication).
Resolution
-
Identify the Correct Webhook URL for Your Studio Flow
The Webhook URL format is:
https://webhooks.twilio.com/v1/Accounts/{AccountSid}/Flows/{FlowSid}- Replace
{AccountSid}with your Twilio Account SID. - Replace
{FlowSid}with your Studio Flow SID.
-
Update Your Twilio Number’s Configuration
- Go to the Active Numbers section in the Twilio Console.
- Select the phone number you want to configure.
- Under the Voice & Fax or Messaging section, set the “A Call Comes In” or “A Message Comes In” webhook to the correct Webhook URL for your Studio Flow.
-
Save Changes and Test
- Save the configuration.
- Test by calling or messaging the number to confirm the Studio Flow is triggered as expected.
Example
Incorrect (REST API URL):
https://studio.twilio.com/v2/Flows/FWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Executions
Correct (Webhook URL):
https://webhooks.twilio.com/v1/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Flows/FWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Additional Information
- The REST API URL requires authentication and is not suitable for direct assignment to a phone number’s webhook.
- Always use the Webhook URL when connecting a Studio Flow to a Twilio number or messaging service.
Below you will find references to useful documents:
- Twilio Studio: Triggering Flows with Incoming Calls or Messages
- Twilio Error 20003 Documentation
- How to Find and Identify Flow Executions
This article is intended for Twilio users configuring Studio Flows with phone numbers or messaging services and encountering authentication errors.