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.
We recommend scoping every token, especially tokens for AI agents, automation scripts, and CI environments. If a token leaks, the blast radius stays small.
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.
- Go to your access tokens settings and generate a new token.
- While creating it, scope the token to one project and grant only the Project Settings permission with Read access.
- Copy the token (tokens created with a scope start with
sbp_fc) and use it against the Management API, replacingyour-project-refwith the project's ref:
export SUPABASE_ACCESS_TOKEN="sbp_fc..."# Allowed: Project Settings Read unlocks this endpointcurl "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 needscurl -i "https://api.supabase.com/v1/projects/your-project-ref/types/typescript" \ -H "Authorization: Bearer $SUPABASE_ACCESS_TOKEN"# Returns HTTP 403To 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 access, supabase projects list lists the projects the token can reach:
export SUPABASE_ACCESS_TOKEN="sbp_fc..."supabase projects listCommands 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 access.
Database commands that connect with your database password, such as supabase db push with SUPABASE_DB_PASSWORD set, aren't limited by the token's permissions. A workflow that runs supabase link before supabase db push 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.
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 tool | Required permission |
|---|---|
apply_migration | Migrations (Read-write) |
confirm_cost | None (always available) |
create_branch | Development Branches (Read-write) or Production Branches (Read-write) |
create_edge_function_secret | Edge Function Secrets (Read-write) and Edge Function Secrets (Read) |
create_project | Organization Projects (Read-write) |
delete_branch | Production Branches (Read-write) or Development Branches (Read-write) |
deploy_edge_function | Edge Functions (Read-write) |
execute_sql | Database (Read) |
generate_typescript_types | Database (Read) |
get_advisors | Advisors (Read) |
get_cost | Organization Settings (Read) and Projects (account-wide) (Read) |
get_edge_function | Edge Functions (Read) |
get_logs | Logs (Read) |
get_notebook | Notebooks (Read) |
get_organization | Organization Settings (Read) |
get_project | Project Settings (Read) |
get_project_url | Project Settings (Read) |
get_publishable_keys | API Keys (Read) |
get_storage_config | Storage Config (Read) |
list_branches | Development Branches (Read) or Production Branches (Read) |
list_edge_functions | Edge Functions (Read) |
list_extensions | Database (Read) |
list_migrations | Migrations (Read) |
list_notebooks | Notebooks (Read) |
list_organizations | Organizations (Read) |
list_projects | Projects (account-wide) (Read) |
list_storage_buckets | Storage (Read) |
list_tables | Database (Read) |
merge_branch | Production Branches (Read-write) or Development Branches (Read-write) |
pause_project | Project Settings (Read-write) |
query_logs | Logs (Read) |
rebase_branch | Production Branches (Read-write) or Development Branches (Read-write) |
reset_branch | Production Branches (Read-write) or Development Branches (Read-write) |
restore_project | Project Settings (Read-write) |
search_docs | None (always available) |
update_storage_config | Storage Config (Read-write) |
Footnotes#
-
Requires Project Settings (Read) and Database (Read). ↩ ↩2 ↩3 ↩4
-
Requires Organization Settings (Read-write) and Project Settings (Read-write). ↩ ↩2
-
Requires Auth Config (Read-write) and Project Settings (Read-write). ↩ ↩2
-
Requires Project Settings (Read-write) and Database (Read-write). ↩ ↩2
-
Requires Database Config (Read), Database (Read), SSL Enforcement (Read), Network Restrictions (Read), Auth Config (Read), Data API Config (Read), Realtime Config (Read), and Storage Config (Read). ↩ ↩2 ↩3 ↩4 ↩5 ↩6 ↩7 ↩8
-
Requires Data API Config (Read) and Data API JWT Secret (Read). ↩