Docs apolopanel.com ↗ Start trial ↗
Documentation Integrate

REST API

Everything the panel does goes through its REST API. With an API token, a billing system or your own scripts can create and manage hosting accounts, and a server token can automate the rest of the administration.

API tokens

Administrators create tokens under Settings → General → API tokens (New API token).

The New API token dialog with the two scopes
A new token: its name, what it is for, the allowed addresses and when it expires.
Name
Shown in the audit log as api:<name>, for everything the token does.
What the token is for
Hosting accounts (billing system): packages and hosting accounts (create, suspend, change the package or password, terminate), their websites, sign-in links and usage. This is all WHMCS, Blesta, HostBill and FOSSBilling need, and the default. Server administration: everything an administrator can do over the API, apart from the panel's sign-in security settings; it works only from the addresses listed with it.
Allowed addresses
The IP addresses or ranges (such as 203.0.113.0/24) the token works from, separated by commas. Empty: any address (hosting-account tokens only).
Expires
Never, or after a time.

The token itself (starting with apolo_) is shown once: store it in your billing system or a secret store. The token list shows when each token was last used and from where; Revoke ends it at once.

The API tokens list with a token made before token scopes
A token made before token scopes existed can do everything an administrator can over the API; Limit to hosting accounts narrows it for a billing system.

A token acts as the administrator who created it. Give each system its own token with the narrowest scope and an address list, and revoke tokens you no longer use.

Authentication

Send the token in the Authorization header, over HTTPS, to the administration port:

curl -H "Authorization: Bearer $APOLO_TOKEN" \
     https://server1.example.com:8443/api/v1/accounts
  • The base address is https://<server>:8443/api/v1. Tokens aren't accepted on the users' port (2083).
  • Cookies are ignored for token requests, so no CSRF token is needed.
  • Some endpoints are only for a person in a browser and refuse tokens: everything under /session (profile, password, two-factor), managing API tokens, "Log in as user" and the sign-in links to phpMyAdmin, WP Admin and webmail. A billing system signs a customer in with POST /accounts/{id}/login-link instead.

Requests and responses

  • Requests and responses are JSON (Content-Type: application/json); request bodies are limited to 1 MB.
  • GET reads, POST creates or starts an action, PUT and PATCH change, DELETE removes.
  • Texts in responses (messages, activity lines, job titles) are English templates with parameters, such as "text": "Created the website {0}", "params": ["example.com"], so you can translate them or fill in the parameters yourself.
  • Dates are ISO 8601 in UTC (2026-12-01T10:00:00Z); sizes are in MB unless the field name says otherwise.

Errors

A failed request returns an HTTP status and an error object:

{
  "error": {
    "code": "validation",
    "message": "Use 3–16 lowercase letters and digits, starting with a letter.",
    "field": "username"
  }
}
StatuscodeMeaning
401unauthorizedNo token, a wrong or expired token, or the administrator who made it no longer exists
403forbiddenThe token's scope doesn't include this endpoint, the endpoint is for browsers only, the request comes from an address not on the token's list, or it isn't HTTPS
404not_foundThe account, website or other object doesn't exist
409conflict, limit_reachedIt already exists, something else is running for it, a limit (of the package or the licence) is reached, or too many requests (see Rate limits)
422validationA field is wrong; field names it
402license_lockedThe panel has no active licence (hosting keeps running)
503unavailableA service on the server didn't do it; message says why

message is a template like the texts above: {0}, {1}… are filled from params.

Background jobs

Work that takes longer (installing, creating a website with a certificate, backups, migrations) answers at once with 202 Accepted and a job:

{
  "id": "job_8f2c1a",
  "kind": "runtime",
  "key": "runtime:php:8.4",
  "title": "Installing {0} {1}",
  "titleParams": ["PHP", "8.4"],
  "status": "running",
  "startedAt": "2026-12-01T10:00:00Z"
}

Poll GET /api/v1/jobs (server tokens) until its status is done or failed; a failed job has error and errorParams, a finished one done and doneParams. Only one job runs for the same key at a time: starting it again returns the running job.

Rate limits

Each token has a budget of 300 requests that refills at 10 requests a second, enough for a billing system that suspends hundreds of services in a row. Over it, the answer is 409 limit_reached with a Retry-After header (seconds). Failed attempts with a wrong token are limited per address (20 in 10 minutes).

When administration access is limited to listed addresses (Administration access), tokens work only from those addresses too.

Endpoints

Hosting accounts (both scopes)

EndpointWhat it does
GET /packagesThe packages and their limits
GET /accountsHosting accounts (search, for example by username)
POST /accountsCreate an account: username, name, email, password, packageId, optionally dedicatedIp
POST /accounts/{id}/statusSuspend or activate: status (suspended or active) and a reason
POST /accounts/{id}/packageMove the account to another package
PUT /accounts/{id}/passwordSet the account's panel password
POST /accounts/{id}/terminateDelete the account with its websites, databases and mail
POST /accounts/{id}/login-linkA one-time sign-in link to the users' panel (valid 60 seconds), optionally straight to a page (goTo)
GET /accounts/usageDisk and bandwidth use of every account this month, with its limits
GET /websites, POST /websitesThe accounts' websites; create a website (with a Let's Encrypt certificate) for an account
GET /server/runtimesThe installed PHP and other versions, for choosing one
GET /mail/webmailThe webmail addresses, for links in a client area

Hosting-account tokens never reach administrator accounts.

Server administration (server tokens)

A server token reaches the administration endpoints of every area, the same ones the panel uses (about 350): websites and their domains, SSL, PHP, Git, cron and logs; WordPress; databases and database users; mail (domains, mailboxes, forwarders, filters, delivery reports, the queue); DNS zones and records; backups and restores; accounts and packages; addons, BEDEM, Voyager and Apolo Pulse; services, updates, system updates, the network and the server's settings; migrations; notifications, the audit log and monitoring. The paths follow the panel's pages, for example:

# every website with its owner, runtime and certificate
GET /api/v1/websites
# Apolo Pulse's status, settings and history
GET /api/v1/pulse
# start a backup now (answers with a job)
POST /api/v1/backups/run

The easiest way to find an endpoint and its fields is to do the same thing in the panel with the browser's developer tools open (Network tab): the panel calls the same API.

Examples

# create a hosting account on the "Standard" package
curl -X POST -H "Authorization: Bearer $APOLO_TOKEN" -H "Content-Type: application/json" \
  -d '{"username":"ana","name":"Ana Jovanovic","email":"ana@example.com","password":"a-long-random-password","packageId":"pkg_standard"}' \
  https://server1.example.com:8443/api/v1/accounts

# suspend it for an overdue invoice
curl -X POST -H "Authorization: Bearer $APOLO_TOKEN" -H "Content-Type: application/json" \
  -d '{"status":"suspended","reason":"Overdue invoice"}' \
  https://server1.example.com:8443/api/v1/accounts/ACCOUNT_ID/status

# a sign-in link for the customer
curl -X POST -H "Authorization: Bearer $APOLO_TOKEN" \
  https://server1.example.com:8443/api/v1/accounts/ACCOUNT_ID/login-link

For a ready integration with a billing system, see Billing systems. For Claude and other AI assistants, use an MCP token instead of an API token; see AI assistants (MCP). Apolo Pulse can also call your own address on every action it takes; see its webhook.

Something missing or unclear? Ask support or report a bug.