Docs / API tokens

API tokens

An API token is a long secret that lets a script, a deploy job or another program call the panel's API as you, without your password and without a browser. A full-access token can do through the API almost anything you can do in the panel (the exceptions are listed below). You can make it read-only, give it an end date, or limit it to some parts of the panel, and revoke it at any time.

Make a token

Open API tokens. A customer finds it in the Security group (Advanced in the Classic look). A reseller finds it on Login Security, an administrator on My account, under API Tokens.

  1. Type a Token name you will recognise, up to 60 characters, for example nightly-backup.
  2. Leave Expires (days) empty for no end date, or enter a number up to 3650. Use an end date for anything you hand to someone else.
  3. Tick Read-only if the program only needs to look. A read-only token cannot change anything.
  4. Press Create token.

The panel shows the token once, in a line that starts New token and says whether it is read-only or full access. Copy it now. The panel keeps only a fingerprint and the first characters (Prefix), so a lost token cannot be shown again: revoke it and make another.

The list shows each token's Name, Prefix, Created, Expires and Last used (date and address), with a badge: Full access, Read-only, Limited or AI assistant. You can have 25 tokens at a time. Tokens that an installed application holds into your account are listed too, read-only, and are revoked when the application is removed.

Use a token

Send it in the Authorization header, never as a cookie. The panel's address is the one you sign in to.

TOKEN='paste-the-token-here'
curl -sS https://panel.yourdomain.com/v1/me -H "Authorization: Bearer $TOKEN"

For a customer the answer holds account with your account id. Use it in the address:

curl -sS https://panel.yourdomain.com/v1/accounts/12/usage   -H "Authorization: Bearer $TOKEN"
curl -sS https://panel.yourdomain.com/v1/accounts/12/domains -H "Authorization: Bearer $TOKEN"

Answers are JSON. A failure always looks like this, so match on code:

{ "error": { "code": "read_only_token", "message": "This API token is read-only and cannot perform write operations." } }

GET /v1/accounts (the whole list) is for administrators and resellers; a customer gets 403 forbidden. https://panel.yourdomain.com/v1/openapi.json describes every route, who may call it and what a limited token needs for it.

Try it first in the API Shell. Under API tokens, open API Shell. Choose an Example or type a Method and a Path that starts with /v1/. Anything but GET needs the tick I understand this call can change my account. It runs with your own sign-in, so it reaches only your account.

Limit a token to parts of the panel

A Limited token can use only the parts you name, each as read or write (write includes read):

Part Name in the panel Covers
accounts Accounts and packages the account, its plan, usage and status
sites Websites files, domains, SSL, apps, PHP, cron, caching and other website tools
email Email mailboxes, forwarders, mailing lists and spam filtering
databases Databases MySQL/MariaDB and PostgreSQL databases and their users
dns DNS DNS records, DNSSEC and dynamic DNS
backups Backups backups and snapshots
support Support support tickets

Resellers and administrators also have resellers and system. The panel's token form makes only full-access and read-only tokens (and, if your provider allows AI assistants, assistant tokens). For a limited token, send the call from the API Shell: method POST, path /v1/tokens, tick the box, and a body such as

{ "name": "dns-updater", "scopes": ["dns:write"], "expires_days": 30 }

The answer holds the secret token once, so copy it. This token can read and change your DNS and read /v1/me. Every other part is refused. A limit never adds anything you could not do yourself. To add a record:

curl -sS https://panel.yourdomain.com/v1/accounts/12/dns -X POST \
  -H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' \
  -d '{"type":"A","name":"@","content":"203.0.113.10","ttl":3600}'

A limited token is fail-closed: a route it was not given, or one that is never open to a limited token, is refused with 403 and scope_denied:

{ "error": { "code": "scope_denied", "reason": "scope_missing", "module": "sites",
             "message": "This API token was not given access to this part of the panel." } }

reason is scope_missing (part not given), scope_read_only (given for reading only), scope_forbidden (never for a limited token) or scope_unclassified (a route the table does not know).

What a token can never do

A limited token never makes or revokes tokens, signs in or sets up two-factor, writes your contact details or preferences, creates logins (team users, User Manager, SSH keys, shell, SFTP), opens a Terminal, reads an SSL private key, gets the sign-in details phpMyAdmin or phpPgAdmin use, downloads a backup or exports a database. Even a full-access token cannot change your panel password, use the in-panel AI assistant, or approve what an assistant asked for: those need you, signed in to the panel.

Revoke a token

Press Revoke on its row and confirm Revoke this API token? It stops working at once, and anything that used it gets 401. If a token leaks, revoke it, make a new one and update the script. A token also stops when its end date passes or when its account is suspended.

Good habits

  • One token per program, named for it, so you can revoke one without breaking the rest.
  • Keep it in an environment variable or a secret store, never in a repository or a chat.
  • Prefer Read-only, a short Expires (days), or a limited token. Last used shows if something else is using it.

When something goes wrong

  • 401 unauthorized — the token is wrong, revoked or expired, or the account is suspended.
  • 403 read_only_token — the token is read-only; make a full-access or limited one.
  • 403 scope_denied — read reason and module above.
  • 403 feature_disabled — your plan does not include API tokens.
  • 403 twofa_required or password_change_required — sign in to the panel and finish that step; the token works again after.
  • 409 too_many_tokens — revoke one of your 25.
  • 403 impersonated — your provider opened your panel with "Log in"; only you can make or revoke tokens.

Related: Hosting account guide · AI assistant · Connect Claude Code to your panel · Apps, WordPress, Git deploy, caching and PHP