Short answer
Run the grants query below to see what anon and authenticated may do on the table, then grant only what the app needs, such as select to anon or select, insert, update and delete to authenticated. Keep RLS on with policies, because the grant opens the table to the API. If the error names a sequence, column or schema, see the matching cause below.
Rather not fix it yourself? App Fix Ticket starts with a fixed-price diagnosis, then a fixed price for the fix before any fix work.
Why the role is denied, and the fix
01
The table has no grant for the API roles
“A table isn't reachable through the Data API unless you have granted a role privileges on it.” Supabase, Securing your API
Tables made with Automatically expose new tables turned off, or after a revoke in SQL, have no privileges for anon or authenticated. The error’s hint names the exact grant statement. Check, then grant.
-- what anon and authenticated may do now select grantee, privilege_type from information_schema.role_table_grants where table_schema = 'public' and table_name = 'your_table' and grantee in ('anon', 'authenticated'); -- RLS and a policy first (example policy), then the grant alter table public.your_table enable row level security; create policy "own rows" on public.your_table for select to authenticated using (user_id = (select auth.uid())); grant select, insert, update, delete on table public.your_table to authenticated;02
The grant opens the table, so keep RLS on
“Granting privileges allows access to your table through the Data API, so you should ensure you enable RLS and write appropriate policies to protect your data.” Supabase, Database API 42501 errors
A grant lets the role reach every row. Turn RLS on and write policies before you grant, so the grant and the policies land in the same migration.
03
select * reads a restricted column
“This includes using select *, as it expands to include forbidden columns.” Supabase, Database API 42501 errors
If some columns are limited to certain roles, select * asks for them too and fails. Name the columns the app needs.
04
The table is in auth, vault or a custom schema
“API roles cannot access certain schemas, most notably auth and vault.” Supabase, Database API 42501 errors
The API roles can’t read auth or vault, by design. Keep the data you need in a public table, such as profiles. A custom schema has to be exposed in the API settings and granted to the roles.
05
Inserts fail with permission denied for sequence
A serial id uses a sequence, and inserting needs usage on it too. Grant usage on the sequence, or use an identity column.
grant usage, select on sequence public.your_table_id_seq to authenticated;
Checked against the vendor’s docs on : Supabase troubleshooting: Database API 42501 errors; Supabase docs: Securing your API.
Rather hand it over?
Fixed scope, fixed price, paid upfront. The work happens in writing; no call needed.
- from $450App Fix TicketOne reproducible bug in an existing mobile or web app, diagnosed and fixed.See scope and start
- from $450AI-Built App RescueA Lovable, Bolt or Cursor app checked end to end in 3 days, then its worst problems fixed at a fixed price.No issues worth fixing, no charge. If the Launch Check finds nothing rated medium or higher, Simon refunds the full $450. You keep the report either way. This applies to the first 10 Launch Checks bought after October 30, 2026.See scope and start
“Very responsive, attentive to fixing bugs, and completed the project as needed! Thank you!”
Related: Supabase “new row violates row-level security policy” · Supabase permission denied for schema auth · Supabase anon key exposed · Supabase permission denied to change default privileges