API overview
The UrbeStack API provides 374 operations across 286 paths in 23 groups, with 310 named data types. It accepts and returns JSON.
The web interface uses this same API, making every panel operation available programmatically. An OpenAPI 3 specification is available on every UrbeStack server at /usr/local/urbestack/openapi.json.
Base URL
On a new server, the API is reachable only from the server itself. Once an administrator opens the API to external requests, it is also reachable on the web interface’s port. The URLs below use the default ports, 8442 for panel.api_local_port and 8443 for panel.port. Run urbestack-setting-get --key panel.port to see which port your server uses for the web interface. Opening the API →
On the server http://127.0.0.1:8442/api Once opened https://your-server:8443/api
The example requests in this documentation use $API for the base URL and $TOKEN for the token. Set both once in your shell to run any example as copied.
API=https://your-server:8443/api TOKEN=ub_9f3c2a7e1b5d4082a6c1e7f0
Tokens and scopes
API requests are authenticated using a token in the Authorization: Bearer TOKEN header. You can create a token using urbestack-token-create at the shell or obtain one through POST /auth/login.
A token’s permissions are limited by both the user’s permissions and the scopes assigned to the token. Each documented operation specifies its required scope. The read scope is sufficient for GET requests.
curl "$API/domains" \ -H "Authorization: Bearer $TOKEN"
readdomainsdnscertificatesmaildatabasesfilesusersbackupssettingssecurityexportlicenseallErrors
Errors are returned with an HTTP status code and a descriptive message. Each operation documents its possible errors. You can also search for an error message to find the operations that return it.
HTTP/1.1 409 Conflict
Content-Type: application/json
{"error": "Domain 'example.com' already exists", "status": 409}