How to restrict an API token (IP addresses, expiry, read only)
On this page
A token that leaks can do everything its owner can. Limits make a leaked token much less useful. You set them when you create the token; to change them, create a new token and revoke the old one.
Allowed IP addresses
In Allowed IP addresses (optional), enter the addresses or ranges the token may be used from, separated by commas, spaces or new lines:
203.0.113.10, 198.51.100.0/24, 2001:db8::/48
- IPv4 and IPv6, single addresses or CIDR ranges. Up to 50 entries.
- Empty: the token works from anywhere.
- From any other address the API answers HTTP
401withThis API token may not be used from this address.
Use this for a billing system with a fixed address.
Expires
Choose Never, or After 7 days, After 30 days, After 90 days or After 365 days. After that the API answers 401 with This API token has expired. The token list shows until and the date, or expired.
Read only (cannot change anything)
Tick it for monitoring and reporting scripts.
- On the REST API, only
GETrequests work. AnyPOSTanswers403withThis API token can only read. - On
/json-api, onlyversion,applist,listaccts,accountsummary,listpkgs,showbwandgethostnamework. - A read-only token cannot create sign-in links.
Good to know
- If Admin panel access by IP is set in Brute Force Protection, tokens of administrators and resellers also work only from those addresses, in addition to the token's own list.
- Several failed requests from one address get the address blocked. Add your billing server to the Whitelisted IPs of Brute Force Protection or the Firewall allow list. See API errors.
- The Limits column of Your tokens shows each token's limits, or no limits.
Common questions
Can I change the allowed addresses of an existing token?
No. Create a new token with the new addresses, update your system, then Revoke the old one.
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.
- API returns 401 Unauthorized, 403 or IP blocked
Fix API errors: 401 Unauthorized, expired token, address not allowed, IP blocked after failed attempts, read-only token, missing privilege and 422.
- 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.