Invalid API Key
Use this page when an API request fails because the key is missing, invalid, inactive, or not recognized.
Symptoms
You may see:
401 UnauthorizedInvalid API keyMissing X-API-Key header- SDK
AuthenticationError - Dashboard API Testing fails before returning a result
Likely Causes
Common causes include:
- The
X-API-Keyheader is missing. - The key was copied incorrectly.
- Extra spaces or line breaks were included.
- The key belongs to another account or environment.
- The key has expired.
- The application is using an old environment variable value.
How to Check
- Open API Key Management.
- Reveal the key and copy it again.
- Confirm your request sends the key in the
X-API-Keyheader. - Confirm your app reads the correct environment variable.
- Restart your local app or server after changing environment variables.
Example header:
X-API-Key: custodian_labs_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
How to Fix
- Copy the key again from the dashboard.
- Remove leading or trailing spaces.
- Use the correct header name:
X-API-Key. - Update your
.envor secret manager. - Restart the application after updating secrets.
- If the key is expired, activate or renew a plan and use the current key.