Authorization header. This page covers how to get your first token, how to use
it, and how to manage its lifecycle.
Getting your first token
Creating a token requires an authenticated session, so the very first token comes from signing in. There are two routes.- From the web application
- Over the API
- Sign in at closedvpn.io using the magic link sent to your email address.
- Open the Profile page.
- Choose Create token, give it a name, and optionally set an expiry.
- Copy the token immediately — it is shown only once.
Using your token
Send the token as a Bearer credential on every request.Organization context
Endpoints that act on a single organization either take an explicitorg_id, or
fall back to your selected organization.
GET /auth/vpn-exit-nodes requires a selection and returns 400 without one.
GET /auth/threat-prevention-stats accepts an optional org_id and falls back to
the selection.
Roles
Each member of an organization is either an owner or a member. Owner-only operations are: updating and deleting the organization, adding members, changing roles, and removing members. Attempting one as a member returns403.
Two guards apply to owners: you cannot change your own role, and the last remaining
owner can neither leave nor delete their only organization.
Managing tokens
List your tokens
List your tokens
GET /auth/get-pats
returns your active tokens. Only the bcrypt hash of each is returned, never the
plaintext. Tokens whose expiry has passed are deactivated as a side effect of
this call and excluded from the result.Revoke a token
Revoke a token
POST /auth/delete-pat
deactivates a token. Pass the hash returned by GET /auth/get-pats in the
token field, not the plaintext value.Expiry
Expiry
Pass
expiryDays when creating a token to set a lifetime. Omit it for a token
that never expires. An expired token returns 403.POST /auth/logout clears the browser session cookie only. It does not revoke
Personal Access Tokens and has no effect on API clients. Use /auth/delete-pat
to revoke a token.
