Skip to Content
Use with AI

Access tokens and scopes

Scoped tokens for scripts, CI and agents that cannot sign in with OAuth, on the REST API and the MCP server.

An Access token is for software that runs without a person: a script, a CI job, a headless agent. It works on the REST API and on the MCP server, for one Network. An app that can open a browser should connect with OAuth instead: its tokens last an hour and renew themselves.

Create one

In the console, open Enterprise → Access tokens, or call the API from a signed-in session:

Terminal
curl -X POST https://tiltas.openpanel.sh/api/v1/accounts/$ACCOUNT/access-tokens \
  -H 'Content-Type: application/json' \
  -d '{"name": "deploy pipeline", "scopes": ["services:write"], "expires_in_days": 30}'
  • scopes: what it may do (below). read is always added.
  • It lasts 90 days unless you set expires_in_days (1 to 365) or "never_expires": true.
  • The secret (qlt_…) is shown once. Store it in a secret manager.

Only Owners and Admins make tokens, and a token works only while the person who made it is still an Owner or Admin of the Network. A token never does what only an Owner may (billing, deleting the Network) and never makes other tokens.

Scopes

Some changes wait for a person's approval. That happens on the MCP server, where the agent gets a link for an Owner or Admin. On the REST API nobody is asked, so a scoped token cannot make those changes there (see On the REST API).

ScopeRuns at onceWaits for a person through the MCP
readevery read: Devices, Services, rules, Groups, people, status, usage, the audit log
network:writerename the Network, change key expiry and alertsturning device approval off, creating another Network
devices:writerename Devicesapproving a Device, adding Groups or subnet routes, turning on an exit node, stopping key expiry
devices:removeremoving a Device
joinkeys:writesingle-use keys that last up to an hour, revoking keysreusable keys, longer ones, keys that put servers into Groups
services:writecreating and changing Services only the token's person may usesharing a Service with others, pointing a shared one elsewhere, deleting
rules:writecreating Groups, narrowing rules and Groupsnew Access and SSH rules, changes that widen access, deletes
members:writerevoking invitesinvites, role changes, removing people
network:deletedeleting the Network; only an Owner approves it

Tokens made before scopes existed carry read or write. They keep working: write allows every write an Admin may make, at once, as before. Prefer the narrow scopes for new tokens.

A call outside the token's scopes answers 403 with the scope it needs:

JSON
{ "status": 403, "code": "access_denied", "detail": "This Access token does not have the joinkeys:write scope." }

On the REST API

A scoped token gets 403 access_denied for anything in the last column, and the detail says the change waits for a person. Ask for it through the MCP server instead, or make it in the console. The REST API judges from the request alone, so it is stricter than the MCP, which compares with what is there now:

  • Changing an Access rule, Group or SSH rule is refused: each request replaces the whole object.
  • On a Device, only name, exit_node: false and key_expiry_disabled: false run.
  • A Join key runs only single-use, with expires_in_minutes up to 60 and no Groups. Without expires_in_minutes it would last 7 days, so it is refused.
  • A Service's allowed may name only the token's own person, or nobody; a new target or ports is refused.
  • A field the API does not list as safe is refused.
Terminal
curl -X POST https://tiltas.openpanel.sh/api/v1/accounts/$ACCOUNT/join-keys \
  -H "Authorization: Bearer $TILTAS_TOKEN" -H 'Content-Type: application/json' \
  -d '{"name": "ci runner", "expires_in_minutes": 15}'

On the MCP server

Send the token as a Bearer token (see Other clients on Use with AI). The same approvals apply: a token with devices:remove can ask to remove a Device; a person still approves it. If the token is revoked first, or its maker leaves the Network or stops being an Admin, the request can no longer be approved.

OAuth tokens

Tokens that MCP clients get through OAuth use the same prefix but are issued for the MCP server alone: the REST API refuses them. They last one hour; the client renews them with a refresh token that changes on every use. If a refresh token is ever used twice, Tiltas ends the whole connection.

On this page

Ask AI about this page