Every cause of 42501 on Supabase
42501 means "insufficient privilege". Match your message to a row.
| Cause | Typical message | Fix |
|---|---|---|
| Missing table privileges | permission denied for table your_table | Grant the role the privilege it needs. The tool on this page writes it. |
| Forbidden schema | 42501 on a request that reaches into auth or vault | API roles cannot access these schemas by design. Supabase mentions a security definer function as the way around it. |
| Custom schema | 42501 on a table in a schema you created | Give the Data API permission to query the schema. Supabase's custom schemas guide has the grants. |
| Column-level restrictions | 42501 on a query that touches a restricted column, including select * | Select only permitted columns, or grant the column. |
| Row level security on write | 42501 with a row-level security message on insert or update | Add or correct the policy. This is a policy problem, not a grant problem. |
| Sequence privileges | permission denied for sequence your_table_id_seq | Grant usage on the sequence. |
Rows 1 to 5 are from Supabase's "Database API 42501 errors" page (marked updated 2026-11-03, read 2026-11-10). Row 6 comes from the PostgreSQL manual and our own test against Postgres. Clients often report 42501 as HTTP 401 or 403.
Find 42501 errors in your logs
Supabase suggests this query in the SQL Editor:
select
timestamp,
event_message,
log_attributes['parsed.error_severity'] as error_severity,
log_attributes['parsed.user_name'] as user_name,
log_attributes['parsed.query'] as query,
log_attributes['parsed.detail'] as detail,
log_attributes['parsed.hint'] as hint
from logs
where
source = 'postgres_logs'
and log_attributes['parsed.error_severity'] in ('ERROR', 'FATAL', 'PANIC')
and log_attributes['parsed.sql_state_code'] = '42501'
order by timestamp desc
limit 100;Write the fix for your tables
One table is free. The whole schema with a rollback file is $9 one-time, free during launch.
Waiting for a paste.
Who can reach each table
Your tables show up here, one row each, with a choice of who can reach them.
The SQL appears here as soon as a table is found.
Parsed in your browser. Your SQL is never uploaded, and no site or database is scanned.
Questions
Which cause is the common one since late 2026?
For a table you just created, the missing table grant. New tables in public no longer receive grants automatically.
Sources
- Supabase knowledge base: Database API 42501 errors (marked updated 2026-11-03), read 2026-11-10
- Supabase docs: Using Custom Schemas, read 2026-11-10
- PostgreSQL manual: Sequence Manipulation Functions, read 2026-11-10
- Supabase changelog: Breaking Change: Tables not exposed to Data and GraphQL API automatically (published 2026-04-28), read 2026-11-10
Related
- Bolt app says "permission denied for table"The new table has no grants. Paste it below and copy a fix prompt made for Bolt.
- Public read-only tableAnyone reads. Only your server writes. Here is the SQL.
- 42501: permission denied for tableThe role has no grant on the table. Paste the error or your table and get the SQL.
- Grants for anon, authenticated and service_roleThree roles, four privileges. This is the grid the tool fills in.