Skip to content

API: private locations and SLAs

Add private locations and their probes from code, and set service levels and read their reports.

Private locations

A private location is a region of your own, inside your network, where probes you run check what the public regions cannot reach (Private locations). Making locations and probes needs an admin token.

POST /locations
curl -sS -X POST "$HEIMDALL/locations" \
  -H "Authorization: Bearer $HEIMDALL_API_TOKEN" -H "Content-Type: application/json" \
  -d '{"name": "Office", "slug": "office"}'
Answer — 201
{
  "id": "prv-82k18wyx-office",
  "name": "Office",
  "private": true,
  "probes": [],
  "probes_online": 0,
  "monitors": 0,
  "suspended": false,
  "created_at": "2026-10-27T20:13:43Z"
}
POST /locations/{id}/tokens — a probe for it
curl -sS -X POST "$HEIMDALL/locations/prv-82k18wyx-office/tokens" \
  -H "Authorization: Bearer $HEIMDALL_API_TOKEN" -H "Content-Type: application/json" \
  -d '{"name": "rack-1"}'
Answer — 201
{
  "id": "01JC4QG8M1P4S7V0Y3B6E9H2K5",
  "prefix": "hpt_Gj3p",
  "token": "hpt_Gj3pV5boA3Fqd8bdyq1f3Z7BrTWRLPIJX6-PlovBnJg",
  "server_url": "https://heimdall.warewave.tech"
}
  • The probe’s token is in this answer only: hand it to the probe (its configuration, or the container’s environment — Private locations) and nowhere else.
  • Use the location’s id in a monitor’s regions.
  • DELETE /locations/{id}/tokens/{tokenId} removes a probe — it stops within seconds; DELETE /locations/{id} removes the location once no monitor uses it.
  • GET /locations lists them with the probes seen and when.

Service levels (SLA)

A service level holds a service to a target over calendar periods and says how much downtime is left (Service levels). It comes with Business; a write token makes and changes them.

POST /slas
curl -sS -X POST "$HEIMDALL/slas" \
  -H "Authorization: Bearer $HEIMDALL_API_TOKEN" -H "Content-Type: application/json" \
  -d '{
    "name": "API",
    "target": 99.9,
    "period": "month",
    "timezone": "Europe/Istanbul",
    "monitor_ids": ["01JC4Q8Z2M7V3K9X5T1R6B0WAP"],
    "notify_user_ids": ["email:ayse@example.com"]
  }'
Answer — 201 (part)
{
  "id": "01JC4QH5P8S1V4Y7B0E3H6K9N2",
  "name": "API",
  "target": 99.9,
  "period": "month",
  "timezone": "Europe/Istanbul",
  "monitor_ids": ["01JC4Q8Z2M7V3K9X5T1R6B0WAP"],
  "notify_user_ids": ["01JC4Q7SZ9C2F5H8K1N4Q7T0W3"],
  "report_mail": true,
  "budget_mail": true,
  "current": {
    "key": "2026-10",
    "from": "2026-09-30T21:00:00Z",
    "to": "2026-10-31T21:00:00Z",
    "allowed_seconds": 2678,
    "down_seconds": 312,
    "used": 0.12,
    "state": "on_track",
    "running": true
  }
}
  • Either monitor_ids (up to 50) or component_id (a status page component, its monitors as the page has them).
  • period: month, quarter or year, in timezone; target 90–99.999. In current, used is downtime ÷ allowance (above 1 when it was passed) and state is on_track, at_risk (75 % used) or breached while the period runs, met or missed after it.
  • GET /sla-reports/2026-10 is the month’s report as JSON; /pdf and /csv the same as a file:
The report as a file
curl -sS -o sla-2026-10.pdf "$HEIMDALL/sla-reports/2026-10/pdf" -H "Authorization: Bearer $HEIMDALL_API_TOKEN"
curl -sS -o sla-2026-10.csv "$HEIMDALL/sla-reports/2026-10/csv" -H "Authorization: Bearer $HEIMDALL_API_TOKEN"