The REST API
API tokens, the three scopes, how requests and answers look, errors and limits — the first page of the API.
Everything the dashboard does goes through a JSON REST API at https://heimdall.warewave.tech/api/v1, and an API token lets your own tools use it: a deploy pipeline that opens a maintenance window, an Ansible play that keeps your monitors as code, a cron job that pings a heartbeat, a script that posts to your status page. These pages show every call a token can make, each with a request and the answer it gets.
- Monitors — create, change, pause, check now, results and uptime: API: monitors.
- Incidents — list, acknowledge, snooze, resolve, notes, and the live event stream: API: incidents.
- Status pages and maintenance windows — pages, public updates, planned maintenance: API: status pages.
- On-call — rotations, teams, escalation policies, Slack, Microsoft Teams and webhook channels, alert sources: API: on-call.
- Private locations and service levels: API: locations and SLAs.
- Whole examples for GitHub Actions, GitLab CI, Ansible and cron: API: automation.
The machine-readable contract (OpenAPI 3) is at https://heimdall.warewave.tech/docs/openapi.yaml: import it into Postman or Insomnia, or generate a client from it. It also describes the calls the dashboard itself makes; those a token cannot reach answer 403.
API tokens
API tokens come with Team and Business. An admin or the owner creates one under Settings → API tokens: a name (what will use it), a scope, the addresses it may be used from and, if you like, an expiry. The token starts with hmd_ and is shown once, right after it is created — Heimdall keeps only a hash of it — so put it in your secret store then.
| Scope | Acts as | What it can do |
|---|---|---|
read | a viewer | Read monitors, results, uptime, incidents, status pages, maintenance, on-call, SLAs. Acknowledge an incident (a viewer may). |
write | a member | Also create, change, pause and delete monitors; snooze, resolve and annotate incidents; post status page updates; plan maintenance; manage SLAs. |
admin | an admin | Also status pages themselves, escalation policies, rotations, teams, alert channels, alert sources and private locations — what configuration as code needs. |
- Give each tool a token of its own, with the least scope that does its work: a dashboard reads, a pipeline writes, the play that keeps your on-call as code is an admin.
- Whatever its scope, a token never reaches the organisation itself — its members, invitations, API tokens and settings —, nor profiles, phone numbers or billing. Those stay a person’s work in the dashboard.
- A token belongs to one organisation. For another, create a token there.
- A token works only from the IP addresses or CIDR prefixes it allows (at most 20; none wider than /8 for IPv4 or /16 for IPv6). Change them under Addresses without making a new token.
- What a token did — every request, and every one refused for its address — is under Activity, next to Revoke, for 90 days. Revoking stops it at once.
- What a token does is recorded as its own: an incident acknowledged by it shows “API token Deploy pipeline”, a maintenance window it planned says so.
The first request
The examples on these pages use two shell variables — set them once:
export HEIMDALL=https://heimdall.warewave.tech/api/v1
export HEIMDALL_API_TOKEN=hmd_… # from your secret store, never in a repository
curl -sS "$HEIMDALL/monitors" -H "Authorization: Bearer $HEIMDALL_API_TOKEN"[
{
"id": "01JC4Q8Z2M7V3K9X5T1R6B0WAP",
"name": "API",
"type": "http",
"target": "https://api.example.com/health",
"state": "up",
"regions": [
{ "region": "ist", "status": "up" },
{ "region": "fra", "status": "up" },
{ "region": "stc", "status": "up" }
],
"quorum": "2/3",
"interval_seconds": 60,
"severity": "critical",
"tags": ["env:prod", "service:api"],
"response_ms": 182,
"uptime_30d": 99.97
}
]Requests and answers
- Bodies are JSON: send
Content-Type: application/jsonwith every request that has one. - Ids are 26-character strings (ULIDs); a private location’s id is
prv-…, a public region’s its short name (ist,fra,stc—GET /regionslists them). - Times are RFC 3339. Answers give them in UTC (
2026-11-03T22:00:00Z); requests may carry any offset (2026-11-04T01:00:00+03:00is the same instant). PUTreplaces the whole thing: send every field you want to keep — a field left out takes its default.PATCH(channels) changes only what it names.- Creating answers
201with the new object, changing200with it, deleting and pausing204with no body. - Lists come whole, except incidents and check results, which are paged (
limit, andbeforewith the last item’s time — API: incidents shows how). - Unknown fields in a body are ignored; unknown query parameters too.
Errors
Every error is JSON with a code your scripts can test and a message for people; a validation error names each wrong field in fields:
{
"code": "validation",
"message": "please correct the marked fields",
"fields": {
"conditions.0": "missing a value after ==",
"interval_seconds": "between 15 and 86400",
"name": "required, at most 120 characters",
"target": "an http:// or https:// URL"
}
}| Status | `code` | Meaning and what to do |
|---|---|---|
| 400 | bad_request | The body is not JSON, or not of the right shape (a string where a number belongs). The message says where. |
| 401 | unauthenticated | No Authorization header. Send Bearer <token>. |
| 401 | invalid_token | The token is unknown, revoked or expired. Make a new one. |
| 402 | plan_limit | The plan does not allow it: limit says what (monitors, interval, status_pages, api …), upgrade_to the plan that does. The API itself is limit: "api": tokens are kept and work again after an upgrade. |
| 403 | forbidden | The token’s scope is too small (the message says which it needs), or the call is one no token reaches. |
| 403 | ip_not_allowed | The request came from an address the token does not allow. Add it under Addresses. |
| 404 | not_found | No such thing in this organisation — also when it exists in another. |
| 409 | e.g. slug_taken, resolved, completed | The request is valid but the state does not allow it: the address is taken, the incident is already resolved, the maintenance window has ended. |
| 422 | validation | A field is wrong: see fields. |
| 429 | rate_limited | Too many requests. Wait the seconds in Retry-After, then try again. |
| 5xx | internal, unavailable | Our side. Retry with a growing pause; it is safe for reads, and for changes when the answer never came (check before you create twice). |
{
"code": "plan_limit",
"limit": "api",
"plan": "pro",
"upgrade_to": "team",
"message": "API tokens are not included in the Pro plan"
}Limits
- Each token has 600 requests a minute. Over it the answer is
429withRetry-Afterin seconds; a script that waits that long and goes on never fails for it (API: automation has a helper). - Checking a monitor now (
POST /monitors/{id}/test) is limited to 20 a minute per organisation as well: it makes a probe work. - The plan’s limits hold for the API as for the dashboard: what the plan does not include is
402.
