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 only 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 only 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 only 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 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.
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 and write) |
confirm_cost | None (always available) |
create_branch | Development branches (Read and write), or Production branches (Read and write) |
create_edge_function_secret | Edge function secrets (Read and write) and Edge function secrets (Read only) |
create_notebook | Notebooks (Read and write) |
create_project | Organization projects (Read and write) |
delete_branch | Production branches (Read and write), or Development branches (Read and write) |
delete_feedback | None (always available) |
delete_notebook | Notebooks (Read only) and Notebooks (Read and write) |
deploy_edge_function | Edge Functions (Read and write) |
execute_sql | Database (Read only) |
generate_typescript_types | Database (Read only) |
get_advisors | Advisors (Read only) |
get_cost | Organization settings (Read only) and Projects (account-wide) (Read only) |
get_edge_function | Edge Functions (Read only) |
get_logs | Logs (Read only) |
get_notebook | Notebooks (Read only) |
get_organization | Organization settings (Read only) |
get_project | Project settings (Read only) |
get_project_url | Project settings (Read only) |
get_publishable_keys | API keys (Read only) |
get_storage_config | Storage config (Read only) |
list_branches | Development branches (Read only) or Production branches (Read only) |
list_edge_functions | Edge Functions (Read only) |
list_extensions | Database (Read only) |
list_migrations | Migrations (Read only) |
list_notebooks | Notebooks (Read only) |
list_organizations | Organizations (Read only) |
list_projects | Projects (account-wide) (Read only) |
list_storage_buckets | Storage (Read only) |
list_tables | Database (Read only) |
merge_branch | Production branches (Read and write) |
pause_project | Project settings (Read and write) |
query_logs | Logs (Read only) |
rebase_branch | Production branches (Read and write), or Development branches (Read and write) |
reset_branch | Production branches (Read and write), or Development branches (Read and write) |
restore_project | Project settings (Read and write) |
run_notebook | Notebooks (Read only) and Database (Read only), or Notebooks (Read only) and Logs (Read only) |
search_docs | None (always available) |
submit_feedback | None (always available) |
update_storage_config | Storage config (Read and write) |
Footnotes
-
Requires Project settings (Read only) and Database (Read only). ↩ ↩2 ↩3 ↩4
-
Requires Organization settings (Read and write) and Project settings (Read and write). ↩ ↩2
-
Requires Auth config (Read and write) and Project settings (Read and write). ↩ ↩2
-
Requires Project settings (Read and write) and Database (Read and write). ↩ ↩2
-
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
-
Requires API keys (Read only) and API key secrets (Read only). ↩ ↩2
-
Requires Data API config (Read only) and Data API JWT secret (Read only). ↩