← All errors · SupabaseSupabase database & RLS errors
Supabase branch merge permission error: token needs Production Branches read-write
What you see
Since November 12, 2026, merging a branch into your main project with a scoped personal access token that only has Development Branches: Read-write fails with a permission error. The failure happens when that token calls the Management API Merge a branch endpoint (POST /v1/branches/{branch_id_or_ref}/merge) or the MCP merge_branch tool. Supabase's changelog and docs describe this as a permission error but do not quote the exact error text, so this page does not either. The Merge a branch API reference lists 403 among possible response codes, without documenting a response body. Creating, pushing, resetting, and deleting preview branches with a development-only token still works.
What it means
A merge applies a branch's changes to your production project. Before November 12, 2026, a token meant only for development branches could still write to production through a merge. Supabase now requires a scoped personal access token with Production Branches: Read-write for that step. In the Management API reference, that permission is named branching_production_write. In the personal access tokens guide, the MCP merge_branch tool also requires Production Branches (Read-write). You are affected if you merge with a scoped token that has Development Branches read-write but not Production Branches read-write. Classic personal access tokens are not affected. In the personal access tokens guide, tokens created with your account's full access are shown in the Dashboard with a Legacy badge and already carry every permission on every organization and project you belong to. If a development-only merge fails, your projects, branches, and data stay the same. Supabase plans to add a separate Merge permission later, so a token can merge without full production write access.
Likely causes
- You merge branches with a scoped personal access token that has Development Branches: Read-write but not Production Branches: Read-write.
- The merge is made through the Management API Merge a branch endpoint or the MCP merge_branch tool.
- You tried to add Production Branches read-write to an existing token. You can't change the permissions of an existing token; you have to create a new one.
- Create, push, reset, and delete still work with the development-only token, so the failure only shows up on the merge step.
How to fix it
Confirm you are actually affected. This change applies to scoped personal access tokens used to merge a branch. Classic personal access tokens are not affected. If your token was created with your account's full access (the Dashboard shows a Legacy badge), it already has production write access.
Create a new token in Account > Access Tokens and grant Production Branches read-write. You can't change the permissions of an existing token, so don't try to edit the development-only one.
Use the new token only for the merge step in your CI or scripts. Keep the development-only token for everything else, such as creating and resetting preview branches.
export SUPABASE_ACCESS_TOKEN="sbp_fc..." # token with Production Branches: Read-write curl -X POST "https://api.supabase.com/v1/branches/$BRANCH_REF/merge" \ -H "Authorization: Bearer $SUPABASE_ACCESS_TOKEN"If you merge through the MCP server, the merge_branch tool requires Production Branches (Read-write). Point that tool at the new token. Other branch tools can keep using the development-only token: create_branch, delete_branch, rebase_branch, and reset_branch accept Development Branches (Read-write) or Production Branches (Read-write).
Do not replace the development-only token everywhere. A token you give to CI or an AI agent for preview work should stay without production write access, which is why Supabase made this change.
Still stuck after trying this? Get it fixed for $49, or you don't pay.
Prevent this next time
- Keep schema and RLS policies in migrations (`supabase migration new`) instead of editing production by hand.
- Test each policy as both an anonymous and a signed-in user before shipping.
FAQ
What does "Supabase branch merge permission error: token needs Production Branches read-write" mean?
A merge applies a branch's changes to your production project. Before November 12, 2026, a token meant only for development branches could still write to production through a merge. Supabase now requires a scoped personal access token with Production Branches: Read-write for that step. In the Management API reference, that permission is named branching_production_write. In the personal access tokens guide, the MCP merge_branch tool also requires Production Branches (Read-write). You are affected if you merge with a scoped token that has Development Branches read-write but not Production Branches read-write. Classic personal access tokens are not affected. In the personal access tokens guide, tokens created with your account's full access are shown in the Dashboard with a Legacy badge and already carry every permission on every organization and project you belong to. If a development-only merge fails, your projects, branches, and data stay the same. Supabase plans to add a separate Merge permission later, so a token can merge without full production write access.
What usually causes it?
You merge branches with a scoped personal access token that has Development Branches: Read-write but not Production Branches: Read-write. The merge is made through the Management API Merge a branch endpoint or the MCP merge_branch tool. You tried to add Production Branches read-write to an existing token. You can't change the permissions of an existing token; you have to create a new one. Create, push, reset, and delete still work with the development-only token, so the failure only shows up on the merge step.
How do I fix it?
1. Confirm you are actually affected. This change applies to scoped personal access tokens used to merge a branch. Classic personal access tokens are not affected. If your token was created with your account's full access (the Dashboard shows a Legacy badge), it already has production write access. 2. Create a new token in Account > Access Tokens and grant Production Branches read-write. You can't change the permissions of an existing token, so don't try to edit the development-only one. 3. Use the new token only for the merge step in your CI or scripts. Keep the development-only token for everything else, such as creating and resetting preview branches. 4. If you merge through the MCP server, the merge_branch tool requires Production Branches (Read-write). Point that tool at the new token. Other branch tools can keep using the development-only token: create_branch, delete_branch, rebase_branch, and reset_branch accept Development Branches (Read-write) or Production Branches (Read-write). 5. Do not replace the development-only token everywhere. A token you give to CI or an AI agent for preview work should stay without production write access, which is why Supabase made this change.
Last checked against official docs on . Sources: Supabase changelog: Merging a branch now requires Production Branches read-write, Supabase docs: Merge a branch (Management API), Supabase docs: Personal Access Tokens.
Related errors
- Supabase "Legacy API keys are disabled": migrate anon and service_role keys to publishable and secret keys
- HostedMutationConsentRequiredError on Supabase CLI v3 (functions deploy / secrets / config push / db push in CI)
- permission denied for table (Data API 42501)
More Supabase errors and fixes →
Tools that help
- Railway: Deploy backends and databases; new users get $20 credit.
Some links on this page are affiliate links: if you sign up or buy through them, FixStack may earn a commission at no extra cost to you. Learn more.
Get new fixes weekly
No spam. Unsubscribe anytime. Privacy