Check out the PanelFi demo — sign in to both panels, nothing to install
Documentation · Server panel: API and integrations

API tokens and API shell

A JSON REST API on the server panel's port (2087) lets billing software and scripts create, suspend, change and remove accounts. Create a token, try calls in the API Shell, then automate with curl.

Where to find itServer panel › Security Center › Manage API Tokens ; Server panel › Development › API Shell

What it does

The API lives under /api/v1 on the server panel (for example https://server.example.com:2087/api/v1). A token acts as the administrator or reseller who created it, with the same access. Resellers' tokens only see and manage their own accounts.

Manage API Tokens page
Manage API Tokens: create tokens and see the endpoints.

Create a token

  1. Open Security Center > Manage API Tokens.
  2. Under Create a token enter a Name, optionally Expires after (days) (empty for never) and tick Read only if it should only list and look.
  3. Click Create token. Copy the token now; it is not shown again. The page also shows a ready-made curl example.
  4. The Tokens list shows access (Full or Read only), last use and address, and expiry. Revoke removes one.

Resetting an administrator's password revokes that administrator's tokens.

Call the API

Send Authorization: Bearer <token>. Parameters go in a JSON body or as form fields. Answers are JSON; errors carry an error message.

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

curl -X POST -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
  -d '{"username":"acme","domain":"acme.example","email":"[email protected]","package":"Starter"}' \
  https://server.example.com:2087/api/v1/accounts

Endpoints

RequestDoesParameters
GET /versionVersion, hostname and who the token acts as
GET /accountsList accountsq, status (active, suspended), fields=usage adds disk and bandwidth use to every account
POST /accountsCreate an accountusername, domain, email, package (name or id), password (generated when left out), owner (administrator tokens)
GET /accounts/{user}One account with its domains
POST /accounts/{user}/suspendSuspendreason
POST /accounts/{user}/unsuspendUnsuspend
POST /accounts/{user}/passwordSet the panel passwordpassword
POST /accounts/{user}/packageChange packagepackage
POST /accounts/{user}/loginA one-time address that signs the customer in (valid 60 seconds)
GET /accounts/{user}/usageDisk, bandwidth, CPU and memory use
DELETE /accounts/{user}Terminate the account
GET /packagesList packages
GET /domainsList every domain

Reseller endpoints (administrator tokens only)

A reseller's token is refused on these.

RequestDoesParameters
GET /resellers, GET /resellers/{name}List resellers or show one
POST /resellersCreate a reseller loginusername, password, email, max_accounts, disk_mb, bandwidth_mb
POST /resellers/{name}/limitsChange limitsmax_accounts, disk_mb, bandwidth_mb, email
POST /resellers/{name}/suspend, /unsuspendSuspend or restore the reseller and their accounts
POST /resellers/{name}/passwordSet the reseller's passwordpassword
DELETE /resellers/{name}Remove the reseller; their accounts move to a new ownernew_owner

API Shell

Open Development > API Shell to try calls from the browser: choose GET, POST or DELETE, type the path after the base address, add a JSON body for POST and click Send. Examples for version, suspended accounts, packages and domains are one click away. Requests run as you, so changes are real.

API Shell page
API Shell: try a request from the browser.

Notes and limits

  • A read-only token can use GET only; other methods return 403.
  • After repeated wrong tokens an address is blocked for a while; it also appears in the sign-in history (see Brute-force protection).
  • When the panel is locked by a license problem, changes through the API are refused while reading still works; hosting keeps running (see Licensing and updates).
  • The license-management partner API is a separate service: see Partner program and licensing.