ai schema is managed by Powabase (sources, knowledge bases, agents, sessions, and so on). The public schema is yours — create tables, define relationships, add indexes, and PostgREST will expose them automatically at /rest/v1/{table}. PostgREST honours Row Level Security: the Anon (Publishable) Key respects RLS policies, the Service Role (Secret) Key bypasses them — use the service role server-side only. Both keys, plus the Project URL, are in the Studio’s Connect modal — click the Connect button in your project header (or append ?showConnect=true to any project URL).
Common Patterns
Read with GET /rest/v1/{table} and a select= query parameter. Insert with POST and a JSON body. Update with PATCH and a filter. Delete with DELETE and a filter. Embed related tables with select=,other(). Filter operators (eq, gt, lt, like, in, is, …) follow PostgREST conventions. Always include both apikey and Authorization: Bearer headers, both set to the same key — sending only one returns 401.Reading rows
GET /rest/v1/
List rows from a table or view. Use select= to project columns, filter operators (eq, gt, like, in, …) to filter, order= to sort, limit and offset for pagination. Combine select with embedded relations to fetch joined data in a single request.Table or view name in the public schema
Comma-separated columns. Use ,relation() to embed related rows. Default: *
Order by column, e.g. created_at.desc
Max rows to return
Skip the first N rows
GET /rest/v1/?id=eq.
Read a single row by primary key (or any unique column) using the eq filter. Add Accept: application/vnd.pgrst.object+json to receive a single object instead of an array.Table or view name
Writing rows
POST /rest/v1/
Insert one or many rows. Pass a single JSON object or an array. Add Prefer: return=representation to receive the inserted rows back. Use Prefer: resolution=merge-duplicates with on_conflict= for upsert semantics.Target table
PATCH /rest/v1/
Update rows that match the filter in the query string. Always include a filter — without one, PATCH updates every row in the table.Target table
DELETE /rest/v1/
Delete rows that match the filter in the query string. Always include a filter — without one, DELETE removes every row.Target table
Stored procedures
POST /rest/v1/rpc/
Call a Postgres function (stored procedure) defined in the public schema. Pass arguments as a JSON body. Functions returning a table are listable like a regular endpoint.Postgres function name
Error Responses
| Status | Code | Description |
|---|---|---|
| 401 | unauthorized | Missing or invalid apikey/Authorization headers |
| 403 | rls_denied | Row Level Security policy denied the operation for this user |
| 404 | not_found | Table or view does not exist in the public schema |
| 409 | conflict | Insert violated a unique constraint or foreign key |
| 422 | invalid_request | Malformed filter syntax or invalid column reference |