Skip to content

Updated

Personal Access Tokens

Personal access tokens (PATs) authenticate you to the Management API and the tools built on it, like the Supabase CLI and the MCP server.

When you create a token, you scope it to the organizations, projects, and permissions it needs. For example, a token can read one project's database and view its logs without touching billing or organization settings. Tokens you create in the Supabase Dashboard are scoped by default.

You can still create a token with your account's full access. The Dashboard shows these tokens with a Legacy badge. A token with full access carries every permission on every organization and project you belong to, including ones you create or join later. A full-access token created a year ago can touch a project you created today.

To scope a token you need a Supabase account with a role on the organization or project you want the token to reach. A token's permissions narrow what your account can already do and never grant more. If your role doesn't include a permission (see Access Control), granting that permission to a token has no effect.

You create and scope tokens from your access tokens settings.

Scope a token and use it

This example creates a token that can only read one project's settings, then calls an endpoint outside that scope. Because both calls are reads that every organization role can make, including Read-Only, anyone can run the example.

  1. Go to your access tokens settings and generate a new token.
  2. While creating it, scope the token to one project and grant only the Project settings permission with Read only access.
  3. Copy the token (tokens created with a scope start with sbp_fc) and use it against the Management API, replacing your-project-ref with the project's ref:
export SUPABASE_ACCESS_TOKEN="sbp_fc..."
# Allowed: Project settings Read only unlocks this endpoint
curl "https://api.supabase.com/v1/projects/your-project-ref" \
-H "Authorization: Bearer $SUPABASE_ACCESS_TOKEN"
# Returns the project's details
# Denied: the token lacks the Database permission this endpoint needs
curl -i "https://api.supabase.com/v1/projects/your-project-ref/types/typescript" \
-H "Authorization: Bearer $SUPABASE_ACCESS_TOKEN"
# Returns HTTP 403

To grant exactly what a workflow needs, see Permission scopes for the permission each endpoint requires and MCP tools for the permission each MCP tool requires.

Use a token with the Supabase CLI

The browser flow of supabase login creates a token with your account's full access. To run the CLI with a token you scoped in the Dashboard instead, set it in the SUPABASE_ACCESS_TOKEN environment variable or save it with supabase login --token. Because the environment variable takes precedence over any saved token, it's the right choice for CI.

For example, with a token granted Projects (account-wide) with Read only access, supabase projects list lists the projects the token can reach:

export SUPABASE_ACCESS_TOKEN="sbp_fc..."
supabase projects list

Commands that call the Management API fail with a permission error when the token lacks the required permission. supabase link, for instance, needs Project settings, API keys, and API key secrets, all with Read only access.

Database commands that connect with your database password, such as supabase db push --remote with SUPABASE_DB_PASSWORD set, aren't limited by the token's permissions. A workflow that runs supabase link before supabase db push --remote still needs the permissions supabase link requires.

Permission scopes

Each permission controls read or read-write access to one resource, for example Database, Edge Functions, or Production branches. The permissions and names below match those shown when you create a token. Permissions that unlock neither a public Management API endpoint nor an MCP tool are omitted. A few endpoints need more than one permission. The footnotes call these out.

