API tokens
Overview
An API token authenticates a script, a CI job or an integration with the Oxygen API, without anyone signing in. This guide covers creating one, choosing how far it reaches, and sending it.Older
oxy_… API keys have been removed. A request carrying one is
refused with a message naming its replacement. If something of yours stopped
working, mint a token below and set it where the key was — the header does not
change.Which kind to create
A personal token carries your reach, so it stops working when you do. An
integration that several people depend on belongs to a service account, which an
organization admin can see and end.
If the caller runs in GitHub Actions, prefer trusted access and store no secret
at all: Settings → Organization → API access → a service account → Trusted
access gives you the workflow block to paste.
Creating a personal access token
- Open Settings → Account → API tokens.
- Create token, and name it after where it will live —
laptop,nightly-report— so you can tell later which one to revoke. - Choose its access: All access reaches everything you do, or pick the workspaces it needs. Pick the workspaces.
- Choose when it expires. You can extend it later without changing the secret, so nothing needs redeploying.
Creating a service account token
- Open Settings → Organization → API access → Service accounts.
- New, and name it after the job rather than a person:
nightly-sync,bookkeeping-upload. - Give it the workspaces it needs, at the lowest role that works.
- Create a token on it. Again, the secret is shown once.
Sending a token
Either header works, and both accept every kind of token:/api/{workspace_id}/…). The workspace id
is on Settings → Workspace → API tokens, under the list.
Python
JavaScript (Node.js)
Finding and ending a token
Settings → Account → API tokens lists your own, searchable by token, by organization and by the apps it reaches, and filterable by whether it still works or is about to expire. Settings → Workspace → API tokens lists every token that reaches one workspace, whoever owns it. Settings → Organization → API access lists every token that reaches the organization, where an admin can end a personal token’s access to that organization without touching what it does elsewhere.API reference
The live Swagger documentation at/apidoc on your Oxygen host browses every
endpoint, shows request and response schemas, and runs calls from the browser.
It reflects the version you are running.
The oxyc CLI reads the same catalog: oxyc routes lists the endpoints and
oxyc schema <path> prints one endpoint’s shape.