How to create an API token for scripts and billing

Updated 2026-10-29

On this page
  1. Which token do I need?
  2. Steps
  3. See and revoke tokens
  4. Good to know
  5. Common questions

An API token lets a script or a billing system act for you without your password. The token is shown only once; the server keeps only a fingerprint of it.

Which token do I need?

You areCreate it inIt works for
AdministratorAdmin panel → API Tokens (section Account)Every account and package, REST API v1, /json-api, WHMCS
ResellerAdmin panel → API Tokens (needs the API tokens (billing systems) privilege)The reseller's own accounts and packages
Hosting customerControl panel → API tokens (section Advanced)Only the customer API of that account

Steps

  1. Open API Tokens in the admin panel, or API tokens in the control panel.
  2. Name — what the token is for, for example billing or deploy script. 1–64 characters: letters, digits, spaces, _, . and -.
  3. Optional limits (see restrict an API token):
    • Allowed IP addresses — the token works only from these addresses or ranges.
    • Expires — Never, or after 7, 30, 90 or 365 days.
    • Read only (cannot change anything).
  4. Click Create token.
  5. The page shows New token: with the token and a Copy button. Copy it now and store it safely. It will not be shown again.

The token is a string of 40 letters and digits, for example 9F2C…. Send it as Authorization: Bearer <token>.

See and revoke tokens

Your tokens lists each token with its Limits, when it was Created and when it was Last used (never if not yet). Click Revoke to stop a token at once.

Good to know

  • A lost token cannot be shown again. Revoke it and create a new one.
  • Only the account owner can create customer tokens; team members do not see API tokens.
  • A token stops working when its owner loses API access: a reseller without the API tokens (billing systems) privilege, a customer whose plan leaves out API tokens, or a suspended account.
  • Use one token per system, so you can revoke one without breaking the others.

Common questions

Where do I put the token in WHMCS?

In the server's Access Hash field. See connect WHMCS.

Does the token expire when I change my password?

No. Tokens are independent of the password. Revoke them yourself when needed.

Was this article helpful?

Still stuck?

Ask the AI about your exact situation — it answers from this knowledge base — or contact us.