StackRegent REST API reference
Base URL, authentication, request and error format, paging and tasks, followed by every endpoint the panel registers, grouped by area, with the kind of key that may call it.
Base URL and transport#
The StackRegent REST API is served by the panel itself:
https://SERVER:9443/api/SERVER is the panel's host name or IP address. 9443 is the default HTTPS port; if it was changed at install time (-HttpsPort) or later with stackregent panel-port, use that port. The panel's HTTP port (9080 by default) only redirects to HTTPS, so always call the HTTPS address. The Examples card on Tools & Settings › Remote API (REST), and on Account › API Keys for resellers and customers, shows the base address of your own server.
A fresh panel uses a self-signed certificate. Install a trusted certificate for the panel before you point a billing system at it, so that clients can verify the connection instead of skipping the check. Skipping certificate checks (curl -k, -SkipCertificateCheck) is acceptable only for a first test.
Authentication#
Every call except sign-in and GET /api/health needs an API key. Keys start with sr_ and are created in the panel; see API keys. Send the key in either header:
Authorization: Bearer sr_0123456789abcdef...
X-API-Key: sr_0123456789abcdef...If both are present, X-API-Key is used. A key acts exactly as the account that created it: an administrator, a reseller or a customer. There are no per-key scopes. Calls made with a key need no session cookie and no CSRF token.
A key is refused with 401 invalid API key when it is wrong, has expired, is used from an address outside its Allowed from list, or belongs to an account that is no longer active. Administrator keys also obey IP Access Restriction Management. Reseller and customer keys stop working as soon as their plan loses the REST API permission, because that permission is checked on every call.
First call with curl#
curl -s https://panel.example.com:9443/api/subscriptions \
-H "Authorization: Bearer sr_..."First call with PowerShell#
[Net.ServicePointManager]::SecurityProtocol = 'Tls12'
$base = 'https://panel.example.com:9443/api'
$h = @{ Authorization = 'Bearer sr_...' }
Invoke-RestMethod -Uri "$base/subscriptions" -Headers $hThe first line makes Windows PowerShell 5.1 use TLS 1.2; PowerShell 7 does not need it.
Requests and responses#
- Methods.
GETreads,POSTcreates or starts an action,PUTchanges,DELETEremoves. - Bodies. Send JSON with
Content-Type: application/json. Ordinary bodies are limited to 1 MiB; file uploads have their own endpoints. - Unknown fields are refused. The panel decodes request bodies strictly: a field it does not know, or a value of the wrong type, gives
400 invalid request. Check field names and types against the OpenAPI description (see below) when that happens. - Answers. JSON objects with status
200, or202for a few calls that only queue work. Download endpoints, such as backup and log downloads, return the file itself. - IDs. Objects are addressed by numeric IDs:
/api/subscriptions/12,/api/websites/31. A website ID is the domain's ID, which you find in thedomainslist ofGET /api/subscriptions/{id}or inGET /api/domains.
Tasks: work that runs in the background#
Creating, changing and removing hosting objects touches IIS, Windows accounts, NTFS permissions, DNS and mail. That work runs in the StackRegent task service, so the API answers quickly with a task ID:
POST /api/subscriptions -> {"id": 12, "task_id": 345}
POST /api/subscriptions/12/status -> {"task_id": 346}
POST /api/backups -> {"id": 88, "task": 347}Note that the backup call names the field task. Follow a task with GET /api/tasks/{id}. Its status is queued, running, success or failure; progress is a percentage and log holds what the task wrote. A finished task can be queued again with POST /api/tasks/{id}/retry. Administrators can list tasks with GET /api/tasks?status=failure&page=1&size=50; resellers and customers see their own recent tasks in GET /api/my/tasks and can read a single task they started.
Errors#
Errors use the HTTP status code and a JSON body with an error message. Validation errors also name the fields that failed:
HTTP/1.1 400 Bad Request
{"error": "Please correct the highlighted fields.", "fields": ["contact_name", "login"]}| Status | Typical message | Meaning |
|---|---|---|
| 400 | invalid request, or a field message | The body is not valid JSON, has an unknown field, or a value failed validation |
| 401 | invalid API key | Wrong, expired or deleted key, address not allowed, or account inactive |
| 403 | This page is for the server administrator. | A reseller or customer key called an endpoint outside its account |
| 403 | Your hosting plan does not allow this. Ask your provider to enable it. | The subscription's plan lacks the permission for this change |
| 403 | Restricted mode does not allow this change. | The key's administrator is a restricted administrator and the change is in a blocked group |
| 403 | API keys cannot manage logins. | Reseller and customer keys cannot log in as others, change passwords or manage keys |
| 403 | The panel's licence is not in order: ... | The license is restricted; the body also has "license": "restricted" |
| 404 | unknown API endpoint, not found | No such path for this method, or no such object (also for objects of another account) |
| 409 | for example The backup is still being created. | The object is in a state that does not allow the call yet |
| 429 | Too many failed attempts. Try again in 15 minutes. | Sign-in attempts only (POST /api/auth/login) |
While the license is restricted, administrator keys can still read and set the license (GET and PUT /api/license, POST /api/license/check) and nothing else. Reseller and customer keys keep working, though nothing new can be created until the license is in order. Websites, mail and DNS are never affected.
Rate limits#
API keys have no request quota, and authenticated calls are not counted. The only limit in the API is on failed sign-ins at the login endpoint. Be considerate anyway: run bulk jobs one call at a time and wait for each task before starting the next large one, because the task service runs two workers.
Pagination and search#
List endpoints for customers, subscriptions and domains take page (from 1) and size (1 to 1000, default 25), plus a search term q:
GET /api/clients?type=customer&q=example&page=2&size=100
GET /api/subscriptions?client=7&page=1&size=50
GET /api/domains?subscription=12They answer with one page and the total count:
{"items": [ ... ], "total": 214}GET /api/clients lists customers by default; add type=reseller for resellers and owner=ID for one reseller's customers. There q matches the contact name, company, login and email address. In GET /api/subscriptions, client=ID limits the list to one customer, and q matches the subscription name, the customer's name and the system user. The task list takes page and size up to 100.
OpenAPI description#
GET /api/openapi.json returns an OpenAPI 3.0 document of every endpoint with its parameters. It needs a key or a signed-in session, like any other call:
curl -s -H "Authorization: Bearer sr_..." https://panel.example.com:9443/api/openapi.json -o stackregent-openapi.jsonLoad it into an OpenAPI tool to browse the endpoints or generate a client. The panel has no built-in playground: use curl, your OpenAPI tool, or stackregent api on the server.
Endpoint reference#
The tables below list every route the panel registers, grouped by area. The columns say which kind of key may call it:
- Admin: an administrator's key. Restricted administrators are further limited by Restricted Mode Settings.
- Reseller: a reseller's key, limited to the reseller's own customers, plans, subscriptions and IP pool.
- Customer: a customer's key, limited to the customer's own subscriptions.
Where a reseller or customer call changes something, the subscription's plan must also allow it; the permission is named in brackets as it appears in the service plan. Parameters and fields are in the OpenAPI description. Placeholders such as {id} are numeric IDs.
Sign-in and health#
These answer without a key. The panel's own login page uses the auth endpoints; GET /api/health answers {"ok": true, "time": "..."} and suits an uptime monitor.
| Method | Path |
|---|---|
| POST | /api/auth/forgot |
| POST | /api/auth/login |
| POST | /api/auth/logout |
| POST | /api/auth/reset |
| GET | /api/auth/session |
| GET | /api/health |
Customers and resellers#
| Method | Path | Admin | Reseller | Customer |
|---|---|---|---|---|
| GET | /api/clients | yes | yes | no |
| POST | /api/clients | yes | yes | no |
| GET | /api/clients/{id} | yes | yes | no |
| PUT | /api/clients/{id} | yes | yes | no |
| DELETE | /api/clients/{id} | yes | yes | no |
| POST | /api/clients/{id}/convert | yes | no | no |
| POST | /api/clients/{id}/login-as | yes | no | no |
| POST | /api/clients/{id}/status | yes | yes | no |
| GET | /api/clients/{id}/users | yes | yes | no |
| POST | /api/clients/{id}/users | yes | no | no |
| PUT | /api/clients/{id}/users/{uid} | yes | no | no |
| DELETE | /api/clients/{id}/users/{uid} | yes | no | no |
| GET | /api/search | yes | no | no |
Service plans#
| Method | Path | Admin | Reseller | Customer |
|---|---|---|---|---|
| GET | /api/plan-schema | yes | yes | no |
| GET | /api/plans | yes | yes | no |
| POST | /api/plans | yes | yes | no |
| GET | /api/plans/{id} | yes | yes | no |
| PUT | /api/plans/{id} | yes | yes | no |
| DELETE | /api/plans/{id} | yes | yes | no |
| POST | /api/plans/{id}/clone | yes | yes | no |
Subscriptions#
| Method | Path | Admin | Reseller | Customer |
|---|---|---|---|---|
| GET | /api/subscriptions | yes | yes | no |
| POST | /api/subscriptions | yes | yes | no |
| GET | /api/subscriptions/{id} | yes | yes | yes |
| DELETE | /api/subscriptions/{id} | yes | yes | no |
| PUT | /api/subscriptions/{id}/description | yes | yes | yes |
| POST | /api/subscriptions/{id}/domains | yes | yes (changes need domain, subdomain or alias management) | yes (changes need domain, subdomain or alias management) |
| PUT | /api/subscriptions/{id}/plan | yes | yes | no |
| POST | /api/subscriptions/{id}/repair | yes | no | no |
| PUT | /api/subscriptions/{id}/settings | yes | no | no |
| POST | /api/subscriptions/{id}/status | yes | yes | no |
| PUT | /api/subscriptions/{id}/subscriber | yes | no | no |
| GET | /api/suggest/sysuser | yes | yes | no |
Websites and domains#
| Method | Path | Admin | Reseller | Customer |
|---|---|---|---|---|
| GET | /api/app-pools | yes | no | no |
| POST | /api/app-pools/{name}/{action} | yes | no | no |
| GET | /api/aspnet/defaults | yes | no | no |
| PUT | /api/aspnet/defaults | yes | no | no |
| GET | /api/domains | yes | yes | yes |
| DELETE | /api/domains/{id} | yes | yes (changes need domain, subdomain or alias management) | yes (changes need domain, subdomain or alias management) |
| GET | /api/php | yes | yes | yes |
| PUT | /api/php/{ver}/enabled | yes | no | no |
| GET | /api/php/{ver}/ini | yes | no | no |
| PUT | /api/php/{ver}/ini | yes | no | no |
| GET | /api/preview/settings | yes | no | no |
| PUT | /api/preview/settings | yes | no | no |
| GET | /api/vhost-template | yes | no | no |
| POST | /api/vhost-template | yes | no | no |
| DELETE | /api/vhost-template | yes | no | no |
| GET | /api/vhost-template/download | yes | no | no |
| PUT | /api/webdeploy/settings | yes | no | no |
| GET | /api/website-schema | yes | yes | yes |
| GET | /api/websites/{id} | yes | yes | yes |
| POST | /api/websites/{id}/apply | yes | yes (changes need Hosting settings management) | yes (changes need Hosting settings management) |
| GET | /api/websites/{id}/connection | yes | yes | yes |
| PUT | /api/websites/{id}/docroot | yes | yes (changes need Hosting settings management) | yes (changes need Hosting settings management) |
| GET | /api/websites/{id}/phpinfo | yes | yes | yes |
| GET | /api/websites/{id}/protected | yes | yes (changes need Hosting settings management) | yes (changes need Hosting settings management) |
| POST | /api/websites/{id}/protected | yes | yes (changes need Hosting settings management) | yes (changes need Hosting settings management) |
| DELETE | /api/websites/{id}/protected-users/{uid} | yes | yes (changes need Hosting settings management) | yes (changes need Hosting settings management) |
| PUT | /api/websites/{id}/protected/{pid} | yes | yes (changes need Hosting settings management) | yes (changes need Hosting settings management) |
| DELETE | /api/websites/{id}/protected/{pid} | yes | yes (changes need Hosting settings management) | yes (changes need Hosting settings management) |
| POST | /api/websites/{id}/protected/{pid}/users | yes | yes (changes need Hosting settings management) | yes (changes need Hosting settings management) |
| POST | /api/websites/{id}/reset | yes | yes | yes |
| PUT | /api/websites/{id}/settings | yes | yes | yes |
| GET | /api/websites/{id}/vdirs | yes | yes (changes need Hosting settings management) | yes (changes need Hosting settings management) |
| POST | /api/websites/{id}/vdirs | yes | yes (changes need Hosting settings management) | yes (changes need Hosting settings management) |
| PUT | /api/websites/{id}/vdirs/{vid} | yes | yes (changes need Hosting settings management) | yes (changes need Hosting settings management) |
| DELETE | /api/websites/{id}/vdirs/{vid} | yes | yes (changes need Hosting settings management) | yes (changes need Hosting settings management) |
| GET | /api/websites/{id}/waf | yes | yes (changes need Hosting settings management) | yes (changes need Hosting settings management) |
| PUT | /api/websites/{id}/waf | yes | yes (changes need Hosting settings management) | yes (changes need Hosting settings management) |
| GET | /api/websites/{id}/webdeploy | yes | yes (needs Web Deploy publishing) | yes (needs Web Deploy publishing) |
| GET | /api/websites/{id}/webdeploy/publishsettings | yes | yes (needs Web Deploy publishing) | yes (needs Web Deploy publishing) |
| GET | /api/websites/{id}/webusers | yes | yes (changes need Web users management) | yes (changes need Web users management) |
| POST | /api/websites/{id}/webusers | yes | yes (changes need Web users management) | yes (changes need Web users management) |
| PUT | /api/websites/{id}/webusers/{uid} | yes | yes (changes need Web users management) | yes (changes need Web users management) |
| DELETE | /api/websites/{id}/webusers/{uid} | yes | yes (changes need Web users management) | yes (changes need Web users management) |
SSL/TLS certificates#
| Method | Path | Admin | Reseller | Customer |
|---|---|---|---|---|
| GET | /api/certs | yes | yes | yes |
| POST | /api/certs/csr | yes | yes (changes need Hosting settings management) | yes (changes need Hosting settings management) |
| POST | /api/certs/selfsigned | yes | yes (changes need Hosting settings management) | yes (changes need Hosting settings management) |
| POST | /api/certs/upload | yes | yes (changes need Hosting settings management) | yes (changes need Hosting settings management) |
| DELETE | /api/certs/{cid} | yes | yes (changes need Hosting settings management) | yes (changes need Hosting settings management) |
| PUT | /api/certs/{cid}/autorenew | yes | yes (changes need Hosting settings management) | yes (changes need Hosting settings management) |
| GET | /api/certs/{cid}/download | yes | yes (changes need Hosting settings management) | yes (changes need Hosting settings management) |
| POST | /api/certs/{cid}/upload | yes | yes (changes need Hosting settings management) | yes (changes need Hosting settings management) |
| GET | /api/panel-cert | yes | no | no |
| PUT | /api/panel-cert | yes | no | no |
| POST | /api/panel-cert/letsencrypt | yes | no | no |
| GET | /api/service-certs | yes | no | no |
| PUT | /api/service-certs | yes | no | no |
| GET | /api/ssl/settings | yes | no | no |
| PUT | /api/ssl/settings | yes | no | no |
| GET | /api/websites/{id}/ssl | yes | yes (changes need Hosting settings management) | yes (changes need Hosting settings management) |
| PUT | /api/websites/{id}/ssl | yes | yes (changes need Hosting settings management) | yes (changes need Hosting settings management) |
| POST | /api/websites/{id}/ssl/letsencrypt | yes | yes (changes need Hosting settings management) | yes (changes need Hosting settings management) |
DNS#
| Method | Path | Admin | Reseller | Customer |
|---|---|---|---|---|
| POST | /api/dns/apply-template | yes | no | no |
| PUT | /api/dns/server | yes | no | no |
| GET | /api/dns/settings | yes | no | no |
| PUT | /api/dns/soa | yes | no | no |
| PUT | /api/dns/subzones | yes | no | no |
| POST | /api/dns/sync-all | yes | no | no |
| PUT | /api/dns/template | yes | no | no |
| PUT | /api/dns/xfr | yes | no | no |
| PUT | /api/dns/zones/{zid}/mode | yes | yes (changes need DNS zone management) | yes (changes need DNS zone management) |
| POST | /api/dns/zones/{zid}/records | yes | yes (changes need DNS zone management) | yes (changes need DNS zone management) |
| POST | /api/dns/zones/{zid}/records/delete | yes | yes (changes need DNS zone management) | yes (changes need DNS zone management) |
| PUT | /api/dns/zones/{zid}/records/{rid} | yes | yes (changes need DNS zone management) | yes (changes need DNS zone management) |
| POST | /api/dns/zones/{zid}/reset | yes | yes (changes need DNS zone management) | yes (changes need DNS zone management) |
| PUT | /api/dns/zones/{zid}/soa | yes | yes (changes need DNS zone management) | yes (changes need DNS zone management) |
| GET | /api/websites/{id}/dns | yes | yes | yes |
| POST | /api/websites/{id}/dns/enable | yes | yes (changes need DNS zone management) | yes (changes need DNS zone management) |
File Manager#
| Method | Path | Admin | Reseller | Customer |
|---|---|---|---|---|
| GET | /api/subscriptions/{id}/files | yes | yes | yes |
| GET | /api/subscriptions/{id}/files/acl | yes | yes | yes |
| PUT | /api/subscriptions/{id}/files/acl | yes | yes | yes |
| POST | /api/subscriptions/{id}/files/create | yes | yes | yes |
| GET | /api/subscriptions/{id}/files/download | yes | yes | yes |
| POST | /api/subscriptions/{id}/files/extract | yes | yes | yes |
| POST | /api/subscriptions/{id}/files/remove | yes | yes | yes |
| POST | /api/subscriptions/{id}/files/rename | yes | yes | yes |
| GET | /api/subscriptions/{id}/files/search | yes | yes | yes |
| GET | /api/subscriptions/{id}/files/size | yes | yes | yes |
| GET | /api/subscriptions/{id}/files/text | yes | yes | yes |
| PUT | /api/subscriptions/{id}/files/text | yes | yes | yes |
| POST | /api/subscriptions/{id}/files/transfer | yes | yes | yes |
| POST | /api/subscriptions/{id}/files/upload | yes | yes | yes |
| POST | /api/subscriptions/{id}/files/zip | yes | yes | yes |
FTP and the system user#
| Method | Path | Admin | Reseller | Customer |
|---|---|---|---|---|
| GET | /api/ftp/sessions | yes | no | no |
| POST | /api/ftp/sessions/{sid}/close | yes | no | no |
| GET | /api/ftp/settings | yes | no | no |
| PUT | /api/ftp/settings | yes | no | no |
| PUT | /api/subscriptions/{id}/anon-ftp | yes | yes (changes need Anonymous FTP management) | yes (changes need Anonymous FTP management) |
| GET | /api/subscriptions/{id}/ftp | yes | yes | yes |
| POST | /api/subscriptions/{id}/ftp | yes | yes (changes need Additional FTP accounts management) | yes (changes need Additional FTP accounts management) |
| PUT | /api/subscriptions/{id}/ftp/{fid} | yes | yes (changes need Additional FTP accounts management) | yes (changes need Additional FTP accounts management) |
| DELETE | /api/subscriptions/{id}/ftp/{fid} | yes | yes (changes need Additional FTP accounts management) | yes (changes need Additional FTP accounts management) |
| POST | /api/subscriptions/{id}/password | yes | yes | yes |
Databases and ODBC#
| Method | Path | Admin | Reseller | Customer |
|---|---|---|---|---|
| GET | /api/db-prefs | yes | no | no |
| PUT | /api/db-prefs | yes | no | no |
| GET | /api/db-servers | yes | no | no |
| POST | /api/db-servers | yes | no | no |
| PUT | /api/db-servers/{sid} | yes | no | no |
| DELETE | /api/db-servers/{sid} | yes | no | no |
| POST | /api/db-servers/{sid}/default | yes | no | no |
| PUT | /api/db-servers/{sid}/firewall | yes | no | no |
| GET | /api/db-servers/{sid}/processes | yes | no | no |
| POST | /api/db-servers/{sid}/processes/{pid}/kill | yes | no | no |
| PUT | /api/db-servers/{sid}/visibility | yes | no | no |
| GET | /api/odbc | yes | no | no |
| POST | /api/odbc | yes | no | no |
| PUT | /api/odbc/{did} | yes | no | no |
| DELETE | /api/odbc/{did} | yes | no | no |
| POST | /api/odbc/{did}/test | yes | no | no |
| GET | /api/subscriptions/{id}/databases | yes | yes (changes need Databases management) | yes (changes need Databases management) |
| POST | /api/subscriptions/{id}/databases | yes | yes (changes need Databases management) | yes (changes need Databases management) |
| POST | /api/subscriptions/{id}/databases/sizes | yes | yes (changes need Databases management) | yes (changes need Databases management) |
| DELETE | /api/subscriptions/{id}/databases/{dbid} | yes | yes (changes need Databases management) | yes (changes need Databases management) |
| POST | /api/subscriptions/{id}/databases/{dbid}/job | yes | yes (changes need Databases management) | yes (changes need Databases management) |
| POST | /api/subscriptions/{id}/databases/{dbid}/phpmyadmin | yes | yes (changes need Databases management) | yes (changes need Databases management) |
| POST | /api/subscriptions/{id}/databases/{dbid}/query | yes | yes (changes need Databases management) | yes (changes need Databases management) |
| GET | /api/subscriptions/{id}/databases/{dbid}/tables | yes | yes (changes need Databases management) | yes (changes need Databases management) |
| POST | /api/subscriptions/{id}/db-users | yes | yes (changes need Databases management) | yes (changes need Databases management) |
| PUT | /api/subscriptions/{id}/db-users/{uid} | yes | yes (changes need Databases management) | yes (changes need Databases management) |
| DELETE | /api/subscriptions/{id}/db-users/{uid} | yes | yes (changes need Databases management) | yes (changes need Databases management) |
| GET | /api/subscriptions/{id}/odbc | yes | yes | yes |
| POST | /api/subscriptions/{id}/odbc | yes | yes (changes need ODBC DSN management) | yes (changes need ODBC DSN management) |
| PUT | /api/subscriptions/{id}/odbc/{did} | yes | yes (changes need ODBC DSN management) | yes (changes need ODBC DSN management) |
| DELETE | /api/subscriptions/{id}/odbc/{did} | yes | yes (changes need ODBC DSN management) | yes (changes need ODBC DSN management) |
| POST | /api/subscriptions/{id}/odbc/{did}/test | yes | yes (changes need ODBC DSN management) | yes (changes need ODBC DSN management) |
Mail#
| Method | Path | Admin | Reseller | Customer |
|---|---|---|---|---|
| GET | /api/antivirus | yes | no | no |
| PUT | /api/antivirus | yes | no | no |
| POST | /api/antivirus/mailbox | yes | no | no |
| POST | /api/antivirus/update | yes | no | no |
| POST | /api/mail/apply | yes | no | no |
| POST | /api/mail/delivery-check | yes | no | no |
| POST | /api/mail/mass | yes | no | no |
| GET | /api/mail/mass-templates | yes | no | no |
| PUT | /api/mail/mass-templates | yes | no | no |
| GET | /api/mail/outgoing | yes | no | no |
| GET | /api/mail/settings | yes | no | no |
| PUT | /api/mail/settings | yes | no | no |
| POST | /api/mail/test | yes | no | no |
| GET | /api/subscriptions/{id}/mail | yes | yes | yes |
| POST | /api/subscriptions/{id}/mail/accounts | yes | yes (changes need Mail accounts management) | yes (changes need Mail accounts management) |
| PUT | /api/subscriptions/{id}/mail/accounts/{aid} | yes | yes (changes need Mail accounts management) | yes (changes need Mail accounts management) |
| DELETE | /api/subscriptions/{id}/mail/accounts/{aid} | yes | yes (changes need Mail accounts management) | yes (changes need Mail accounts management) |
| GET | /api/subscriptions/{id}/mail/accounts/{aid}/mobileconfig | yes | yes (changes need Mail accounts management) | yes (changes need Mail accounts management) |
| GET | /api/subscriptions/{id}/mail/accounts/{aid}/spam | yes | yes (changes need Mail accounts management) | yes (changes need Mail accounts management) |
| PUT | /api/subscriptions/{id}/mail/accounts/{aid}/spam | yes | yes (changes need Mail accounts management) | yes (changes need Mail accounts management) |
| PUT | /api/subscriptions/{id}/mail/domains/{did} | yes | yes (changes need Mail accounts management) | yes (changes need Mail accounts management) |
| POST | /api/subscriptions/{id}/mail/domains/{did}/sync | yes | yes (changes need Mail accounts management) | yes (changes need Mail accounts management) |
| POST | /api/subscriptions/{id}/mail/lists | yes | yes (changes need Mailing lists management) | yes (changes need Mailing lists management) |
| PUT | /api/subscriptions/{id}/mail/lists/{lid} | yes | yes (changes need Mailing lists management) | yes (changes need Mailing lists management) |
| DELETE | /api/subscriptions/{id}/mail/lists/{lid} | yes | yes (changes need Mailing lists management) | yes (changes need Mailing lists management) |
| GET | /api/subscriptions/{id}/mail/outgoing | yes | yes (changes need Mail accounts management) | yes (changes need Mail accounts management) |
| POST | /api/subscriptions/{id}/mail/sizes | yes | yes | yes |
Applications, WordPress, Laravel and Git#
| Method | Path | Admin | Reseller | Customer |
|---|---|---|---|---|
| GET | /api/apps | yes | yes | yes |
| GET | /api/apps/catalog | yes | yes | yes |
| POST | /api/apps/install | yes | yes | yes |
| GET | /api/apps/{id} | yes | yes | yes |
| POST | /api/apps/{id}/backup | yes | yes | yes |
| DELETE | /api/apps/{id}/backups/{name} | yes | yes | yes |
| POST | /api/apps/{id}/detach | yes | yes | yes |
| POST | /api/apps/{id}/refresh | yes | yes | yes |
| POST | /api/apps/{id}/remove | yes | yes | yes |
| POST | /api/apps/{id}/restore | yes | yes | yes |
| POST | /api/apps/{id}/update | yes | yes | yes |
| PUT | /api/git/{id} | yes | yes (changes need Git management) | yes (changes need Git management) |
| DELETE | /api/git/{id} | yes | yes (changes need Git management) | yes (changes need Git management) |
| POST | /api/git/{id}/deploy | yes | yes (changes need Git management) | yes (changes need Git management) |
| GET | /api/git/{id}/history | yes | yes (changes need Git management) | yes (changes need Git management) |
| POST | /api/git/{id}/pull | yes | yes (changes need Git management) | yes (changes need Git management) |
| POST | /api/laravel/{id}/artisan | yes | yes (changes need Laravel Toolkit) | yes (changes need Laravel Toolkit) |
| GET | /api/laravel/{id}/env | yes | yes (changes need Laravel Toolkit) | yes (changes need Laravel Toolkit) |
| PUT | /api/laravel/{id}/env | yes | yes (changes need Laravel Toolkit) | yes (changes need Laravel Toolkit) |
| POST | /api/laravel/{id}/refresh | yes | yes (changes need Laravel Toolkit) | yes (changes need Laravel Toolkit) |
| PUT | /api/laravel/{id}/switch | yes | yes (changes need Laravel Toolkit) | yes (changes need Laravel Toolkit) |
| GET | /api/websites/{id}/composer | yes | yes | yes |
| POST | /api/websites/{id}/composer/run | yes | yes | yes |
| PUT | /api/websites/{id}/composer/settings | yes | yes | yes |
| GET | /api/websites/{id}/git | yes | yes (changes need Git management) | yes (changes need Git management) |
| POST | /api/websites/{id}/git | yes | yes (changes need Git management) | yes (changes need Git management) |
| POST | /api/websites/{id}/laravel/install | yes | yes (changes need Laravel Toolkit) | yes (changes need Laravel Toolkit) |
| POST | /api/websites/{id}/laravel/scan | yes | yes (changes need Laravel Toolkit) | yes (changes need Laravel Toolkit) |
| POST | /api/wordpress/install | yes | yes (changes need WordPress Toolkit) | yes (changes need WordPress Toolkit) |
| POST | /api/wordpress/scan | yes | yes (changes need WordPress Toolkit) | yes (changes need WordPress Toolkit) |
| GET | /api/wordpress/search | yes | yes | yes |
| POST | /api/wordpress/{id}/clone | yes | yes (changes need WordPress Toolkit) | yes (changes need WordPress Toolkit) |
| POST | /api/wordpress/{id}/items | yes | yes (changes need WordPress Toolkit) | yes (changes need WordPress Toolkit) |
| POST | /api/wordpress/{id}/login | yes | yes (changes need WordPress Toolkit) | yes (changes need WordPress Toolkit) |
| POST | /api/wordpress/{id}/password | yes | yes (changes need WordPress Toolkit) | yes (changes need WordPress Toolkit) |
| PUT | /api/wordpress/{id}/policy | yes | yes (changes need WordPress Toolkit) | yes (changes need WordPress Toolkit) |
| POST | /api/wordpress/{id}/salts | yes | yes (changes need WordPress Toolkit) | yes (changes need WordPress Toolkit) |
| PUT | /api/wordpress/{id}/security | yes | yes (changes need WordPress Toolkit) | yes (changes need WordPress Toolkit) |
| PUT | /api/wordpress/{id}/switch | yes | yes (changes need WordPress Toolkit) | yes (changes need WordPress Toolkit) |
| POST | /api/wordpress/{id}/sync | yes | yes (changes need WordPress Toolkit) | yes (changes need WordPress Toolkit) |
| POST | /api/wordpress/{id}/update | yes | yes (changes need WordPress Toolkit) | yes (changes need WordPress Toolkit) |
Scheduled tasks#
| Method | Path | Admin | Reseller | Customer |
|---|---|---|---|---|
| GET | /api/cron | yes | yes | yes |
| POST | /api/cron | yes | yes (changes need Scheduled tasks management) | yes (changes need Scheduled tasks management) |
| POST | /api/cron/preview | yes | yes | yes |
| PUT | /api/cron/{id} | yes | yes (changes need Scheduled tasks management) | yes (changes need Scheduled tasks management) |
| DELETE | /api/cron/{id} | yes | yes (changes need Scheduled tasks management) | yes (changes need Scheduled tasks management) |
| PUT | /api/cron/{id}/enabled | yes | yes (changes need Scheduled tasks management) | yes (changes need Scheduled tasks management) |
| POST | /api/cron/{id}/run | yes | yes (changes need Scheduled tasks management) | yes (changes need Scheduled tasks management) |
| GET | /api/cron/{id}/runs | yes | yes (changes need Scheduled tasks management) | yes (changes need Scheduled tasks management) |
Backups, transfer and migration#
| Method | Path | Admin | Reseller | Customer |
|---|---|---|---|---|
| GET | /api/backups | yes | yes | yes |
| POST | /api/backups | yes | yes (changes need a backup permission) | yes (changes need a backup permission) |
| POST | /api/backups/import | yes | no | no |
| POST | /api/backups/links | yes | no | no |
| GET | /api/backups/remote | yes | yes | yes |
| PUT | /api/backups/remote | yes | yes (changes need remote backup storage permission) | yes (changes need remote backup storage permission) |
| GET | /api/backups/schedule | yes | yes | yes |
| PUT | /api/backups/schedule | yes | yes (changes need a backup permission) | yes (changes need a backup permission) |
| POST | /api/backups/upload | yes | no | no |
| DELETE | /api/backups/{id} | yes | yes (changes need a backup permission) | yes (changes need a backup permission) |
| GET | /api/backups/{id}/contents | yes | yes (changes need a backup permission) | yes (changes need a backup permission) |
| GET | /api/backups/{id}/download | yes | yes (changes need a backup permission) | yes (changes need a backup permission) |
| POST | /api/backups/{id}/export-plesk | yes | yes (changes need a backup permission) | yes (changes need a backup permission) |
| POST | /api/backups/{id}/restore | yes | yes (changes need a backup permission) | yes (changes need a backup permission) |
| POST | /api/migration/exports | yes | no | no |
| GET | /api/migration/exports/{id} | yes | no | no |
| DELETE | /api/migration/exports/{id} | yes | no | no |
| GET | /api/migration/exports/{id}/file | yes | no | no |
| GET | /api/migration/inventory | yes | no | no |
| GET | /api/migrations | yes | no | no |
| POST | /api/migrations | yes | no | no |
| GET | /api/migrations/{id} | yes | no | no |
| DELETE | /api/migrations/{id} | yes | no | no |
| POST | /api/migrations/{id}/refresh | yes | no | no |
| POST | /api/migrations/{id}/start | yes | no | no |
| POST | /api/websites/{id}/copy | yes | yes (changes need Hosting settings management) | yes (changes need Hosting settings management) |
| POST | /api/websites/{id}/import | yes | yes (changes need Hosting settings management) | yes (changes need Hosting settings management) |
Statistics, monitoring and diagnostics#
| Method | Path | Admin | Reseller | Customer |
|---|---|---|---|---|
| GET | /api/advisor | yes | no | no |
| POST | /api/advisor/fix/{id} | yes | no | no |
| GET | /api/dashboard | yes | no | no |
| GET | /api/diagnose | yes | no | no |
| POST | /api/diagnose | yes | no | no |
| POST | /api/diagnose/repair | yes | no | no |
| GET | /api/isolation | yes | no | no |
| POST | /api/isolation/{id}/check | yes | no | no |
| GET | /api/metrics | yes | no | no |
| GET | /api/monitoring | yes | no | no |
| GET | /api/monitoring/alerts | yes | no | no |
| PUT | /api/monitoring/alerts | yes | no | no |
| POST | /api/monitoring/alerts/test | yes | no | no |
| GET | /api/monitoring/series | yes | no | no |
| PUT | /api/pagespeed/key | yes | no | no |
| GET | /api/processes | yes | no | no |
| POST | /api/processes/{pid}/kill | yes | no | no |
| GET | /api/resources | yes | no | no |
| PUT | /api/resources/settings | yes | no | no |
| GET | /api/statistics | yes | no | no |
| POST | /api/statistics/refresh | yes | no | no |
| GET | /api/statistics/settings | yes | no | no |
| PUT | /api/statistics/settings | yes | no | no |
| GET | /api/statistics/traffic | yes | no | no |
| GET | /api/subscriptions/{id}/processes | yes | yes | yes |
| POST | /api/subscriptions/{id}/processes/{pid}/kill | yes | yes | yes |
| GET | /api/subscriptions/{id}/resources | yes | yes | yes |
| PUT | /api/subscriptions/{id}/resources | yes | no | no |
| GET | /api/subscriptions/{id}/statistics | yes | yes | yes |
| POST | /api/subscriptions/{id}/statistics/refresh | yes | yes | yes |
| GET | /api/websites/{id}/logs | yes | yes (changes need Log rotation management) | yes (changes need Log rotation management) |
| DELETE | /api/websites/{id}/logs | yes | yes (changes need Log rotation management) | yes (changes need Log rotation management) |
| GET | /api/websites/{id}/logs/download | yes | yes (changes need Log rotation management) | yes (changes need Log rotation management) |
| GET | /api/websites/{id}/logs/view | yes | yes (changes need Log rotation management) | yes (changes need Log rotation management) |
| GET | /api/websites/{id}/pagespeed | yes | yes | yes |
| POST | /api/websites/{id}/pagespeed | yes | yes | yes |
| GET | /api/websites/{id}/traces | yes | yes | yes |
| DELETE | /api/websites/{id}/traces | yes | yes | yes |
| GET | /api/websites/{id}/traces/zip | yes | yes | yes |
| GET | /api/websites/{id}/webstats | yes | yes | yes |
Tasks and the action log#
| Method | Path | Admin | Reseller | Customer |
|---|---|---|---|---|
| GET | /api/action-log | yes | no | no |
| DELETE | /api/action-log | yes | no | no |
| GET | /api/action-log/export | yes | no | no |
| GET | /api/action-log/settings | yes | no | no |
| PUT | /api/action-log/settings | yes | no | no |
| GET | /api/tasks | yes | no | no |
| GET | /api/tasks/{id} | yes | yes | yes |
| POST | /api/tasks/{id}/retry | yes | no | no |
Security#
| Method | Path | Admin | Reseller | Customer |
|---|---|---|---|---|
| GET | /api/prohibited | yes | no | no |
| POST | /api/prohibited | yes | no | no |
| PUT | /api/prohibited/settings | yes | no | no |
| DELETE | /api/prohibited/{name} | yes | no | no |
| GET | /api/restricted-mode | yes | no | no |
| PUT | /api/restricted-mode | yes | no | no |
| GET | /api/security/firewall | yes | no | no |
| PUT | /api/security/firewall | yes | no | no |
| POST | /api/security/firewall/confirm | yes | no | no |
| POST | /api/security/firewall/reset | yes | no | no |
| GET | /api/security/firewall/state | yes | no | no |
| GET | /api/security/firewall/status | yes | no | no |
| GET | /api/security/guard | yes | no | no |
| PUT | /api/security/guard | yes | no | no |
| POST | /api/security/guard/bans | yes | no | no |
| DELETE | /api/security/guard/bans/{ip} | yes | no | no |
| GET | /api/security/guard/log | yes | no | no |
| GET | /api/security/ip-access | yes | no | no |
| PUT | /api/security/ip-access | yes | no | no |
| GET | /api/security/policy | yes | no | no |
| PUT | /api/security/policy | yes | no | no |
| GET | /api/security/rdp | yes | no | no |
| POST | /api/security/rdp/{sid}/{action} | yes | no | no |
| GET | /api/security/session-settings | yes | no | no |
| PUT | /api/security/session-settings | yes | no | no |
| GET | /api/security/sessions | yes | no | no |
| DELETE | /api/security/sessions/{sid} | yes | no | no |
| GET | /api/security/waf | yes | no | no |
| PUT | /api/security/waf | yes | no | no |
| POST | /api/security/waf/update-rules | yes | no | no |
Administrators, profile and API keys#
| Method | Path | Admin | Reseller | Customer |
|---|---|---|---|---|
| GET | /api/admins | yes | no | no |
| POST | /api/admins | yes | no | no |
| PUT | /api/admins/{id} | yes | no | no |
| DELETE | /api/admins/{id} | yes | no | no |
| GET | /api/api-keys | yes | no | no |
| POST | /api/api-keys | yes | no | no |
| DELETE | /api/api-keys/{id} | yes | no | no |
| GET | /api/profile | yes | no | no |
| PUT | /api/profile | yes | no | no |
| POST | /api/profile/2fa/disable | yes | no | no |
| POST | /api/profile/2fa/enable | yes | no | no |
| POST | /api/profile/2fa/setup | yes | no | no |
| POST | /api/profile/password | yes | no | no |
| POST | /api/profile/password/check | yes | no | no |
| PUT | /api/profile/theme | yes | no | no |
Server management#
| Method | Path | Admin | Reseller | Customer |
|---|---|---|---|---|
| GET | /api/about | yes | no | no |
| GET | /api/components | yes | no | no |
| POST | /api/components/refresh | yes | no | no |
| POST | /api/components/{cid}/{action} | yes | no | no |
| GET | /api/events | yes | no | no |
| POST | /api/events | yes | no | no |
| PUT | /api/events/{id} | yes | no | no |
| DELETE | /api/events/{id} | yes | no | no |
| GET | /api/extensions | yes | no | no |
| GET | /api/ips | yes | yes | no |
| POST | /api/ips/reread | yes | no | no |
| PUT | /api/ips/{id} | yes | no | no |
| DELETE | /api/ips/{id} | yes | no | no |
| GET | /api/license | yes | no | no |
| PUT | /api/license | yes | no | no |
| POST | /api/license/check | yes | no | no |
| GET | /api/notices | yes | no | no |
| POST | /api/notices/read | yes | no | no |
| GET | /api/notifications | yes | no | no |
| PUT | /api/notifications | yes | no | no |
| GET | /api/openapi.json | yes | no | no |
| GET | /api/power | yes | no | no |
| POST | /api/power | yes | no | no |
| DELETE | /api/power | yes | no | no |
| GET | /api/server-settings | yes | no | no |
| PUT | /api/server-settings | yes | no | no |
| PUT | /api/server/hostname | yes | no | no |
| GET | /api/server/info | yes | no | no |
| GET | /api/services | yes | no | no |
| PUT | /api/services/{name}/startup | yes | no | no |
| POST | /api/services/{name}/{action} | yes | no | no |
| GET | /api/system-time | yes | no | no |
| PUT | /api/system-time | yes | no | no |
| GET | /api/updates | yes | no | no |
| POST | /api/updates/check | yes | no | no |
| POST | /api/updates/install | yes | no | no |
| PUT | /api/updates/settings | yes | no | no |
Branding, languages and interface#
| Method | Path | Admin | Reseller | Customer |
|---|---|---|---|---|
| GET | /api/branding | yes | no | no |
| PUT | /api/branding | yes | yes | no |
| POST | /api/branding/{kind} | yes | yes | no |
| GET | /api/buttons | yes | yes | yes |
| POST | /api/buttons | yes | no | no |
| PUT | /api/buttons/{id} | yes | no | no |
| DELETE | /api/buttons/{id} | yes | no | no |
| GET | /api/interface | yes | yes | yes |
| PUT | /api/interface | yes | no | no |
| GET | /api/languages | yes | no | no |
| POST | /api/languages | yes | no | no |
| PUT | /api/languages | yes | no | no |
| GET | /api/languages/{code} | yes | no | no |
| DELETE | /api/languages/{code} | yes | no | no |
Reseller and customer account (/api/my)#
These answer for reseller and customer keys only. The rows marked no in every column (key management, password changes, logging in as a customer and returning from it) work only in a signed-in panel session, never with a key.
| Method | Path | Admin | Reseller | Customer |
|---|---|---|---|---|
| GET | /api/my/account | no | yes | yes |
| GET | /api/my/api-keys | no | no | no |
| POST | /api/my/api-keys | no | no | no |
| DELETE | /api/my/api-keys/{id} | no | no | no |
| POST | /api/my/back | no | no | no |
| GET | /api/my/customers | no | yes | no |
| POST | /api/my/customers/{id}/login-as | no | no | no |
| GET | /api/my/help | no | yes | yes |
| GET | /api/my/help/articles/{role}/{slug} | no | yes | yes |
| GET | /api/my/mailbox | no | yes | yes |
| PUT | /api/my/mailbox | no | yes | yes |
| GET | /api/my/overview | no | yes | yes |
| POST | /api/my/password | no | no | no |
| PUT | /api/my/profile | no | yes | yes |
| GET | /api/my/roles | no | yes | yes |
| POST | /api/my/roles | no | yes | yes |
| PUT | /api/my/roles/{id} | no | yes | yes |
| DELETE | /api/my/roles/{id} | no | yes | yes |
| GET | /api/my/subscriptions/{id}/settings | no | yes | yes |
| PUT | /api/my/subscriptions/{id}/settings | no | yes | yes |
| GET | /api/my/tasks | no | yes | yes |
| GET | /api/my/users | no | yes | yes |
| POST | /api/my/users | no | yes | yes |
| PUT | /api/my/users/{id} | no | yes | yes |
| DELETE | /api/my/users/{id} | no | yes | yes |
Related pages#
- API keys: who a key acts as and how to limit it
- Command line:
stackregent apicalls these endpoints on the server without a key of your own - Automation examples: complete scripts for provisioning, suspension and backups
Frequently asked questions
What is the base URL of the StackRegent API?
https://SERVER:9443/api/, where SERVER is your panel's host name or IP address and 9443 is the panel's HTTPS port. If you moved the panel to another port, the API is on that port too.
How do I authenticate to the StackRegent REST API?
Create an API key in the panel and send it as Authorization: Bearer sr_... or in an X-API-Key header. See API keys.
Why do I get 400 invalid request on a POST that looks right?
The panel refuses JSON with fields it does not know or values of the wrong type, for example a number sent as a string. Compare your field names and types with /api/openapi.json.
How do I know when a subscription is ready after creating it?
The create call returns a task_id. Poll GET /api/tasks/{id} until status is success or failure; the log field explains any failure.
Does the API have rate limits?
No quota applies to calls made with an API key. Only failed sign-ins on the login endpoint are limited.
Can I download the OpenAPI specification?
Yes. GET /api/openapi.json with your key returns an OpenAPI 3.0 description of every endpoint, which you can load into an OpenAPI tool or a client generator.
Which endpoints can a customer key call?
Only endpoints about the customer's own subscriptions, websites, mail, databases, files, applications, scheduled tasks and backups, as marked in the Customer column above. Changes also need the matching permission in the subscription's plan.