REST API Reference

Base URL: http://<pi-ip>/api. All endpoints except /api/health require Bearer authentication.

Authentication

All API requests (except /api/health) require the API key in the Authorization header:

bash
curl -H "Authorization: Bearer <YOUR_API_KEY>" \
  http://<PI_IP>/api/zones

Retrieve your API key from the Dashboard → Settings → Security.

Health

GET /api/health No auth required
json
{ "status": "ok" }

Zones

GET /api/zones List all zones
GET /api/zones/{domain} Get zone details
POST /api/zones Create zone
PUT /api/zones/{domain} Update zone
DELETE /api/zones/{domain} Delete zone

Create Zone — Example

bash
curl -X POST http://<PI_IP>/api/zones \
  -H "Authorization: Bearer <KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "domain": "home.lan",
    "ttl": 3600,
    "nameservers": ["ns1.home.lan"],
    "admin_email": "admin@home.lan"
  }'

Records

GET /api/zones/{domain}/records List records
POST /api/zones/{domain}/records Add record
PUT /api/zones/{domain}/records/{id} Update record
DELETE /api/zones/{domain}/records/{id} Delete record

Add A Record — Example

bash
curl -X POST http://<PI_IP>/api/zones/home.lan/records \
  -H "Authorization: Bearer <KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "nas",
    "type": "A",
    "value": "192.168.1.100",
    "ttl": 3600
  }'

Blocklist

GET /api/blocklist Get blocklist stats & URLs
POST /api/blocklist/refresh Force blocklist re-download
GET /api/blocklist/whitelist List whitelisted IPs/CIDRs
POST /api/blocklist/whitelist Add whitelist entry

Config (Live Reload)

Some configuration values can be updated without restarting:

GET /api/config Get current runtime config
PATCH /api/config Update live-reloadable config

Update Upstream DNS — Example

bash
curl -X PATCH http://<PI_IP>/api/config \
  -H "Authorization: Bearer <KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "dnsserver": {
      "upstream": ["1.1.1.1", "1.0.0.1"]
    }
  }'

Cluster

GET /api/cluster/status Cluster health & sync status
POST /api/cluster/sync Force full sync to all slaves