Skip to content

REST API

Everything the web interface does goes through the REST API (https://<fw>:8443/api/v1).

Authentication

Create a token in System → Administrators → API tokens (role auditor, admin or superadmin, optional expiry) and send it as a bearer token:

curl -k -H "Authorization: Bearer fr_…" https://fw:8443/api/v1/monitor/summary

POST /api/v1/auth/login sets an HttpOnly cookie and returns a csrf value. Every non-GET request must carry X-CSRF-Token: <csrf>.

Roles: auditor = read, admin = read + write, superadmin = everything (super: users, tokens, shell, factory reset, service restarts). Trusted hosts (System → Settings) also restrict API access.

Example: add an address and commit

FW=https://192.168.10.1:8443/api/v1
H="Authorization: Bearer $TOKEN"
curl -sk -H "$H" -X POST $FW/config/addresses -d '{"name":"nas","type":"subnet","value":"192.168.10.5"}'
curl -sk -H "$H" $FW/commit/preview | jq '.preview.changes'
curl -sk -H "$H" -X POST $FW/commit -d '{"comment":"add nas","confirm_min":5}'
curl -sk -H "$H" -X POST $FW/commit/confirm

Validation errors return 422 with details: [{path, message}]; a locked candidate returns 423.

Endpoints

Method Endpoint Role Description
POST /api/v1/auth/login public log in {username,password,totp} → session cookie + CSRF token (no auth)
POST /api/v1/auth/logout read end the session
GET /api/v1/auth/me read current user, role, CSRF token
POST /api/v1/auth/password read change own password {old,new}
POST /api/v1/auth/totp/confirm read activate TOTP {code}
POST /api/v1/auth/totp/disable read disable own TOTP
POST /api/v1/auth/totp/setup read start TOTP enrolment (secret, otpauth URI, QR SVG)
POST /api/v1/commit write commit {comment, confirm_min}
POST /api/v1/commit/confirm write confirm a pending commit
POST /api/v1/commit/discard write discard the candidate
DELETE /api/v1/commit/lock write take (POST) / release (DELETE) the candidate lock
POST /api/v1/commit/lock write take (POST) / release (DELETE) the candidate lock
GET /api/v1/commit/preview read validation, structured diff, file diffs, analyzer findings
GET /api/v1/commit/status read dirty flag, change count, journal, lock, pending confirmation, active version
GET /api/v1/config read full candidate (?source=running, ?download=1)
POST /api/v1/config/import write load a JSON configuration into the candidate
GET /api/v1/config/{section} read read a section (user passwords and authenticator keys are never returned)
POST /api/v1/config/{section} write create a collection item
PUT /api/v1/config/{section} write replace a collection {items:[…]} / update an object section
DELETE /api/v1/config/{section}/{key} write PUT update item · DELETE item
PUT /api/v1/config/{section}/{key} write PUT update item · DELETE item
POST /api/v1/config/{section}/{key}/move write reorder {before|after: key}
GET /api/v1/health public liveness (no auth)
GET /api/v1/meta/options read names of interfaces, zones, objects… for pickers
GET /api/v1/meta/public public name, version, login banner (no auth)
GET /api/v1/meta/sections read configuration section registry
GET /api/v1/meta/template read default object for ?path=<section>
GET /api/v1/monitor/alerts read active alerts and history
GET /api/v1/monitor/dhcp read DHCP leases
GET /api/v1/monitor/dns read DNS statistics
GET /api/v1/monitor/dns/check read is ?name= blocked
GET /api/v1/monitor/dns/querylog read recent queries ?q=&status=&client=
GET /api/v1/monitor/dns/resolve read resolve ?name=&type= through the pipeline
POST /api/v1/monitor/dns/{action} write flush cache, update-lists
GET /api/v1/monitor/exporters read exporter status
GET /api/v1/monitor/gateways read gateway health
GET /api/v1/monitor/interfaces read live interface counters
GET /api/v1/monitor/live read WebSocket event stream ?streams=firewall,dns
GET /api/v1/monitor/logs read search logs ?stream=&range=&q=&f.<field>=
GET /api/v1/monitor/logs/streams read log streams and disk usage
GET /api/v1/monitor/metrics read latest samples (?prefix=)
POST /api/v1/monitor/notifiers/{name}/test write send a test notification
GET /api/v1/monitor/query read time series ?key=…&key=… or ?metric=&labels=, range=15m…1y, points=
GET /api/v1/monitor/series read stored series (?prefix=)
GET /api/v1/monitor/sessions read conntrack sessions ?q=&limit=
GET /api/v1/monitor/summary read dashboard bundle
GET /api/v1/monitor/talkers read top hosts and services
GET /api/v1/monitor/vpn read VPN state
GET /api/v1/proxy/certs read certificates served by the reverse proxy (issuer, expiry, status)
POST /api/v1/proxy/certs/renew write request / renew Let's Encrypt certificates now
GET /api/v1/sessions super active web sessions
GET /api/v1/system/backup write download a full backup (tar.gz)
POST /api/v1/system/email/test write send a test e-mail {to} with the candidate e-mail server settings
GET /api/v1/system/info read hardware, version, storage usage
GET /api/v1/system/journal super journal ?unit=&lines=
GET /api/v1/system/nics read detected network hardware
POST /api/v1/system/restore write upload a backup or JSON → candidate
GET /api/v1/system/services read state of fr0ntier-managed units
POST /api/v1/system/services/{unit}/restart super restart a unit
POST /api/v1/system/{action} write reboot, shutdown, factory-reset
GET /api/v1/terminal read WebSocket CLI session
GET /api/v1/tokens super list / create API tokens
POST /api/v1/tokens super list / create API tokens
DELETE /api/v1/tokens/{id} super revoke a token
GET /api/v1/tools/analyze read rule analyzer findings
GET /api/v1/tools/capture write pcap download ?iface=&filter=&count=&seconds=
POST /api/v1/tools/cli read run a non-interactive CLI command {command}
POST /api/v1/tools/lookup read policy lookup {src_ip,dst_ip,proto,dst_port,in_intf} (?source=candidate)
GET /api/v1/tools/ovpn-profile write .ovpn profile for ?instance=&client=
GET /api/v1/tools/wg-client write client config + QR for ?tunnel=&peer=
POST /api/v1/tools/wg-keygen write new WireGuard key pair + PSK
POST /api/v1/tools/wg-pubkey read public key of {private_key}
GET /api/v1/users read list / create administrators
POST /api/v1/users super list / create administrators
DELETE /api/v1/users/{name} super update / delete an administrator
PUT /api/v1/users/{name} super update / delete an administrator
POST /api/v1/users/{name}/password super reset a password (must change at login)
POST /api/v1/users/{name}/totp/disable super remove 2FA of a user
GET /api/v1/versions read list versions
GET /api/v1/versions/{id} read version metadata + config (?download=1)
GET /api/v1/versions/{id}/diff read diff to ?to=running|candidate|<id>
POST /api/v1/versions/{id}/load write load a version into the candidate
POST /api/v1/versions/{id}/rollback write apply a version now
GET /api/v1/vpn/sessions read connected OpenVPN users
POST /api/v1/vpn/sessions/{instance}/{cid}/disconnect write disconnect an OpenVPN session
GET /api/v1/vpn/users/state read runtime state of remote users: failures, lockout, last login, live sessions
POST /api/v1/vpn/users/{name}/activation write send the access e-mail (instructions, authenticator QR, optional {instance} profile)
GET /api/v1/vpn/users/{name}/totp write authenticator enrolment of a user: key, otpauth URI and QR SVG (candidate)
POST /api/v1/vpn/users/{name}/totp/reset write generate a new authenticator key for a user (candidate)
POST /api/v1/vpn/users/{name}/unlock write clear the failures and the lockout of a user