Skip to contentSkip to navigationSkip to topbar
Page toolsOn this pageProducts used
Looking for more inspiration?Visit the

57019: 'Authorization' header is missing or is invalid


ERROR: 57019

error-57019 page anchor
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}.

Possible causes

possible-causes page anchor
  • The request was sent without an Authorization header.
  • The Authorization header 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 a Bearer access 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 Authorization header 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.

Additional resources

additional-resources page anchor