API Reference
Anything you can do in the console is available over a JWT-authenticated REST API on port
8443. Responses follow a consistent envelope, and an interactive Swagger
explorer is built in.
Authentication#
Authenticate by posting credentials to api/auth/login. A successful call returns a
JWT bearer token with a 15-minute expiry. Send it as
Authorization: Bearer <token> on every subsequent request.
# POST api/auth/login
{ "username": "admin", "password": "<your-password>" }
The api/auth/login endpoint authenticates against both the Local
user store and a configured LDAP/Active Directory directory — the server
selects the provider and returns which one authenticated in the response. Configure directory
login and group-to-role mapping under api/settings/ldap; see
LDAP / Active Directory Integration. A third provider,
Keycloak (OIDC), is handled by a separate set of endpoints (below).
The auth endpoints also expose:
| Endpoint | Purpose |
|---|---|
POST api/auth/login | Exchange username + password for a JWT bearer token (Local or LDAP) |
GET api/auth/me | Return the current token's identity |
POST api/auth/change-password | Change the signed-in user's password |
POST api/auth/logout | End the current session |
Keycloak SSO (OIDC)#
When OIDC is enabled on the server, Athena supports Keycloak single sign-on. Browser clients use
the authorization-code + PKCE flow (login → callback); headless
clients such as the PowerShell module use the device-code grant and exchange the resulting
Keycloak access token at device-token, which returns the same JWT bearer session as a
password login. All OIDC logins are provisioned just-in-time and audited under the
Keycloak provider.
| Endpoint | Purpose |
|---|---|
GET api/auth/oidc/login | Begin the browser OIDC login (redirects to Keycloak with PKCE) |
GET api/auth/oidc/callback | Complete the browser OIDC login and mint the session |
POST api/auth/oidc/device-token | Exchange a Keycloak device-code access token for a JWT bearer session (headless/CLI) |
GET api/auth/oidc/logout | End the session and, when configured, propagate logout to Keycloak |
For the PowerShell equivalent, see
Connect-Athena -Keycloak.
A complete PowerShell round-trip — sign in, capture the token, then call a protected endpoint:
# 1. Sign in (self-signed cert -> -SkipCertificateCheck)
$login = Invoke-RestMethod -Method Post -SkipCertificateCheck `
-Uri "https://<host>:8443/api/auth/login" `
-ContentType "application/json" `
-Body (@{ username = "admin"; password = "<your-password>" } | ConvertTo-Json)
# 2. Pull the bearer token out of the response envelope
$token = $login.data.token
# 3. Call a protected endpoint with the Bearer header
Invoke-RestMethod -SkipCertificateCheck `
-Uri "https://<host>:8443/api/Agents" `
-Headers @{ Authorization = "Bearer $token" }
The -SkipCertificateCheck flag requires PowerShell 7+. It tells
Invoke-RestMethod to trust Athena's self-signed certificate; drop it once you have installed a
trusted certificate.
Response shape#
Every endpoint returns the same ApiResponse<T> envelope: a
success boolean, a human-readable message string, and a
data field carrying the payload.
{
"success": true,
"message": "Login successful",
"data": {
"token": "eyJhbGciOiJ..."
}
}
Swagger / OpenAPI#
An interactive OpenAPI explorer is built into the server. Enable it with the
Swagger:Enabled setting; it is served at the api-docs route prefix:
https://<host>:8443/api-docs
The explorer is published under the title Athena Deploy Center API and lists every endpoint and model described on this page, so you can try calls directly from the browser.
The raw OpenAPI document is served at /swagger/v1/swagger.json, which you can feed
to a client generator.
Not seeing the explorer?#
If https://<host>:8443/api-docs returns nothing (a blank page, a 404, or the
SPA instead of the Swagger UI), it is almost always because Swagger is disabled
on that server. The explorer is opt-in: when Swagger:Enabled is not
set, it defaults to off, and neither the UI nor the JSON spec is registered. Work through
these checks:
-
Confirm Swagger is enabled. Set
Swagger:Enabledtotruein the server configuration and restart. This can be provided inappsettings.json("Swagger": { "Enabled": true }) or via the environment variableSwagger__Enabled=true. A per-environment override (for example anappsettings.Production.jsonor a container env var that sets it tofalse) will turn the explorer off even if the default config has it on. -
Use the configured route prefix. The path comes from
Swagger:RoutePrefix(defaultapi-docs). If your deployment changed it, browse tohttps://<host>:8443/<that-prefix>instead. The raw spec stays at/swagger/v1/swagger.jsonregardless of the UI prefix. -
Use HTTPS on the API port. The API listens on
8443over HTTPS — make sure you are usinghttps://and the correct port, not plain HTTP or the web console port. -
Restart after changing the setting.
Swagger:Enabledis read at startup, so the server must be restarted for a change to take effect.
Once enabled, the UI loads at the route prefix and the spec at /swagger/v1/swagger.json;
use the Authorize button to supply your JWT bearer token before trying calls.
Health#
Health endpoints let a monitoring system or script watch the server. The liveness paths answer anonymously with the overall status only; the detail paths return a per-component breakdown (database, certificate authority, audit trail, disk space). See Server Health & Monitoring for the full report, statuses, thresholds, and the Docker healthcheck.
| Endpoint | Auth | Purpose |
|---|---|---|
GET /health | Anonymous | Lightweight liveness probe — used by the Docker healthcheck |
GET api/Health | Anonymous | Overall status and a timestamp |
GET api/Health/details | Signed-in user | Full per-component health report |
GET /health/details | Operator/Admin | Detailed report with per-component status and run duration |
Endpoint groups#
The API is organized into endpoint groups, each rooted at a base route:
| Group | Base route | Description |
|---|---|---|
| Auth | api/Auth | Login, logout, identity, and password changes |
| Agents | api/Agents | Enrolled endpoints and their status |
| Maintenance | api/agents/{id}/maintenance/*, api/agents/maintenance/* | Hold agents back from commands and deployments (enable/disable per agent or in bulk) |
| AgentMigration | api/agent-migration | Move agents from one Athena server to another (Mint / Paste) |
| Inventory | api/agents/{id}/inventory | Hardware and software inventory for an agent |
| Commands | api/Commands | Remote commands queued to agents |
| DeploymentPackages | api/deployment-packages | Uploaded software packages |
| Packages | api/packages | Package library — store large installer files with SHA-256 integrity and time-limited download links |
| Deployments | api/Deployments | Package rollouts to agents and collections |
| Collections | api/Collections | Groupings of agents for targeting (static & dynamic) |
| Scheduler | api/Scheduler | Scheduled jobs and maintenance tasks |
| Credentials | api/Credentials | Credential Vault — stored Local/Domain accounts for run-as |
| Tokens | api/Tokens | Agent registration tokens (create, revoke, delete) |
| Pki | api/Pki | Root CA and issued agent certificates |
| Audit | api/Audit | Audit log records (see Audit & SIEM) |
| Settings | api/Settings | Server configuration values, including security settings (session, lockout, password policy) and database backup & maintenance (Admin only) |
| Directory (LDAP) | api/settings/ldap | LDAP / Active Directory login config, group-to-role mappings, and test-connection (Admin only) |
| Updates / WSUS | api/updates | Windows Update scanning (WSUS offline catalog) |
| Compliance | api/compliance | Compliance state across the fleet |
| Reports | api/reports | Report builder, saved reports, and built-in reports |
| RustDesk | api/agents/{id}/rustdesk, api/rustdesk | Optional RustDesk remote access: install, password set/rotate, and fleet apply |
| RemoteDiagnostics | api/agents/{id}/remote-diagnostics | Per-agent screen-share diagnostics: helper version, last session, and a live relay-reachability probe |
| Unattended access | api/agents/{id}/unattended | Designate a machine for unattended screen-share so sessions skip the on-screen consent prompt (Operator/Admin) |
| Relay provisioning | api/agents/{id}/provision-relay | Stand up a coturn TURN relay for WebRTC screen-share on a Linux agent (Admin only) |
| Recordings | api/recordings | Session recordings — list, replay, download, delete |
| Emergency | api/Emergency | Break-glass account recovery (localhost only) |
| Users | api/users | Console user accounts — create, update, delete, reset passwords (Admin only) |
| Health | api/Health | Server health & monitoring — liveness probe and detailed component report |
The API uses the same role policies as the console (see Roles & Permissions). A token's role determines which endpoints succeed — calls outside the role's permissions are rejected.