Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

API reference

The management API is a JSON REST API under /api/v1, described by an OpenAPI 3.1 document.

WhereWhat
openapi/dnsy.json in the repositorythe checked-in document; just openapi-check (part of just check) fails when it drifts from the handler annotations
GET /api/openapi.json on a running serverthe same document, served by the binary
dnsy openapiprints the document to stdout
/rest-api/ on the docs sitethe OpenAPI document rendered with Redoc
/api/ on the docs siterustdoc for every crate
dnsy openapi | jq '.paths | keys | length'    # how many paths the server exposes
curl -s http://127.0.0.1:5380/api/openapi.json | jq '.info'

The REST API page is the narrative reference: authentication (bearer tokens and session cookies with CSRF), error format (RFC 9457 problem documents), pagination and what each endpoint group does. Endpoint groups:

GroupPathsPage
Probes and version/healthz, /readyz, /api/v1/versionREST API
Auth, users, tokens/api/v1/auth/*, /api/v1/users, /api/v1/tokensUsers, tokens and sessions
Zones and records/api/v1/zones, /api/v1/zones/{name}/records, .../exportZones
DNSSEC/api/v1/zones/{name}/dnssec*, /api/v1/settings/dnssec, /api/v1/dnssec/statusDNSSEC
Filtering and ACL/api/v1/blocklists, /api/v1/rules, /api/v1/acl, /api/v1/client-certsFiltering
Upstreams, cache, settings/api/v1/upstream-groups, /api/v1/cache, /api/v1/settingsResolver, upstreams and cache
Query log and stats/api/v1/querylog, /api/v1/stats/*Query log and stats

Generate a client from the document with any OpenAPI tool; the web UI does exactly that for its TypeScript types (just web-types).