How to create an API token for billing and automation

For server administrators · Updated 2026-10-29

On this page
  1. Steps
  2. Use the token
  3. Connect a billing system
  4. Revoke a token
  5. Common questions

An API token lets another system — your billing system, a script or another server — create, suspend and manage accounts without your password. Each token can be limited and revoked at any time.

Steps

  1. Log in to the administrator panel (https://<server>:2087).
  2. Open API Tokens in the menu (section Account).
  3. Name — a name you recognise, for example billing.
  4. Allowed IP addresses (optional) — the addresses or ranges the token may be used from, for example 203.0.113.10, 198.51.100.0/24. Empty means from anywhere. Up to 50 entries.
  5. Expires — Never, or after 7, 30, 90 or 365 days.
  6. Tick Read only (cannot change anything) for tokens that only read data, for example monitoring.
  7. Click Create token.
  8. Copy the token shown in the green box (Copy). It is not shown again.

The token appears under Your tokens with its limits, when it was created and when it was Last used.

Use the token

Send it in the Authorization header:

curl -H "Authorization: Bearer TOKEN" https://server1.example.com:2087/api/v1/accounts

The Usage card on the page lists the main calls, for example POST /api/v1/accounts, POST /api/v1/accounts/{username}/suspend and GET /api/v1/server/status.

Connect a billing system

  • WHMCS: click Download the WHMCS module and unpack it into your WHMCS folder (it creates modules/servers/hostpanel). In WHMCS, add a server with the module "Hosting Panel", the hostname of this server, port 2087 with SSL, and the token in "Access Hash".
  • Other billing systems (for example Blesta or HostBill): the server also answers the standard /json-api interface on port 2087. Use the billing system's usual module for hosting control panels, with your admin username and the token.

In both cases, add the billing server's IP address to the Firewall allow list: wrong tokens get an address blocked.

Revoke a token

Click Revoke next to it and confirm. It stops working at once.

Common questions

I lost the token. Can I see it again?

No. Tokens are stored only as a hash. Create a new token and revoke the old one.

What can a reseller's token do?

Resellers create their own tokens on the same page; a reseller's token reaches only that reseller's accounts and packages.

Was this article helpful?

Still stuck?

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