PermissionAccess requiredManagement API endpoint
Project
Project settingsRead onlyGet JIT access config
Get postgres upgrade eligibility1
Get postgres upgrade status1
Get project
Get services health
List available restore versions
List private link associations
Preview a project transfer
Read and writeCancel a project restoration
Create private link association
Delete a project
Delete private link association
Delete private link association for database
Get pgsodium config
OAuth authorize project claim2
Pause a project
Restart a project
Restore a project
Update a project
Update auth service config3
Update JIT access config
Update pgsodium config
Upgrade postgres version4
Action runsRead onlyCount action runs
Get action run
Get action run logs
List action runs
Read and writeUpdate action run status
AdvisorsRead onlyGet performance advisors
Get security advisors
Run project advisors
Analytics configRead onlyList log drains
Read and writeCreate log drain
Delete log drain
Update log drain
LogsRead onlyGet project logs
Get project logs all
Scrape project metrics
Usage analyticsRead onlyGet project function combined stats
Get project usage API count
Get project usage request count
Platform webhooksRead onlyGet delivery
Get endpoint
List deliveries
List endpoints
Read and writeCreate endpoint
Delete all endpoints
Delete endpoint
Retry delivery
Send test event
Update endpoint
NotebooksRead onlyGet notebook
List notebooks
Read and writeCreate notebook
Delete notebook
Update notebook
Database
BackupsRead onlyGet backup schedule
List all backups
Read and writeDownload project backup
Restore PITR backup
Update backup schedule
DatabaseRead onlyGenerate typescript types
Get database metadata
Get database openapi
Get postgres upgrade eligibility1
Get postgres upgrade status1
Get project config5
Get project PgBouncer config
Read only query
Run a query
Read and writeCreate login role
Delete login roles
Run a query
Upgrade postgres version4
Database configRead onlyGet postgres config
Get project config5
Read and writePatch postgres config
Update database password
Update postgres config
Database JITRead onlyAuthorize JIT access
Get JIT access
Read and writeDelete invite external JIT access
Delete JIT access
Invite external JIT access
List JIT access
Update JIT access
Network bansRead onlyList all network bans
List all network bans enriched
Read and writeDelete network bans
Network restrictionsRead onlyGet network restrictions
Get project config5
Read and writePatch network restrictions
Review network restrictions
Update network restrictions
MigrationsRead onlyGet a migration
List migration history
Read and writeApply a migration
Patch a migration
Rollback migrations
Upsert a migration
Connection poolingRead onlyGet pooler config
Read and writeUpdate pooler config
Read-only modeRead onlyGet read-only mode status
Read and writeDisable read-only mode temporarily
SSL enforcementRead onlyGet project config5
Get SSL enforcement config
Read and writeUpdate SSL enforcement config
Database webhooksRead and writeEnable database webhook
Application services
API keysRead onlyGet project API key
Get project API keys
Get project legacy API keys
Read and writeCreate project API key
Delete project API key
Update project API key
Update project legacy API keys
API key secretsRead onlyGet project API key6
Get project API keys6
Auth configRead onlyGet a SSO provider
Get auth service config
Get project config5
Get project TPA integration
List all SSO provider
List project TPA integrations
Read and writeCreate a SSO provider
Create project TPA integration
Delete a SSO provider
Delete project TPA integration
Update a SSO provider
Update auth service config3
Auth signing keysRead onlyGet legacy signing key
Get project signing key
Get project signing keys
Read and writeCreate legacy signing key
Create project signing key
Remove project signing key
Update project signing key
Data API configRead onlyGet PostgREST service config
Get project config5
Read and writeUpdate PostgREST service config
Data API JWT secretRead onlyGet PostgREST service config7
Edge FunctionsRead onlyGet a function
Get a function body
List all functions
Read and writeBulk update functions
Create a function
Delete a function
Deploy a function
Update a function
Edge function secretsRead onlyList all secrets
Read and writeBulk create secrets
Bulk delete secrets
Realtime configRead onlyGet project config5
Get realtime config
Read and writeShutdown realtime
Update realtime config
StorageRead onlyList all buckets
Storage configRead onlyGet project config5
Get storage config
Read and writeUpdate storage config
ComputeRead onlyGet a compute instance
List all compute instances
Read and writeCreate compute instance upload
Delete a compute instance
Deploy a compute instance
Infrastructure and delivery
Development branchesRead onlyGet a branch
Get a branch config
List all branches
Read and writeCreate a branch
Create a branch
Delete a branch
Diff a branch
Push a branch
Reset a branch
Restore a branch
Update a branch config
Production branchesRead onlyGet a branch
Get a branch config
List all branches
Read and writeCreate a branch
Create a branch
Delete a branch
Diff a branch
Disable preview branching
Merge a branch
Push a branch
Reset a branch
Restore a branch
Update a branch config
Custom domainsRead onlyGet hostname config
Read and writeActivate custom hostname
Delete hostname config
Update hostname config
Verify DNS config
Add-onsRead onlyList project add-ons
Read and writeApply project add-on
Remove project add-on
Disk configRead onlyGet database disk
Get disk utilization
Get project disk auto-scaling config
Read and writeModify database disk
Read replicasRead and writeRemove a read replica
Setup a read replica
Vanity subdomainRead onlyGet vanity subdomain config
Read and writeActivate vanity subdomain config
Check vanity subdomain availability
Deactivate vanity subdomain config
Account and organization
OrganizationsRead onlyList all organizations
Read and writeCreate an organization
Projects (account-wide)Read onlyList all projects
SQL snippets (account-wide)Read onlyGet a snippet
List all snippets
Organization settingsRead onlyGet an organization
Get organization entitlements
Read and writeAssign organization member role
OAuth authorize project claim2
Remove organization members
Transfer a project
Organization membersRead onlyList organization members
List organization members
List organization roles
Read and writeCreate organization invitations
Delete organization invitations
Organization projectsRead onlyGet all projects for organization
List organization GitHub connections
List organization projects
Read and writeCreate a project
Platform webhooks (organization)Read onlyGet delivery
Get endpoint
List deliveries
List endpoints
Read and writeCreate endpoint
Delete all endpoints
Delete endpoint
Retry delivery
Send test event
Update endpoint

