Base URL
All endpoints are served from a single host and prefixed with/auth.
Authentication
Every endpoint except/auth/send-magic-link, /auth/verify-magic-link and
/auth/logout requires a Personal Access Token (PAT) in the
Authorization header.
POST /auth/generate-pat.
The plaintext token is returned once and stored only as a bcrypt hash — it
cannot be recovered later.
For the full sign-in flow, token lifecycle and role-based access rules, see the
Authorization guide.
Your first request
Confirm your token works by validating it. This returns the authenticated user and their currently selected organization.Organization context
Most resources belong to an organization. Endpoints that operate on one either take an explicitorg_id query parameter, or fall back to the caller’s
selected organization.
Retrieve your organizations with
GET /auth/get-orgs, then set
the active one with
POST /auth/select-org.
Endpoints like GET /auth/vpn-exit-nodes and GET /auth/threat-prevention-stats
depend on that selection.
Conventions
Timestamps
Timestamps
Every timestamp is a Unix epoch value in milliseconds, returned as a
number rather than an ISO-8601 string. For example
1735689600000.Identifiers
Identifiers
Resource identifiers are MongoDB ObjectIds, returned as 24-character
hexadecimal strings such as
60c72b2f5f1b2c001c8e4b1a.Errors
Errors
Errors return a JSON body with a
message field describing the failure. A
request with no credential returns 401. A credential that is present
but invalid, expired or inactive returns 403.Endpoints
Authentication
Magic link sign-in, session validation and sign-out.
Personal Access Tokens
Create, list and revoke the tokens used for API access.
Organizations
Create, update, select and delete organizations.
Members
Add members, change roles and remove access.
VPN Certificates
Issue and download OpenVPN client profiles.
VPN Configurations
Manage VPN servers and run their predefined commands.
VPN Exit Nodes
List the exit nodes available to your organization.
Statistics
Connection status, traffic reporting and threat prevention.
Notifications
Read in-app notifications and mark them as read.
Activity Logs
Retrieve recent activity for your account.
The VPN capability previously delivered through the OneFirewall Application at
https://app.onefirewall.com/api/v1/vpn now runs on ClosedVPN and is served
from https://closedvpn.io. The legacy OneFirewall VPN endpoints are
deprecated and are replaced by the operations documented in this tab.
