53. API reference
A practical orientation to the REST API — base URL, auth, and the real endpoint groups. Not exhaustive OpenAPI; the live spec is the source of truth.
Everything you can do in the operator app, you can do over HTTP. This
chapter is a map of the surface, not a line-by-line specification. For
the complete, always-current schema, hit the live OpenAPI document at
https://ops.daalu.io/openapi.json (Swagger UI at
https://ops.daalu.io/docs).
Base URL and versioning
https://ops.daalu.io/apiEndpoints live under a version namespace — currently /api/v1. Every
path in this chapter is relative to that, so /alerts means
https://ops.daalu.io/api/v1/alerts.
Authentication
Use a personal access token (PAT). Create one in Settings → API tokens and send it as a bearer token (Chapter 43 covers minting and rotation):
Authorization: Bearer dpat_xxxxxxxxxxxxxxxxxxxxxxxxTenant scoping is automatic. The token resolves to a user, the user to a tenant, and every query is filtered to that tenant — you never pass a tenant ID, and you can’t read across tenants. A PAT carries exactly the permissions of the user who minted it.
Note: One endpoint group is the exception to bearer auth: event ingestion (
POST /events) uses your tenant’s ingest key in theX-Daalu-Keyheader instead, so CI and scripts can emit events without a user token. See Chapter 40 — Webhooks.
A worked example
List critical alerts, then acknowledge one:
TOKEN="dpat_xxxxxxxxxxxxxxxxxxxxxxxx"
BASE="https://ops.daalu.io/api/v1"
curl -H "Authorization: Bearer $TOKEN" \
"$BASE/alerts?severity=critical"
curl -X POST -H "Authorization: Bearer $TOKEN" \
"$BASE/alerts/$ALERT_ID/acknowledge"Run a structured query over the timeline and export it as CSV:
curl -X POST -H "Authorization: Bearer $TOKEN" \
-H 'Content-Type: application/json' \
-d '{"entity": "events", "since_hours": 24}' \
"$BASE/reports/query/export?format=csv"Endpoint groups
The table below lists the real router groups. Each row is a family of endpoints; consult the OpenAPI spec for exact request/response shapes.
| Group | Representative endpoints | What it’s for |
|---|---|---|
| Events | GET /events · POST /events · GET /events/stream | Query the timeline (filter by module, severity, since_hours); ingest new events (X-Daalu-Key); subscribe to a live SSE stream. |
| Alerts | GET /alerts · GET /alerts/{id} · POST /alerts/{id}/acknowledge · POST /alerts/{id}/resolve | List and read alerts; acknowledge or resolve them. |
| Alert chat & actions | GET /alerts/{id}/chat · POST /alerts/{id}/chat · POST /alerts/{id}/triage · POST /alerts/{id}/actions/{action_id}/approve · .../reject | Converse with the Assistant in an alert’s context, trigger triage, and approve or reject the actions it proposes. |
| Reports | POST /reports/query · POST /reports/query/export · GET /reports/query/schema · POST /reports/query/translate · /reports/saved · /reports/dashboards · /reports/schedules | Run structured queries over events/alerts/devices/proposals; export CSV or JSON; manage saved reports, dashboards, and scheduled deliveries. |
| Source-of-Truth devices | GET /sot/devices · GET /sot/devices/{id} · GET /sot/devices/{id}/intent · POST /sot/devices/{id}/reconcile · PUT /sot/devices/{id}/intent | Read the device inventory and its intended config; trigger a reconcile; update intent. |
| Integrations & webhook ingest | GET /integrations · GET|PUT|DELETE /integrations/config/{provider} · POST /integrations/{provider}/ingest · POST /sot/webhooks/{slug} | List integrations and their health; manage per-tenant config; trigger an on-demand ingest; receive Nautobot webhooks. |
| Billing & usage | GET /billing/current · GET /billing/breakdown · GET /billing/daily · GET /billing/local-gpu · GET /billing/skus | Current spend, breakdowns by source, daily series, GPU-vs-cloud split, and the SKU catalogue. |
| AI Factory (GPU) | GET /ai-factory/overview · GET /ai-factory/gpu/summary · GET /ai-factory/gpu/timeseries · GET /ai-factory/gpu/events · POST /ai-factory/gpu/diagnostics · POST /ai-factory/aiperf/runs | GPU health and utilization, time-series metrics, GPU events, on-demand diagnostics, and load-test runs. |
| Auth & tokens | POST /auth/login · GET /auth/me · GET|POST|DELETE /auth/tokens | Session login, current-user info, and PAT management. |
This is the practical subset. The product ships more routers (agents, workflows, change proposals, clusters, the Assistant copilot, and more); the OpenAPI document enumerates them all.
Pagination
List endpoints return a JSON array and are bounded by query parameters rather than cursors. The common pair:
since_hours— how far back to look (e.g. events default to 24, capped at two weeks).limit— maximum rows to return (e.g. events default to 100, capped at 500).
Narrow with the same filters you’d use in the UI — severity,
module, and so on. For anything analytical, prefer
POST /reports/query, which is purpose-built for structured queries and
has a matching /export for CSV or JSON.
Errors
The API uses standard HTTP status codes, and error bodies carry a
detail field:
| Status | Meaning |
|---|---|
200 / 201 / 202 / 204 | Success (202 for accepted-but-async ingestion; 204 for no-content deletes). |
401 | Missing or invalid credential — bad PAT, or a missing X-Daalu-Key on ingest. |
403 | Authenticated but not permitted (e.g. a non-admin hitting an admin route). |
404 | Not found, or not in your tenant. |
422 | Request body failed validation; detail lists the offending fields. |
429 | Rate-limited; back off and retry. |
{ "detail": "token not found" }A note on scope
Treat this chapter as a starting map. Endpoints, fields, and defaults
evolve; the openapi.json document is generated from the running code
and is always authoritative. When you build against the API, generate
your client from that spec rather than from this table.