MCP tools

A token used to authenticate the MCP server can only call the tools its granted permissions unlock. See Available tools for what each tool does.

MCP toolRequired permission
apply_migrationMigrations (Read and write)
confirm_costNone (always available)
create_branchDevelopment branches (Read and write), or Production branches (Read and write)
create_edge_function_secretEdge function secrets (Read and write) and Edge function secrets (Read only)
create_notebookNotebooks (Read and write)
create_projectOrganization projects (Read and write)
delete_branchProduction branches (Read and write), or Development branches (Read and write)
delete_feedbackNone (always available)
delete_notebookNotebooks (Read only) and Notebooks (Read and write)
deploy_edge_functionEdge Functions (Read and write)
execute_sqlDatabase (Read only)
generate_typescript_typesDatabase (Read only)
get_advisorsAdvisors (Read only)
get_costOrganization settings (Read only) and Projects (account-wide) (Read only)
get_edge_functionEdge Functions (Read only)
get_logsLogs (Read only)
get_notebookNotebooks (Read only)
get_organizationOrganization settings (Read only)
get_projectProject settings (Read only)
get_project_urlProject settings (Read only)
get_publishable_keysAPI keys (Read only)
get_storage_configStorage config (Read only)
list_branchesDevelopment branches (Read only) or Production branches (Read only)
list_edge_functionsEdge Functions (Read only)
list_extensionsDatabase (Read only)
list_migrationsMigrations (Read only)
list_notebooksNotebooks (Read only)
list_organizationsOrganizations (Read only)
list_projectsProjects (account-wide) (Read only)
list_storage_bucketsStorage (Read only)
list_tablesDatabase (Read only)
merge_branchProduction branches (Read and write)
pause_projectProject settings (Read and write)
query_logsLogs (Read only)
rebase_branchProduction branches (Read and write), or Development branches (Read and write)
reset_branchProduction branches (Read and write), or Development branches (Read and write)
restore_projectProject settings (Read and write)
run_notebookNotebooks (Read only) and Database (Read only), or Notebooks (Read only) and Logs (Read only)
search_docsNone (always available)
submit_feedbackNone (always available)
update_storage_configStorage config (Read and write)

Footnotes

  1. Requires Project settings (Read only) and Database (Read only). ↩ ↩2 ↩3 ↩4

  2. Requires Organization settings (Read and write) and Project settings (Read and write). ↩ ↩2

  3. Requires Auth config (Read and write) and Project settings (Read and write). ↩ ↩2

  4. Requires Project settings (Read and write) and Database (Read and write). ↩ ↩2

  5. Requires Database config (Read only), Database (Read only), SSL enforcement (Read only), Network restrictions (Read only), Auth config (Read only), Data API config (Read only), Realtime config (Read only), and Storage config (Read only). ↩ ↩2 ↩3 ↩4 ↩5 ↩6 ↩7 ↩8

  6. Requires API keys (Read only) and API key secrets (Read only). ↩ ↩2

  7. Requires Data API config (Read only) and Data API JWT secret (Read only). ↩