API returns 401 Unauthorized, 403 or IP blocked
On this page
Every refused API request says why in error (REST API) or in metadata.reason (/json-api). Find the message below.
Symptoms and causes
| Answer | Cause |
|---|---|
401 Unauthorized | No Authorization header, a mistyped or revoked token, or the wrong kind of token (a customer token on the admin API, or the other way round). |
401 This API token has expired. | The token's Expires date has passed. |
401 This API token may not be used from this address. | The request comes from an address not in the token's Allowed IP addresses, or not in Admin panel access by IP (administrator and reseller tokens). |
401 API access is not available for this account. | The reseller lost the API tokens (billing systems) privilege, the customer's plan leaves out API tokens, or the account is suspended. |
403 IP blocked | Too many failed requests or logins from your address. |
403 This API token can only read. | A read-only token sent a POST. |
403 This reseller does not have the privilege for this action. | See reseller privileges. |
403 This tool is not included in your plan. | Customer API: the plan's feature list leaves the tool out. |
422 with a message | The request reached the server but was refused, for example Account not found. or Package not found. |
On /json-api, the same refusals answer 403 with metadata.reason starting with Access denied.
Fix
Unauthorized
- Check the header is exactly
Authorization: Bearer <token>, with no quotes or line breaks. - Check the token still appears under Your tokens in API Tokens. If not, create a new one.
- Use an administrator or reseller token on
/api/v1/accounts…, and a control panel token on/api/v1/me….
IP blocked
Every 401 answer (wrong, expired or wrong-kind token, or a token used from a wrong address) counts as a failed login. After Max failures (default 5) within Window (min) (default 15), the address is blocked for Block for (min) (default 15), at the panel and at the firewall.
- In the admin panel, open Brute Force Protection (section Security).
- Find the address under Blocked IPs and click Unblock.
- Add your billing server to Whitelisted IPs (comma separated) and click Save, so a mistake never blocks it again.
- Fix the token in your system before it retries.
Token not allowed from this address
Check the address your system really uses (for example its outgoing NAT address). Create a new token with the right Allowed IP addresses, or add the address to Admin panel access by IP.
Still not working?
- Run the request with
curl -vand read the HTTP status and body. - Check that the server's hostname certificate is valid if your client verifies TLS.
- There is no fixed request-per-minute limit on the API, but every account creation, suspension or change starts a server task: see them in Task Queue.
Thank you — this helps us improve the article.
Still stuck?
Ask the AI about your exact situation — it answers from this knowledge base — or contact us.
Related articles
- How to create an API token for scripts and billing
Create an API token in the admin panel or the control panel for the REST API or a billing system, copy it once, see when it was last used, and revoke it.
- How to restrict an API token (IP addresses, expiry, read only)
Limit an API token to your billing server's IP addresses, let it expire after 7 to 365 days, or make it read only, and the errors you get when a limit applies.
- REST API overview: authentication, requests and responses
How the REST API v1 works: base URL, Bearer token authentication, JSON or form bodies, the response envelope, HTTP status codes and every endpoint.
- Reseller privileges explained (what a reseller may do)
Every reseller privilege and what it allows in the admin panel and through the API, how to change them, and what a reseller can always do.