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:

PanelBase URLTypical callers
Hosting panelhttps://panel.example.com:2083/v1/Customers' scripts and AI assistants
Admin panelhttps://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_… or dnsz_…. 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, answer 202 Accepted with the job, which you can then poll.
  • DELETE and some other actions answer 204 No Content.
  • Every response has an X-Request-Id header. 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, never 403, 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:

CodeMeaning
BAD_REQUESTThe body is not valid JSON for this operation, or a parameter is wrong
VALIDATION_FAILEDOne or more fields failed; see violations
UNAUTHENTICATEDNo valid token or session
FORBIDDENYou can see the resource but may not do this
NOT_FOUNDIt does not exist, or it is outside your tenants
POLICY_DENIEDA package limit or provider policy forbids it; violations names the limit
CONFLICTIt already exists, or its state does not allow this now
RATE_LIMITEDToo many requests of this kind; try again later
ACCOUNT_SUSPENDEDThe account or user is suspended
DEMO_MODEA demo account: it can read but not change anything
MFA_ENROLLMENT_REQUIREDThe user must set up two-factor authentication first
PASSWORD_CHANGE_REQUIREDThe user must change their password first
CSRF_FAILEDA browser request from another site, or a session request without its CSRF token
INTERNAL, UNAVAILABLEA 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 with kind=reseller or kind=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-Key header with any POST: a unique value per intended change, such as order-1042-create or 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, marked Idempotent-Replayed: true. Keys are kept for 24 hours, per API token.
    • The same key with a different request answers 422 with IDEMPOTENCY_KEY_REUSED.
    • While the first request still runs, the retry answers 409 with IDEMPOTENCY_IN_PROGRESS: wait and retry.
    • Server errors (5xx) are not kept, so a retry runs the request again.
  • There is no general request quota. A few expensive operations have their own limits and answer 429 with RATE_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

MethodPathPurpose
GET/v1/sessionWho you are, your tenant and your effective permissions
GET/v1/me/tokensList your API tokens
POST/v1/me/tokensCreate a token (panel session only)
DELETE/v1/me/tokens/{id}Revoke a token
GET/v1/me/policyYour effective limits and features

Accounts and resellers

MethodPathPurpose
GET/v1/tenants/{id}Get a tenant
GET/v1/tenants/{id}/childrenList resellers and accounts below a tenant (paged)
GET/v1/accountsList all accounts below you
GET/v1/accounts/lookup?username=Find an account by its owner's username
POST/v1/tenants/{id}/accountsCreate an account with its owner and primary domain
POST/v1/tenants/{id}/resellersCreate a reseller
PATCH/v1/tenants/{id}Rename a tenant
PUT/v1/tenants/{id}/packageChange an account's package
POST/v1/tenants/{id}/suspendSuspend an account
POST/v1/tenants/{id}/unsuspendUnsuspend an account
POST/v1/tenants/{id}/terminateTerminate an account and delete its data
POST/v1/tenants/{id}/login-linkOne-time sign-in link for an account owner
GET/v1/tenants/{id}/disk-usageDisk usage
GET/v1/tenants/{id}/bandwidthTransfer 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

MethodPathPurpose
GET/v1/tenants/{id}/usersList a tenant's users
POST/v1/tenants/{id}/usersAdd a user
PUT/v1/users/{id}/roleChange a user's role
PUT/v1/users/{id}/passwordSet a user's password (from a parent tenant)
DELETE/v1/users/{id}Delete a user
GET/v1/tenants/{id}/packagesList packages
POST/v1/tenants/{id}/packagesCreate a package
GET/v1/packages/{id}Get a package
PUT/v1/packages/{id}Change a package
DELETE/v1/packages/{id}Delete a package

Websites

MethodPathPurpose
GET/v1/tenants/{id}/sitesList websites
POST/v1/tenants/{id}/sitesCreate 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/runtimesRuntimes you can choose
GET/v1/sites/{id}/metricsUsage metrics over a time range
GET/v1/sites/{id}/logsRecent access, error or PHP log lines
GET/v1/sites/{id}/access-logSearch the access log
GET/v1/appsApplication catalog
POST/v1/sites/{id}/appsInstall an application
POST/v1/sites/{id}/caching/purgePurge the website's cache

Domains and certificates

MethodPathPurpose
POST/v1/tenants/{id}/domainsAdd a domain: DNS zone, website, www and mail in one step
GET/v1/sites/{id}/domainsList a website's domains
POST/v1/sites/{id}/domainsAdd a domain to a website
PATCH/v1/domains/{id}Change a domain
DELETE/v1/domains/{id}Remove a domain
GET/v1/domains/{id}/certificateCertificate status
POST/v1/domains/{id}/certificate/issueIssue a certificate now
PUT/v1/domains/{id}/certificateUpload 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

