Sysnee Docs

Tokens and scopes

Personal tokens and OAuth tokens, the eight scopes, project and IP limits, expiry, revocation, and what a token can never do.

Token types

PrefixTypeHow you get itLifetime
sysnee_pat_Personal tokenConsole → Security → Tokens1 to 365 days (default 90)
sysnee_oat_OAuth access tokenAn app's sign-in (MCP, CLI)1 hour
sysnee_ort_OAuth refresh tokenIssued with the access token30 days without use, renewed on each use

All are opaque: 36 random characters and a 6-character checksum after the prefix. The prefixes exist so secret scanners can recognize a leaked token.

Sysnee only stores an HMAC of the token. A personal token is shown once, when you create it. If you lose it, create another.

Send the token in the header:

curl -H "Authorization: Bearer $SYSNEE_TOKEN" https://api.cloud.sysnee.com/v1/resources/deploy

Scopes

ScopeAllowsWho can have it
account:readSee the user, organization and projectsEveryone
sites:readSee sites, deployments, logs, domains and analyticsEveryone
sites:deployCreate sites, deploy, roll back, add and verify domainsEveryone
sites:deleteDelete sites and remove domainsOwner
databases:readSee databases, without passwordsEveryone
databases:writeCreate, stop and start databasesOwner, account level 3
databases:deleteRequest database deletionsOwner
billing:readSee usage, cost and invoicesEveryone

What a token can do is the intersection of its scopes and the user's role in the organization. If the user's role changes, the token loses what the role lost.

The routes of each scope are in the API reference and in openapi.json (field x-required-scope).

Create a personal token

In Console → Security → Tokens → New token:

  • Name (up to 100 characters), so you know where it is used.
  • Scopes: check only what you need.
  • Projects: all, or up to 50 specific ones. A token limited to projects can't see or create anything outside them.
  • IP ranges (optional): up to 20 IPv4 or IPv6 ranges in CIDR. Outside them, the token is refused.
  • Expiry: 1 to 365 days.

Requirements:

  • A verified email.
  • Scopes that change resources (sites:deploy, sites:delete, databases:write, databases:delete) need two-factor authentication turned on and confirmed in the last 10 minutes.
  • databases:write and databases:delete need account level 3, the same requirement as creating databases.
  • At most 20 active personal tokens per user.

You get an email for every token created and every app authorized.

Roll and revoke

  • Roll issues a new token with the same settings and invalidates the old one at once. Tokens with write scopes ask for your second factor.
  • Revoke invalidates the token at once.
  • The list shows each token's last use and last IP.

OAuth apps are in Console → Security → Authorized apps. Revoking an app invalidates all its tokens. An app unused for 90 days is revoked on its own.

If a token leaked, revoke it first and investigate after: the Activity tab shows what each token did.

What a token can't do

Some actions stay in the console, with a person's session:

  • Delete a database. With a token, POST /v1/resources/postgres/{id}/deletion-request files a request someone confirms in the console.
  • See a database's password.
  • Create, roll or revoke tokens, and authorize apps.
  • Change password, email, second factor, members, Git integrations and billing details.

Routes not listed in the API reference refuse tokens.

Errors

StatusReason
401Invalid, expired or revoked token
403Missing scope, project outside the token, IP not allowed, or a console-only route
429Rate limit: 120 requests per minute per token, 30 uploads per hour per token

The error message names the missing scope, project or step, in Portuguese or English depending on Accept-Language.

Audit

Every write made with a token or app records an event with the token, the app, the resource, the IP and the result. Token and app creation, device sign-ins, revocations, and deletion requests and confirmations are recorded too. Events are kept for 365 days in Console → Security → Activity.