SBN Services API Usage
The SBN Services Dashboard exposes its actions as an HTTP API, so you can automate them from your own scripts and tools -- checking service state, starting and stopping services, reading and downloading logs, editing settings, creating instances, and more. You authenticate with an API token you create on the API Tokens tab, and each request is allowed only if the token holds the matching feature for the target service.
The API is served by the Dashboard itself, over HTTPS, on the Dashboard's own address and port (for example https://your-server:port). All paths below are relative to that address.
Authenticating with a token
Send your token as a Bearer token in the Authorization header on every request:
That is the only credential the API needs. Notes:
- Use HTTPS -- never send a token over plain HTTP.
- If the token is missing, malformed, expired, or disabled, the request is rejected. A bearer token is used exactly as presented; the API does not fall back to any other credential.
- If you restricted the token to specific source addresses, the request must come from one of them.
- A token can only reach the action API. It can never reach token management or the administrator-only Dashboard actions, whatever features it holds.
How access is checked
Every action maps to a feature (a capability) and, for per-service actions, a target service. A request succeeds only when the token holds that feature and the target service is included in the token's scope. If the feature or the service is out of scope, the request is refused. Requests that return a list of services return only the services the token is allowed to see.
The feature required for each action is listed in the reference below. Feature names and what they grant are described on the API Tokens page.
Endpoint reference
{id} in a path is a service identifier as returned by the catalog. Paths beginning /api/service/{id}/... act on one service; the token must include that service.
Catalog and status
| Method | Path | Feature | What it returns |
|---|---|---|---|
| GET | /version | catalog.read | The Dashboard version tag. |
| GET | /api/catalog | catalog.read | The category > service > instance tree with current state, limited to services you may see. |
| GET | /api/status | catalog.read | A flat map of service id > state, for polling. |
| GET | /api/versions | catalog.read | The installed file version of each service. |
| GET | /api/names/{id} | catalog.read | A service's custom display name. |
| GET | /api/settings/dashboard-name | catalog.read | The Dashboard's display name. |
| GET | /api/visibility | visibility.read | Which services and categories are hidden. |
| GET | /api/visibility/export | visibility.read | The visibility configuration as JSON. |
Service control
| Method | Path | Feature | Action |
|---|---|---|---|
| POST | /api/service/{id}/install | service.install | Install the service. |
| POST | /api/service/{id}/uninstall | service.uninstall | Uninstall the service. |
| POST | /api/service/{id}/start | service.start | Start the service. |
| POST | /api/service/{id}/stop | service.stop | Stop the service. |
| POST | /api/instance/create | service.install | Create a numbered instance (optionally install it). |
| DELETE | /api/instance/{id} | service.uninstall | Remove a created instance's files (must not be installed). |
| GET | /api/instance/creatable | service.install | The services that support new instances and the free instance numbers. |
Logs
| Method | Path | Feature | Action |
|---|---|---|---|
| GET | /api/service/{id}/log | logs.read | Read the current log (chunked tail). |
| GET | /api/service/{id}/log/info | logs.read | Current log file size and metadata. |
| GET | /api/service/{id}/log/files | logs.read | List historical log files, newest first. |
| GET | /api/service/{id}/log/file | logs.read | Read one named historical log file. |
| GET | /api/logs/status | logs.read | Whether live log streaming is available. |
| GET | /api/logs/stream | logs.read | Live log stream (Server-Sent Events) for one or more services via ?services=<id,id>. Add &levels=<info,warn,err> to receive only those levels; omitted, all levels are sent. |
| GET | /api/service/{id}/log/download | logs.download | Download a log file (current, or ?file= a historical one). |
| POST | /api/service/{id}/log/clear | logs.clear | Delete the service's log content. |
Files
| Method | Path | Feature | Action |
|---|---|---|---|
| GET | /api/service/{id}/browse/roots | files.read | The service's browsable output folders. |
| GET | /api/service/{id}/browse/list | files.read | List one folder. |
| GET | /api/service/{id}/browse/file | files.download | Download one file. |
Settings
| Method | Path | Feature | Action |
|---|---|---|---|
| GET | /api/service/{id}/settings | settings.read | Read the service's settings (passwords masked). |
| GET | /api/service/{id}/settings/plugins | settings.read | List plugin settings files (where applicable). |
| PUT | /api/service/{id}/settings | settings.write | Update the settings (merge by default; ?replace=true to replace). |
| POST | /api/service/{id}/settings/test-connection | settings.test | Test a data-server connection with the supplied values (no save). |
| POST | /api/service/{id}/settings/test-email | settings.test | Send a test e-mail with the supplied settings (no save). |
| POST | /api/service/{id}/settings/discover-crystal | settings.write | Locate the installed report runtime (Windows Report service). |
Display name
| Method | Path | Feature | Action |
|---|---|---|---|
| PUT | /api/names/{id} | names.write | Set a service's custom display name. |
| DELETE | /api/names/{id} | names.write | Clear a service's custom display name. |
Examples
The examples use curl; any HTTP client works the same way. Replace the host, port, and token.
Read the state of every service
Response:
Start a service
Response:
The start is issued immediately; poll /api/status to confirm the service reaches Running. The token must include the service.start feature and the frontend-1 service must be in its scope.
Stream live logs
The response is a Server-Sent Events stream that stays open. The first event reports the stream state, then one log event arrives per log line:
levels accepts any combination of info, warn and err; without it every level is sent. Lines starting with a colon (: keepalive) are comments emitted while the stream is idle and can be ignored. The token must include the logs.read feature for every requested service.
Errors
The API uses standard HTTP status codes:
- 200 -- the request succeeded.
- 401 -- no valid token was supplied (missing, malformed, expired, or disabled).
- 403 -- the token is valid but does not hold the required feature for the target service, or the action is administrator-only and never available to a token.
- 404 -- the service or resource in the path does not exist.
A refused request returns a short JSON body describing the reason; surface that message rather than a generic failure.
Related help
- API Tokens -- creating tokens, choosing features and services, rotating and revoking.
- The SBN Services Dashboard -- the same actions in the browser console.