Skip to content

Personal access tokens and API keys

Long-lived tokens that act as a user, and the publishable and secret keys of a project, with their formats, scopes and how to revoke them.

Applies to EngineCloud
View as Markdown
On this page
  1. Personal access tokens
  2. API keys
  3. Protected keys
  4. Secret scanning

Personal access tokens

A personal access token (PAT) acts as one user, limited to the scopes it was given. Good for scripts, integrations and CI.

Text
syp_pat_abcdefghijklmnopqrst_4Gk9qL2mZ8xR7vT1nB5cW3yH6jD0sF2aE8uP4iO1x7Kd2Q
  • The project’s ref, then 40 random characters (238 bits) and a 6-character checksum, so secret scanners can recognise a real token without calling us. The ref lets the MCP server find the project. Tokens made before the ref was added (syp_pat_ + 46 characters) still work.
  • Stored as a SHA-256 hash and its last 4 characters; shown once.
  • expires_at can be a date or never. Every token can be revoked at any time.
  • Send it as Authorization: Bearer syp_pat_… to the Data API or SQL.

Create them in the console → Account → Tokens, or with POST /auth/v1/tokens while signed in. The token’s rights are the intersection of the user’s rights and its scopes: a PAT never does more than its owner. Asking for sql:*, auth:admin or project:admin fails with 403 scope_not_allowed unless an admin granted them to the user (who may hold them). PATs are created only from the person’s own session, never with another PAT or an app’s token. In your policies a PAT, like a token an app got for the person, carries the person’s current app_metadata and user_metadata in auth.jwt(), read again within a minute of any change.

API keys

Each project has two kinds of keys.

Publishable syp_pk_<ref>_…Secret syp_sk_<ref>_…
Wherebrowsers, phones, anywhereservers only
Database roleanon, or the user’s role when a user token is sent tooservice_role: bypasses row-level security
How manyone (rotatable)several, each with a name
Storedcan be shown againas a hash; last 4 shown

Send a key in the apikey header (as Supabase does) or as Authorization: Bearer. A secret key sent from a browser, a request with an Origin header, is refused with secret_key_in_browser.

Protected keys

A key created with "protected": true can’t be revoked on its own: DELETE /auth/v1/admin/api-keys/{id} answers 409 protected_key. It is replaced with POST /auth/v1/admin/api-keys/{id}/rotate-protected, which creates the new key and revokes the old one in one transaction, so whatever depends on it never loses its way in. In Sypnia Cloud the console’s own key of each project is protected; Machines → Rotate the console key replaces it.

Secret scanning

The prefixes syp_pat_, syp_sk_ and syp_cs_ are registered for GitHub secret scanning: when one is pushed to a public repository, it is reported to us and revoked, and the owner is told.

  1. Personal access tokens
  2. API keys
  3. Protected keys
  4. Secret scanning

    Search pages, sections and terms