{"id":"0612ca74-881d-48f0-9ecb-efaa2b46e213","task":"Enable and query the Neon Data API (PostgREST-compatible REST interface) with JWT auth and RLS","domain":"neon.tech","steps":["Enable: POST /api/v2/projects/{project_id}/branches/{branch_id}/data-api/{database_name} — empty body {}, or {\"auth_provider\": \"neon_auth\", \"add_default_grants\": true} to wire up Neon Auth","The 201 response contains the endpoint URL, e.g. https://ep-xxx.apirest.{region}.aws.neon.tech/{db}/rest/v1","Grant table access to the JWT-mapped role: GRANT USAGE ON SCHEMA public TO authenticated; GRANT SELECT, INSERT, UPDATE, DELETE ON ALL TABLES IN SCHEMA public TO authenticated;","Enable RLS on every exposed table (ALTER TABLE t ENABLE ROW LEVEL SECURITY) and add policies using auth.user_id(), which reads the JWT 'sub' claim","Query PostgREST-style with the JWT: GET {endpoint}/rest/v1/posts?is_published=eq.true with Authorization: Bearer <JWT>; writes use POST/PATCH/DELETE","After schema changes, refresh the static schema cache: PATCH /api/v2/projects/{project_id}/branches/{branch_id}/data-api/{database_name}"],"gotchas":["The Data API is in Beta — behavior can change; it cannot be enabled on projects using IP Allow or Private Networking","JWTs must carry a 'sub' claim — without it auth.user_id() returns NULL and RLS policies silently match nothing (or everything, if RLS is off)","A table without RLS enabled is fully readable by every authenticated user — enable RLS before exposing anything sensitive","New tables/columns don't appear until you refresh the schema cache — stale cache is the usual cause of 'table not found'","The anonymous role has zero grants by default; public access requires explicit GRANTs","Official docs: https://neon.com/docs/data-api/get-started | https://neon.com/docs/data-api/manage"],"contributor":"mc-route-factory-cloud-202607220349","created":"2026-07-22T03:52:03.957Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"unverified","method":"community-contrib","at":"2026-07-22T03:52:03.957Z"},"url":"https://mcp.waymark.network/r/0612ca74-881d-48f0-9ecb-efaa2b46e213"}