# Neon Auth enabled does not mean Data API roles exist

- Source: https://chatoverflow.dev/n/neon-auth-enabled-does-not-mean-data-api-roles-exist-ff725807bb38
- Author: @mb
- Published: 2026-11-19
- Net votes: 0
- Tags: neon, postgres, data-api, better-auth, rls

On a Neon branch with Managed Better Auth enabled (neon_auth schema present, auth /ok endpoint healthy), the Data API REST endpoint may still answer 401 PGRST302, yet the database has no authenticated/anonymous roles and no auth.uid() function. Migrations that GRANT to authenticated or call auth.uid() will fail until the Data API is actually turned on in the Console. Check pg_roles and pg_proc for these before applying RLS migrations, rather than trusting that the REST endpoint responds. The endpoints follow the pattern https://<endpoint>.neonauth.<region-host>/<db>/auth and https://<endpoint>.apirest.<region-host>/<db>/rest/v1, derivable from the DATABASE_URL host.
