Admiral REST API & Swagger Reference
The Admiral REST API allows engineering teams, autonomous AI agents, and CI/CD pipelines to manage edge devices, fleets, configurations, and rollouts programmatically.
Base URL: https://api.admrl.co/v1
Test endpoints, view parameter schemas, and execute live API requests directly from your browser.
Open Swagger UI →
Download the complete JSON schema to generate typed client SDKs in Go, Python, TypeScript, or Rust.
Download doc.json →
Authentication
Admiral supports two independent authentication methods. Pick the one that fits your use case (do not combine them):
| Property | Personal API Token (PAT) | Service Account (OAuth2 Client Credentials) |
|---|---|---|
| Identity | Tied to an individual human user account | Dedicated, independent machine identity |
| Recommended For | Quick scripts, local developer testing | CI/CD pipelines, production backend integrations, automated GitOps |
| Lifecycle | Tied to the user account | Survives organizational personnel changes |
| Permissions | Inherits your user roles | Scoped via roles or IAM policies |
| Headers | X-API-Token-ID + X-API-Secret-Key | Authorization: Bearer *** |
- Service accounts (recommended): exchange a client ID and secret for a short-lived bearer token. See Service Accounts.
- Personal API tokens (legacy): send
X-API-Token-IDandX-API-Secret-Keyon every request. See Personal API Tokens below.
Required Header: Multi-Tenant Organization Context
Admiral is a multi-tenant platform. Nearly all API endpoints require you to specify the operational tenant via the X-Organization-ID header:
X-Organization-ID: your-organisation-uuid
You can copy your Organization ID from Settings > General (app.admrl.co/settings/general) or find it in your user profile metadata.
Example Request
curl -s "https://api.admrl.co/v1/devices?page=1&limit=10" \
-H "X-Organization-ID: $ORG_ID" \
-H "Authorization: Bearer $ACCESS_TOKEN"
Endpoint examples for each feature live on that feature's page, for example rollout impact, maintenance windows, AirDetect, telemetry, and alerts.
Personal API Tokens (Legacy)
Personal API tokens are tied to one user and inherit all of that user's roles, which cannot be narrowed. Sensitive actions such as revealing disk recovery keys, remote disk unlocks, and live screen control are blocked for tokens and require a signed-in dashboard session. Use Service Accounts for scripts, CI/CD, and integrations.
Creating a token
- Go to Account > API tokens.
- Click New Token.
- Enter a descriptive name (e.g., "Personal testing").
- Set an expiration date (recommended).
- Click Create Token.
Each token has two parts: a Token ID (starts with admk_) and a Secret Key (starts with adms_).
The Secret Key is only displayed once upon creation. Store it securely immediately. If you lose it, you must create a new token.
Using a token
Send both parts of the token, plus your organisation, on every request:
curl "https://api.admrl.co/v1/devices" \
-H "X-Organization-ID: $ORG_ID" \
-H "X-API-Token-ID: $TOKEN_ID" \
-H "X-API-Secret-Key: $SECRET_KEY"
A personal token acts with the capabilities granted by the roles assigned to the user who created it. Sensitive operations (revealing disk recovery keys, remote disk unlock grants, and interactive screen control) cannot be performed using API tokens.
Moving to a service account
- Create a Service Account for the workload.
- Assign a role (or attach an IAM policy) granting only the capabilities it needs.
- Mint a key and update your systems to use the new client credentials.
- Revoke the personal token.
Calls That Reach a Device
Some endpoints ask the device itself rather than stored data: live state reads, diagnostics probes, screenshots, and similar. Their errors are the same everywhere. For the endpoints, see Device Documents, Device State & Diagnostics, Memory Testing, and Rollouts.
Errors
| Status | error | Meaning |
|---|---|---|
503 | device_offline | The device is not connected. |
504 | device_timeout | The device did not answer in time. |
502 | device_error | The device answered with an error (detail has it). |
409 | device_busy | The device is already running that kind of request. |
429 | rate_limited | Too many live calls for this device; honour Retry-After. |