© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•5mo ago•
24 replies
Idris

Realtime error 401 unauthorized

Hi,

In my supabase project I lock down all schemas, tables etc for all roles that dont need them and manually grant it back where I see fit, following deny-by-default principle. I also use api instead of public, following Supabase's harding guidelines. I noticed that Supabase Realtime broke.

I get errors like
"{:error, \"Unable to subscribe to changes with given parameters. An exception happened so please check your connect parameters: [event: *, filter: user_id=eq.3adc3ac9-a617-4828-b7b6-ed04167fc1dc, schema: api, table: profiles_tasks]. Exception: ERROR P0001 (raise_exception) invalid column for filter user_id\"}"
"{:error, \"Unable to subscribe to changes with given parameters. An exception happened so please check your connect parameters: [event: *, filter: user_id=eq.3adc3ac9-a617-4828-b7b6-ed04167fc1dc, schema: api, table: profiles_tasks]. Exception: ERROR P0001 (raise_exception) invalid column for filter user_id\"}"
and
Error 401: Unauthorized
Error 401: Unauthorized


Perhaps supabase realtime has a role I also need to grant usage to
api
api
and the specific tables. Because I have to enable permission per table like this:
grant
select
,
    insert (user_id, fcm_token),
update (user_id, fcm_token),
delete on table api.user_fcm_tokens to authenticated;

grant
select
,
    delete on table api.user_fcm_tokens to service_role;
grant
select
,
    insert (user_id, fcm_token),
update (user_id, fcm_token),
delete on table api.user_fcm_tokens to authenticated;

grant
select
,
    delete on table api.user_fcm_tokens to service_role;


logs:
https://hastebin.com/share/idusunedac.swift
Hastebin
Hastebin is a free web-based pastebin service for storing and sharing text and code snippets with anyone. Get started now.
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

realtime empty payload.new - error 401: Unauthorized
SupabaseSSupabase / help-and-questions
3y ago
Realtime CDC return Error 401 Unautorized
SupabaseSSupabase / help-and-questions
4y ago
Realtime GET erro 401
SupabaseSSupabase / help-and-questions
6d ago
Cannot signin/signup 401 unauthorized
SupabaseSSupabase / help-and-questions
3y ago