API reference
Conventions of the ScalPanel HTTP API and the main endpoints for accounts, websites, domains, DNS, mail, databases, files and backups.
The panels are built on this API, so anything you can do in a panel you can also do with a script. This page covers the conventions and the endpoints people use most. Read Authentication first.
Base URL
The API is served under /v1/ on both panel addresses:
| Panel | Base URL | Typical callers |
|---|---|---|
| Hosting panel | https://panel.example.com:2083/v1/ | Customers' scripts and AI assistants |
| Admin panel | https://panel.example.com:2087/v1/ | Providers, resellers, billing systems |
A token works on either address. What it may do depends only on its owner and scopes. Upload files through the hosting panel address: it accepts uploads up to 256 MiB, while other requests are limited to 10 MiB.
GET /v1/meta needs no token and answers {"service": "scalpanel", "api_version": "v1"}.
Requests and responses
- Send JSON with
Content-Type: application/json. A request body holds a single JSON object, normally at most 64 KiB. - Unknown fields in a request body are refused, so typos fail loudly instead of being ignored.
- IDs are strings with a type prefix, for example
site_…,db_…ordnsz_…. Get them from the list endpoints. - Times are RFC 3339 strings in UTC.
- Creating something answers
201 Created. Operations that run in the background, such as backups and restores, answer202 Acceptedwith the job, which you can then poll. DELETEand some other actions answer204 No Content.- Every response has an
X-Request-Idheader. Quote it when you report a problem.
Tenants and IDs
ScalPanel is a tree: the provider, then resellers, then customer accounts. Each is a tenant with an ID. Most collection endpoints take the tenant ID in the path, for example /v1/tenants/{id}/sites.
- Get your own tenant ID from
GET /v1/session(tenant.id). - Providers and resellers can use the ID of any account below them.
- A resource outside your part of the tree answers
404, never403, so its existence is not revealed.
Errors
Errors use RFC 9457 problem details with the media type application/problem+json:
{
"type": "https://scalpanel.dev/problems/validation-failed",
"title": "Unprocessable Entity",
"status": 422,
"code": "VALIDATION_FAILED",
"detail": "…",
"request_id": "…",
"violations": [
{"field": "domain", "code": "INVALID_VALUE", "message": "…"}
]
}
Use the code, not the text, in your scripts. The codes are part of the API contract:
| Code | Meaning |
|---|---|
BAD_REQUEST | The body is not valid JSON for this operation, or a parameter is wrong |
VALIDATION_FAILED | One or more fields failed; see violations |
UNAUTHENTICATED | No valid token or session |
FORBIDDEN | You can see the resource but may not do this |
NOT_FOUND | It does not exist, or it is outside your tenants |
POLICY_DENIED | A package limit or provider policy forbids it; violations names the limit |
CONFLICT | It already exists, or its state does not allow this now |
RATE_LIMITED | Too many requests of this kind; try again later |
ACCOUNT_SUSPENDED | The account or user is suspended |
DEMO_MODE | A demo account: it can read but not change anything |
MFA_ENROLLMENT_REQUIRED | The user must set up two-factor authentication first |
PASSWORD_CHANGE_REQUIRED | The user must change their password first |
CSRF_FAILED | A browser request from another site, or a session request without its CSRF token |
INTERNAL, UNAVAILABLE | A server error; retry later and quote the request ID |
Error details never contain internal data such as SQL, file paths or secrets.
Lists and pagination
List endpoints answer {"items": [...]}. Most lists are bounded by the account's limits and come back whole.
The two lists that can grow without bound page with a cursor:
GET /v1/tenants/{id}/children(resellers and accounts below a tenant; filter withkind=resellerorkind=account);GET /v1/tenants/{id}/audit(the activity log).
Pass limit (1–200, default 50). When there may be more, the answer has next_cursor; pass it as cursor to get the next page.
curl -s "https://panel.example.com:2087/v1/tenants/$TENANT_ID/children?kind=account&limit=100" \
-H "Authorization: Bearer $SCALPANEL_TOKEN"
Retries and rate limits
- Safe retries. Send an
Idempotency-Keyheader with anyPOST: a unique value per intended change, such asorder-1042-createor a UUID (1 to 255 printable characters, no spaces). If the request times out, send it again with the same key and the same body. The panel runs it once and answers the retry with the first response, markedIdempotent-Replayed: true. Keys are kept for 24 hours, per API token.- The same key with a different request answers
422withIDEMPOTENCY_KEY_REUSED. - While the first request still runs, the retry answers
409withIDEMPOTENCY_IN_PROGRESS: wait and retry. - Server errors (
5xx) are not kept, so a retry runs the request again.
- The same key with a different request answers
- There is no general request quota. A few expensive operations have their own limits and answer
429withRATE_LIMITED, for example DNS lookups, re-applying a website, ScalGuard scans and confirmation emails.
Endpoints
These tables list the main endpoints by area. {id} is the ID of the resource named before it; in /v1/tenants/{id}/… it is a tenant ID.
Session and your own user
| Method | Path | Purpose |
|---|---|---|
| GET | /v1/session | Who you are, your tenant and your effective permissions |
| GET | /v1/me/tokens | List your API tokens |
| POST | /v1/me/tokens | Create a token (panel session only) |
| DELETE | /v1/me/tokens/{id} | Revoke a token |
| GET | /v1/me/policy | Your effective limits and features |
Accounts and resellers
| Method | Path | Purpose |
|---|---|---|
| GET | /v1/tenants/{id} | Get a tenant |
| GET | /v1/tenants/{id}/children | List resellers and accounts below a tenant (paged) |
| GET | /v1/accounts | List all accounts below you |
| GET | /v1/accounts/lookup?username= | Find an account by its owner's username |
| POST | /v1/tenants/{id}/accounts | Create an account with its owner and primary domain |
| POST | /v1/tenants/{id}/resellers | Create a reseller |
| PATCH | /v1/tenants/{id} | Rename a tenant |
| PUT | /v1/tenants/{id}/package | Change an account's package |
| POST | /v1/tenants/{id}/suspend | Suspend an account |
| POST | /v1/tenants/{id}/unsuspend | Unsuspend an account |
| POST | /v1/tenants/{id}/terminate | Terminate an account and delete its data |
| POST | /v1/tenants/{id}/login-link | One-time sign-in link for an account owner |
| GET | /v1/tenants/{id}/disk-usage | Disk usage |
| GET | /v1/tenants/{id}/bandwidth | Transfer usage |
Creating an account:
curl -s -X POST https://panel.example.com:2087/v1/tenants/$RESELLER_ID/accounts \
-H "Authorization: Bearer $SCALPANEL_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Example Ltd",
"package_id": "'"$PACKAGE_ID"'",
"primary_domain": "example.org",
"owner": {"username": "exampleorg", "email": "[email protected]", "password": "'"$OWNER_PASSWORD"'"}
}'
By default this also creates the domain's website, DNS zone and mail domain. Send "setup": false to only record the domain.
Users and packages
| Method | Path | Purpose |
|---|---|---|
| GET | /v1/tenants/{id}/users | List a tenant's users |
| POST | /v1/tenants/{id}/users | Add a user |
| PUT | /v1/users/{id}/role | Change a user's role |
| PUT | /v1/users/{id}/password | Set a user's password (from a parent tenant) |
| DELETE | /v1/users/{id} | Delete a user |
| GET | /v1/tenants/{id}/packages | List packages |
| POST | /v1/tenants/{id}/packages | Create a package |
| GET | /v1/packages/{id} | Get a package |
| PUT | /v1/packages/{id} | Change a package |
| DELETE | /v1/packages/{id} | Delete a package |
Websites
| Method | Path | Purpose |
|---|---|---|
| GET | /v1/tenants/{id}/sites | List websites |
| POST | /v1/tenants/{id}/sites | Create a website |
| GET | /v1/sites/{id} | Get a website |
| PATCH | /v1/sites/{id} | Change a website (for example its runtime) |
| DELETE | /v1/sites/{id} | Delete a website |
| GET | /v1/runtimes | Runtimes you can choose |
| GET | /v1/sites/{id}/metrics | Usage metrics over a time range |
| GET | /v1/sites/{id}/logs | Recent access, error or PHP log lines |
| GET | /v1/sites/{id}/access-log | Search the access log |
| GET | /v1/apps | Application catalog |
| POST | /v1/sites/{id}/apps | Install an application |
| POST | /v1/sites/{id}/caching/purge | Purge the website's cache |
Domains and certificates
| Method | Path | Purpose |
|---|---|---|
| POST | /v1/tenants/{id}/domains | Add a domain: DNS zone, website, www and mail in one step |
| GET | /v1/sites/{id}/domains | List a website's domains |
| POST | /v1/sites/{id}/domains | Add a domain to a website |
| PATCH | /v1/domains/{id} | Change a domain |
| DELETE | /v1/domains/{id} | Remove a domain |
| GET | /v1/domains/{id}/certificate | Certificate status |
| POST | /v1/domains/{id}/certificate/issue | Issue a certificate now |
| PUT | /v1/domains/{id}/certificate | Upload your own certificate |
Adding a domain with everything it needs:
curl -s -X POST https://panel.example.com:2083/v1/tenants/$TENANT_ID/domains \
-H "Authorization: Bearer $SCALPANEL_TOKEN" \
-H "Content-Type: application/json" \
-d '{"domain": "shop.example.org", "www": true, "mail": true}'
Send site_id to attach the domain to an existing website instead of a new one.
DNS
| Method | Path | Purpose |
|---|---|---|
| GET | /v1/tenants/{id}/dns-zones | List DNS zones |
| POST | /v1/tenants/{id}/dns-zones | Create a zone |
| GET | /v1/dns-zones/{id} | Get a zone |
| DELETE | /v1/dns-zones/{id} | Delete a zone |
| GET | /v1/dns-zones/{id}/records | List records |
| POST | /v1/dns-zones/{id}/records | Add a record |
| PUT | /v1/dns-records/{id} | Change a record |
| DELETE | /v1/dns-records/{id} | Delete a record |
| PUT | /v1/dns-zones/{id}/dnssec | Turn DNSSEC on or off |
| Method | Path | Purpose |
|---|---|---|
| GET | /v1/tenants/{id}/mail-domains | List mail domains |
| POST | /v1/tenants/{id}/mail-domains | Add a mail domain |
| GET | /v1/mail-domains/{id}/mailboxes | List mailboxes |
| POST | /v1/mail-domains/{id}/mailboxes | Create a mailbox |
| PATCH | /v1/mailboxes/{id} | Change a mailbox (password, quota) |
| DELETE | /v1/mailboxes/{id} | Delete a mailbox |
| GET | /v1/mail-domains/{id}/aliases | List forwarders |
| POST | /v1/mail-domains/{id}/aliases | Add a forwarder |
| PUT | /v1/mailboxes/{id}/autoresponder | Set an autoresponder |
| PUT | /v1/mailboxes/{id}/filters | Set mail filters |
| GET | /v1/mail-domains/{id}/deliverability | MX, SPF, DKIM, DMARC and PTR checks |
| GET | /v1/mail-domains/{id}/deliveries | Recent deliveries |
Creating a mailbox:
curl -s -X POST https://panel.example.com:2083/v1/mail-domains/$MAIL_DOMAIN_ID/mailboxes \
-H "Authorization: Bearer $SCALPANEL_TOKEN" \
-H "Content-Type: application/json" \
-d '{"local_part": "info", "password": "'"$MAILBOX_PASSWORD"'", "quota_mb": 2048}'
Databases
| Method | Path | Purpose |
|---|---|---|
| GET | /v1/tenants/{id}/databases | List databases |
| POST | /v1/tenants/{id}/databases | Create a database |
| DELETE | /v1/databases/{id} | Delete a database |
| GET | /v1/tenants/{id}/database-users | List database users |
| POST | /v1/tenants/{id}/database-users | Create a database user |
| POST | /v1/database-users/{id}/rotate-password | Set a new random password |
| PUT | /v1/database-users/{id}/grants/{databaseId} | Grant a user access to a database |
| DELETE | /v1/database-users/{id}/grants/{databaseId} | Remove that access |
| GET | /v1/databases/{id}/export | Download a dump |
Files
| Method | Path | Purpose |
|---|---|---|
| GET | /v1/sites/{id}/files | List a folder |
| GET | /v1/sites/{id}/files/content | Download a file |
| PUT | /v1/sites/{id}/files/content | Upload or overwrite a file |
| POST | /v1/sites/{id}/files/mkdir | Create a folder |
| POST | /v1/sites/{id}/files/move | Move or rename |
| POST | /v1/sites/{id}/files/copy | Copy |
| POST | /v1/sites/{id}/files/delete | Delete files and folders |
| POST | /v1/sites/{id}/files/compress | Make an archive |
| POST | /v1/sites/{id}/files/extract | Unpack an archive |
| GET | /v1/sites/{id}/files/search | Search by name |
Backups
| Method | Path | Purpose |
|---|---|---|
| GET | /v1/sites/{id}/backups | List a website's backups |
| POST | /v1/sites/{id}/backups | Start a website backup |
| POST | /v1/backups/{id}/restore | Restore a backup |
| GET | /v1/backups/{id}/download | Download a backup |
| POST | /v1/databases/{id}/backups | Start a database backup |
| POST | /v1/mail-domains/{id}/backups | Start a mail backup |
| GET | /v1/tenants/{id}/account-backups | List full account backups |
| POST | /v1/tenants/{id}/account-backups | Start a full account backup |
Cron jobs and SSH
| Method | Path | Purpose |
|---|---|---|
| GET | /v1/sites/{id}/cron-jobs | List cron jobs |
| POST | /v1/sites/{id}/cron-jobs | Create a cron job |
| PATCH | /v1/cron-jobs/{id} | Change a cron job |
| DELETE | /v1/cron-jobs/{id} | Delete a cron job |
| POST | /v1/cron-jobs/{id}/start | Run a cron job now |
| GET | /v1/cron-jobs/{id}/runs | Recent runs |
| GET | /v1/sites/{id}/ssh-grants | List SSH and SFTP access |
| POST | /v1/sites/{id}/ssh-grants | Grant SSH or SFTP access |
| DELETE | /v1/ssh-grants/{id} | Revoke access |
Alerts and webhooks
| Method | Path | Purpose |
|---|---|---|
| GET | /v1/tenants/{id}/alerts | List alerts |
| POST | /v1/alerts/{id}/acknowledge | Acknowledge an alert |
| GET | /v1/tenants/{id}/alert-rules | List alert rules |
| POST | /v1/tenants/{id}/alert-rules | Create an alert rule |
| GET | /v1/tenants/{id}/alert-webhooks | List webhooks |
| POST | /v1/tenants/{id}/alert-webhooks | Add a webhook |
| POST | /v1/alert-webhooks/{id}/test | Send a test event |
| GET | /v1/alert-webhooks/{id}/deliveries | Recent deliveries |
Servers (provider)
| Method | Path | Purpose |
|---|---|---|
| GET | /v1/nodes | List servers |
| GET | /v1/nodes/{id} | Get a server |
| GET | /v1/nodes/{id}/metrics | Server metrics over a time range |
| POST | /v1/sites/{id}/migrate | Move a website to another server |
| GET | /v1/migrations | List website moves |
Finding other endpoints
The API has more than 500 endpoints: server settings, the firewall, Cloudflare, WordPress tools, Git repositories, transfers and more. All of them are in the machine-readable description, openapi.yaml (OpenAPI 3.1), which you can import into Postman or Insomnia, or feed to a client generator. The API clients are generated from the same file. To find the call behind any panel action:
- Open the panel in your browser and open the developer tools (Network tab).
- Do the action in the panel.
- Look at the request to
/v1/…: its method, path and JSON body are exactly what your script needs.
Then make the same call with your token instead of the session cookie, and leave out the X-CSRF-Token header.