MethodPathPurpose
GET/v1/tenants/{id}/dns-zonesList DNS zones
POST/v1/tenants/{id}/dns-zonesCreate a zone
GET/v1/dns-zones/{id}Get a zone
DELETE/v1/dns-zones/{id}Delete a zone
GET/v1/dns-zones/{id}/recordsList records
POST/v1/dns-zones/{id}/recordsAdd a record
PUT/v1/dns-records/{id}Change a record
DELETE/v1/dns-records/{id}Delete a record
PUT/v1/dns-zones/{id}/dnssecTurn DNSSEC on or off

Mail

MethodPathPurpose
GET/v1/tenants/{id}/mail-domainsList mail domains
POST/v1/tenants/{id}/mail-domainsAdd a mail domain
GET/v1/mail-domains/{id}/mailboxesList mailboxes
POST/v1/mail-domains/{id}/mailboxesCreate a mailbox
PATCH/v1/mailboxes/{id}Change a mailbox (password, quota)
DELETE/v1/mailboxes/{id}Delete a mailbox
GET/v1/mail-domains/{id}/aliasesList forwarders
POST/v1/mail-domains/{id}/aliasesAdd a forwarder
PUT/v1/mailboxes/{id}/autoresponderSet an autoresponder
PUT/v1/mailboxes/{id}/filtersSet mail filters
GET/v1/mail-domains/{id}/deliverabilityMX, SPF, DKIM, DMARC and PTR checks
GET/v1/mail-domains/{id}/deliveriesRecent 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

MethodPathPurpose
GET/v1/tenants/{id}/databasesList databases
POST/v1/tenants/{id}/databasesCreate a database
DELETE/v1/databases/{id}Delete a database
GET/v1/tenants/{id}/database-usersList database users
POST/v1/tenants/{id}/database-usersCreate a database user
POST/v1/database-users/{id}/rotate-passwordSet 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}/exportDownload a dump

Files

MethodPathPurpose
GET/v1/sites/{id}/filesList a folder
GET/v1/sites/{id}/files/contentDownload a file
PUT/v1/sites/{id}/files/contentUpload or overwrite a file
POST/v1/sites/{id}/files/mkdirCreate a folder
POST/v1/sites/{id}/files/moveMove or rename
POST/v1/sites/{id}/files/copyCopy
POST/v1/sites/{id}/files/deleteDelete files and folders
POST/v1/sites/{id}/files/compressMake an archive
POST/v1/sites/{id}/files/extractUnpack an archive
GET/v1/sites/{id}/files/searchSearch by name

Backups

MethodPathPurpose
GET/v1/sites/{id}/backupsList a website's backups
POST/v1/sites/{id}/backupsStart a website backup
POST/v1/backups/{id}/restoreRestore a backup
GET/v1/backups/{id}/downloadDownload a backup
POST/v1/databases/{id}/backupsStart a database backup
POST/v1/mail-domains/{id}/backupsStart a mail backup
GET/v1/tenants/{id}/account-backupsList full account backups
POST/v1/tenants/{id}/account-backupsStart a full account backup

Cron jobs and SSH

MethodPathPurpose
GET/v1/sites/{id}/cron-jobsList cron jobs
POST/v1/sites/{id}/cron-jobsCreate 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}/startRun a cron job now
GET/v1/cron-jobs/{id}/runsRecent runs
GET/v1/sites/{id}/ssh-grantsList SSH and SFTP access
POST/v1/sites/{id}/ssh-grantsGrant SSH or SFTP access
DELETE/v1/ssh-grants/{id}Revoke access

Alerts and webhooks

MethodPathPurpose
GET/v1/tenants/{id}/alertsList alerts
POST/v1/alerts/{id}/acknowledgeAcknowledge an alert
GET/v1/tenants/{id}/alert-rulesList alert rules
POST/v1/tenants/{id}/alert-rulesCreate an alert rule
GET/v1/tenants/{id}/alert-webhooksList webhooks
POST/v1/tenants/{id}/alert-webhooksAdd a webhook
POST/v1/alert-webhooks/{id}/testSend a test event
GET/v1/alert-webhooks/{id}/deliveriesRecent deliveries

Servers (provider)

MethodPathPurpose
GET/v1/nodesList servers
GET/v1/nodes/{id}Get a server
GET/v1/nodes/{id}/metricsServer metrics over a time range
POST/v1/sites/{id}/migrateMove a website to another server
GET/v1/migrationsList 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:

  1. Open the panel in your browser and open the developer tools (Network tab).
  2. Do the action in the panel.
  3. 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.