---
"@context": https://schema.org
"@type": TechArticle
"@id": https://www.twilio.com/docs/api/errors/321401#article
headline: "321401: Invalid credentials"
url: https://www.twilio.com/docs/api/errors/321401
inLanguage: en
dateModified: 2026-06-09T11:00:42.000Z
author:
  "@type": Organization
  name: Twilio Developer Education Team
publisher:
  "@type": Organization
  name: Twilio
---

# 321401: Invalid credentials

Log Type: APPLICATION

Log Level: ERROR

## Description

Twilio could not authenticate the request because the `client_id` and `client_secret` you provided are invalid, do not match, or are not authorized for the requested operation.

### Possible causes

* The `client_id` value is incorrect.
* The `client_secret` value is incorrect.
* The `client_id` and `client_secret` do not belong to the same credential pair.
* The client credentials were copied with extra spaces or formatting changes.
* The request is using OAuth client credentials that are not valid for the Twilio account or resource you are trying to access.

### Possible solutions

* Confirm that you are sending the correct `client_id` and `client_secret` values.
* Regenerate the client secret if you no longer have a trusted copy, then update your application with the new value.
* Make sure the credentials are passed exactly as issued, with no extra whitespace or truncation.
* Verify that your application is using the correct credentials for the correct Twilio account and environment.
* If you are using Twilio APIs that support OAuth, review your authentication setup and token exchange flow in [Twilio IAM](/docs/iam).

#### Additional resources

* [Twilio IAM](/docs/iam)
* [Verify API](/docs/verify/api)
* [API authentication and security](/docs/iam)
