REST API

Health endpoints, session login, management tokens, CSRF, and the permission map.

The management API lives under /api on the admin listener, not on the data plane.

Auth

Two ways in after setup:

  1. Session. POST /api/auth/login, then send the session cookie. State-changing calls need the CSRF middleware.
  2. Management token. Create one at POST /api/system/api-tokens (manage:api_tokens). Send it as a bearer token on later calls.

Public before login:

MethodPath
GET/health, /health/live, /health/ready, /health/cluster
GET/api/auth/login-options
POST/api/auth/captcha, /api/auth/captcha/verify, /api/auth/login
POST/api/setup, /api/setup/probe
GET/PATCH/api/setup/draft
POST/api/cluster/join
POST/api/cluster/nodes/{id}/heartbeat

Permission map

Common require("…") names from the router:

PrefixExamples
read: / write: sitesList and edit sites, ACME issue
read: / write: rulesCustom rules
read: / write: protectionIP, ACL, bot, rate limit, review decide
read: / write: threat_intelImport, sync, lookup
read: / write: edgeHeader / cache / compression policy
read: / write: ai, use:ai, approve:aiConfig, analyze, assistant, approvals
read: / write: clusterNodes, join tokens, rolling upgrade
read: / write: systemVersion, time sync, backup
manage:api_tokensCreate and revoke tokens
read: / write: usersLocal users and 2FA
read: logsAccess logs and review list
read: monitorStats, metrics, notifications
read: auditAudit log
read: realtimeSSE /api/realtime/events, WebSocket /api/realtime/ws
read: / write: opsScheduler
read: / write: storageStats and cleanup
read: apisecDiscovered endpoints

admin: ["*"] in the sample bypasses individual checks.

Errors

Failed calls return JSON with an error field and an HTTP status. Do not retry login blindly after a CAPTCHA failure — request a new challenge.