<developers/>
StackRegent developers

StackRegent API and automation for Windows hosting servers

Every action in the StackRegent panel is a REST call you can make from a billing system, a script or a scheduled job. This is where the API, the command line and the installer are documented.

Documents StackRegent 0.17.18. Synced from the StackRegent manual 29 min ago.

bash
$ curl -s -H "Authorization: Bearer $SR_KEY" \
    "https://panel.example.com:9443/api/clients?type=customer&q=example"
{
  "items": [ { "id": 42, "type": "customer" } ],
  "total": 1
}

What you can automate with the StackRegent API#

StackRegent's web interface is a single-page application that talks to the panel's own REST API. Nothing the interface does is hidden from scripts: the endpoints that the Customers, Subscriptions, Websites & Domains, Mail, Databases and Backup Manager pages call are open to an API key. If you can click it, you can script it.

Typical jobs on Windows hosting servers:

  • A billing system creates a customer and a subscription when an order is paid, suspends it when an invoice is overdue and removes it when the service is cancelled. There is no ready-made billing plugin; billing systems provision through the REST API, and the automation examples show every call such an integration needs.
  • A reseller's own portal lists their customers and subscriptions and changes plans.
  • A nightly job backs up selected subscriptions to remote storage and checks the result.
  • A deployment pipeline pulls a Git repository into a website, runs Composer and re-applies the site's IIS settings.
  • A monitoring script reads GET /api/health and the service list and raises an alert when something stops.

The tools on this site#

ToolWhere it runsWhat it is for
REST APIAny machine that can reach the panel over HTTPSCustomers, plans, subscriptions, websites, DNS, mail, databases, files, applications, backups, security and server settings
API keysCreated in the panel by an administrator, a reseller or a customerWho a script acts as, from which addresses, and for how long
Command lineOn the server, in an elevated promptstackregent.exe: calling the API locally, recovery (passwords, firewall, IP access, ports), licensing and tasks
Install scriptA Windows Server 2016, 2019, 2022 or 2025 machineOne-line and unattended installs, upgrades, components and ports
Release signaturesThe panel, the installer, or your own workstationHow every package is checked before it is installed, and how to check one yourself

How the StackRegent API is shaped#

The API lives on the panel itself at https://SERVER:9443/api/, on the same port as the interface. There is no separate API server to install or open in the firewall. Requests and answers are JSON. Long work, such as creating a subscription or taking a backup, is queued as a task: the call returns a task ID straight away and you follow the task until it reports success or failure.

Authentication is a key that starts with sr_, sent as a bearer token or in an X-API-Key header. Keys have no fine-grained scopes: a key acts exactly as the administrator, reseller or customer who created it. An administrator's key reaches the whole server, a reseller's key reaches that reseller's customers and plans, and a customer's key reaches only that customer's own subscriptions. Each key can be limited to IP addresses or networks and can expire after a number of days.

The panel also serves an OpenAPI 3 description of every endpoint at /api/openapi.json, which you can load into an OpenAPI tool or a client generator. The REST API reference on this site lists every endpoint by area and says which kind of key may call it.

Where to start#

Step 1: Read the basics#

Read REST API for the base URL, headers, error format, paging and tasks.

Step 2: Create a key#

Create a key as described in API keys, and limit it to the address of the machine that will use it.

Step 3: Make a read-only call#

Try GET /api/subscriptions with curl or Invoke-RestMethod and check that you get a list back.

Step 4: Adapt a script#

Copy a script from automation examples and change the plan, domain and addresses to yours.

On the server itself, stackregent api GET /api/subscriptions makes the same call without creating a key yourself; see command line.

The product guides are on docs.stackregent.com, including the administrator chapter on the REST API and command line, the reseller chapter on API keys and IP addresses, the installation guide and the release notes. For an overview of what the API is used for, see API and automation. Questions about scripting the panel are welcome in the community forum, and requests for new endpoints go to the feature ideas board.

Frequently asked questions

Does StackRegent have an API?

Yes. StackRegent has a REST API over HTTPS for the panel's actions, with an OpenAPI 3 description at /api/openapi.json. See the REST API page.

Is the API included in every plan?

Yes. Every StackRegent plan has every feature, the API included; plans differ only in the number of hosting accounts. See pricing.

Can resellers and customers use the API?

Yes, when their plan allows it. A reseller needs the reseller plan permission Use the REST API, and a customer needs Ability to use the REST API on one of their subscriptions. Their keys reach only their own accounts.

Is there a WHMCS module for StackRegent?

There is no ready-made billing-system plugin. Any billing system that can make HTTPS requests with a bearer token can create, suspend and remove customers and subscriptions through the API; the automation examples show the calls a provisioning module needs.

Is there an API playground in the panel?

No. The Remote API page shows example calls with your server address filled in and links the OpenAPI description, which you can load into an OpenAPI tool to browse and try the endpoints.

Does the API need its own port?

No. It is served by the panel on the panel's HTTPS port, 9443 by default. If you move the panel with stackregent panel-port, the API moves with it.