Core conventions
The administrative backend is FastAPI. Routes are grouped under /api, with separate trusted service endpoints under /api/internal/radius. Use HTTPS. Do not use the browser session cookie as a long-lived machine integration credential.
Authenticate
POST /api/auth/login with username/password and TOTP if enabled. Response provides a session cookie and CSRF token. For browser API mutations, send X-CSRF-Token; retrieve a refreshed token from GET /api/auth/csrf after reload. Read-only routes require the corresponding permissions.
Example (illustrative only)
POST /api/auth/login HTTP/1.1
Content-Type: application/json
{"username":"admin","password":"YOUR_SECRET"}
GET /api/license/status HTTP/1.1
Cookie: wg_session=<session-cookie>
POST /api/license/activate HTTP/1.1
Content-Type: application/json
Cookie: wg_session=<session-cookie>
X-CSRF-Token: <csrf-value>
{"document":{"payload":{},"signature":"..."}}
The last shape demonstrates the envelope only; a real license must be correctly signed by the vendor. Never copy secrets into public scripts or documentation.
Common errors
401 unauthenticated, 403 insufficient permissions/CSRF, 402 expired trial/license on most mutations, 409 state conflict, 422 schema validation, 429 throttling.
Full route-by-route catalog
See /wesergate/docs/api and the machine-readable data/api-endpoints.json, extracted from the v0.13 source. Some requests require Pydantic body schemas; the catalog names handler and body model rather than inventing response payloads.
New in v0.13.0
- Hybrid signed endpoint licensing: pricing and activation.
- 1000-device engineering validation.
- PostgreSQL retention and capacity.
- Safe update procedures.
- Full features reference.
en/docs/reference/api-guide.mdRead documentation Not a certified production NAC. Physical switch/RADIUS enforcement and 1,000-device traffic remain unverified.

