REST (PostgREST)
Supabase exposes every table in the public schema as a REST endpoint via PostgREST. This is the surface for reads — filtered queries, embedded relations, ordering, pagination. For writes, prefer the workflow RPCs.
All examples assume the two auth headers are set. RLS scopes every response to your project memberships.
Reading rows
# Publications in the reviewing status, newest first
curl "https://jionfqfmjinkrmzlsghf.supabase.co/rest/v1/publications\
?status=eq.reviewing&order=created_at.desc&select=id,title,status,scheduled_for" \
-H "apikey: $CP_PUBLISHABLE_KEY" \
-H "Authorization: Bearer $CP_ACCESS_TOKEN"
Common query parameters:
| Param | Example | Meaning |
|---|---|---|
select | select=id,title,status | choose columns (and embeds) |
<col>=eq.<v> | status=eq.draft | filter (eq, neq, gt, lt, in, like, …) |
order | order=created_at.desc | sort |
limit / offset | limit=20&offset=40 | paginate |
Embedding relations
PostgREST resolves foreign keys, so you can pull a publication with its promos and media in one call:
curl "https://jionfqfmjinkrmzlsghf.supabase.co/rest/v1/publications\
?id=eq.<uuid>&select=*,promos(*),publication_media(position,media(*))" \
-H "apikey: $CP_PUBLISHABLE_KEY" \
-H "Authorization: Bearer $CP_ACCESS_TOKEN"
Tables you'll read most
| Table | Holds |
|---|---|
projects | the three tenants (slug, name, default_channels) |
collections | campaigns and sections |
publications | articles and their status |
promos | channel-ready copy per publication |
channels | the seeded channel lookup (limits, upload_post_platform) |
media | asset rows (Storage paths) |
reviews | review verdicts + notes |
status_events | append-only transition audit |
See Data model for the full column lists and relationships.
Don't write status directly
PostgREST will happily accept a PATCH — but a status change that isn't a legal transition is rejected by a trigger, and a legal one still skips the intent, audit actor, and side effects the RPCs handle. Route every write through an RPC.