# 57020: Authorization failed

Log Type: APPLICATION

Log Level: ERROR

## Description

This error appears when Twilio cannot validate the request's `Authorization` header on a Messaging request. Twilio API requests use HTTP Basic authentication, and Twilio recommends API keys and API key secrets for production applications.

### Possible causes

* The request does not include an `Authorization` header.
* The `Authorization` header does not contain valid Twilio API credentials.

### Possible solutions

* Add a valid `Authorization` header to the request and authenticate with HTTP Basic authentication.
* Use an API key and API key secret for production requests.
* For local testing, use your Account SID and Auth Token.

#### Additional resources

* [Twilio API requests](/docs/usage/requests-to-twilio)
* [Basic Authentication](/docs/glossary/what-is-basic-authentication)
