42501, PGRST205, 42P01: which error is yours?
Match the code in the response. See its HTTP status and whether a grant is the fix.
Codes you get around a new table
| Code | HTTP status | Meaning | Does a grant fix it? |
|---|---|---|---|
42501 | 401 if the request is not signed in, 403 if it is | Insufficient privilege. With permission denied for table the role has no grant. | Yes, when the message names a table, sequence, view, function or schema. No, when it names a row-level security policy. |
PGRST205 | 404 | The table in the URL was not found in the schema cache. | No. Check the table name, the schema and the project, then reload the schema cache. |
42P01 | 404 | No such table: Postgres has no table by that name. | No. The table does not exist where the query looks. |
PGRST204 | 400 | A column named in the columns parameter was not found. | No. |
PGRST202 | 404 | A stale function signature, or the function does not exist. | No. |
42883 | 404 | No such function in the database. | No. |
PGRST106 | 406 | The schema asked for is not in the list of exposed schemas. | No. Expose the schema, then grant usage on it. |
PGRST301 | 401 | The JWT could not be decoded or is invalid. | No. This is the token, not the table. |
PGRST303 | 401 | JWT claims validation or parsing failed. An expired token lands here, with the message JWT expired. | No. This is the token, not the table. |
23505 | 409 | Uniqueness violation. | No. |
23503 | 409 | Foreign key violation. | No. |
Status codes are from the PostgREST error reference (the software behind the Supabase Data API), main branch, read on the date under Sources. A hosted project may run an older release.
401 or 403 for the same missing grant
The same missing grant shows as two different status codes. A signed-out request (role anon) gets 401. A signed-in request (role authenticated) gets 403. Supabase's own troubleshooting page says 42501 errors are often reported by clients as 401 or 403 errors
. Neither status means the key is wrong: read the code field in the response body.
Tell the two "not found" cases from a missing grant
| What the body says | What is true | Next step |
|---|---|---|
"code": "42501" and permission denied for table todos | The table exists and the API can see it. The role may not use it. | Grant the role, then add row level security and policies (tool below). |
"code": "PGRST205" and Could not find the table 'public.todos' in the schema cache | The API does not know the table. | Check spelling and schema. If the table is new, reload the schema cache. |
Status 200 and [] | Grant present, row level security on, no policy lets these rows through. | Add the policy the command needs. |
Write the fix for your tables
One table is free. The whole schema with a rollback file is $9 one-time.
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.
Parsed in your browser. Your SQL is never uploaded, and no site or database is scanned.
Questions
Why do I get 401 when my key is correct?
Because 42501 from a signed-out request is reported as 401. The key was accepted; the anon role has no grant on the table. A token that cannot be decoded gives PGRST301 instead, and an expired one gives PGRST303 (PostgREST main branch; a hosted project may run an older release).
Is PGRST205 caused by the 2026 grant change?
We have not seen an official statement that it is. The documented symptom of a missing grant is 42501 with a hint. PGRST205 means the table name was not found in the schema cache.
Sources
- PostgREST documentation source: Errors (docs/references/errors.rst, main branch), read 2026-11-10
- PostgREST source: Error.hs (src/library/PostgREST/Error.hs, main branch), read 2026-11-10
- Supabase knowledge base: Database API 42501 errors (marked updated 2026-11-03), 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
- Every cause of 42501 on Supabase42501 means "insufficient privilege". Match your message to a row.
- New Supabase table not showing in the APITwo checks tell you if the grant is missing. Then fix it below.
- "Grant the required privileges to the current role with: GRANT ..."The hint names one missing grant. Paste it and get the full set.
- service_role gets "permission denied for table"The secret key skips policies. It does not skip grants. Add one line.