57019: 'Authorization' header is missing or is invalid
MESSAGING
ERROR
Twilio returns this error when a Messaging request does not include a usable Authorization header. Authenticate Twilio API requests with HTTP Basic authentication using an API key and API key secret, or for local testing, your Account SID and Auth Token. If the endpoint uses OAuth, send Authorization: Bearer {AccessToken}.
- The request was sent without an
Authorizationheader. - The
Authorizationheader value is malformed or uses the wrong authentication scheme for the endpoint. Twilio API requests use HTTP Basic authentication for API key or Account SID credentials, while OAuth requests use aBeareraccess token. - The credentials in the header are incomplete, such as an API key without its secret or an Account SID without its Auth Token.
- Add a valid
Authorizationheader to the request before retrying. - For production requests, authenticate with an API key as the username and the API key secret as the password. Twilio recommends API keys for production authentication.
- For local testing, authenticate with your Account SID as the username and your Auth Token as the password.
- If you are calling an OAuth-protected endpoint, generate a valid access token and send it as
Authorization: Bearer {AccessToken}. - If you build raw HTTP requests manually, use a Twilio server-side SDK when possible so the SDK can handle credentials consistently.