A 401 Unauthorized response indicates that the 101domain API was unable to verify your identity. This is strictly an authentication issue, the server received your request but doesn't know who you are.
Common Causes & Solutions
If you are seeing this error, please run through the following checklist:
-
Check the Header Format
Ensure your request includes theAuthorizationheader and uses theBearerprefix correctly.-
Correct:
Authorization: Bearer YOUR_API_KEY -
Incorrect:
Authorization: YOUR_API_KEY(MissingBearerprefix)
-
-
Verify Key Expiration
Check the expiry of our API Key. If your key has expired, it will return a 401 error. You will need to generate a new key, follow the steps in How to Get API Keys.
101domain API keys have a maximum lifespan of one year. They can be created at intervals of 7 days, 30 day, 90 days and 1 year.
-
Whitespace and Special Characters
Ensure no extra spaces or hidden characters were included when copying/pasting the key into your environment variables or code. -
Malformed Keys
If the key string itself is altered (even by one character), the hash will not match, and access will be denied. If did not copy this key into a secure password manager, you may need to generate a new key.
Examples of a 401 Unauthorized errors
Bad Request Example (Missing or Invalid Token)
GET /v1/account/balance HTTP/1.1
Host: api.101domain.com
Authorization: Bearer invalid_or_expired_key_123
Response (401 Unauthorized):
{
"status": "error",
"code": "UNAUTHORIZED",
"message": "Bearer token is missing, invalid, or expired.",
"errors": null
}
How to Fix a 401 Unauthorized Error
-
Log into your 101domain account and check if the key status you are using is
Active.-
If the key is active but still failing, revoke it and generate a new key. This is often the fastest resolution.
-
-
Run a simple test in your terminal using Test with cURL to rule out code-specific issues:
curl -X GET "https://api.101domain.com/v1/account/balance"
-H "Authorization: Bearer YOUR_API_KEY"
If you continue to encounter errors, please contact our Support Team by Opening a Support Ticket at my.101domain.com.