Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.powabase.ai/llms.txt

Use this file to discover all available pages before exploring further.

Each project has its own Postgres database. The 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: anon keys respect RLS policies; service-role keys bypass them. Use service-role server-side only.

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.

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
string
required
Table or view name in the public schema
select
string
Comma-separated columns. Use ,relation() to embed related rows. Default: *
order
string
Order by column, e.g. created_at.desc
limit
integer
Max rows to return
offset
integer
Skip the first N rows
response = requests.get(f"{BASE_URL}/rest/v1/users?select=id,email&limit=20", headers=headers)

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
string
required
Table or view name
response = requests.get(f"{BASE_URL}/rest/v1/users?id=eq.{user_id}", headers={**headers, "Accept": "application/vnd.pgrst.object+json"})

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.
table
string
required
Target table
{ "email": "ana@acme.io", "role": "admin" }
response = requests.post(f"{BASE_URL}/rest/v1/users", headers={**headers, "Prefer": "return=representation"}, json={"email": "ana@acme.io", "role": "admin"})

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.
table
string
required
Target table
{ "role": "viewer" }
response = requests.patch(f"{BASE_URL}/rest/v1/users?id=eq.{user_id}", headers=headers, json={"role": "viewer"})

DELETE /rest/v1/

Delete rows that match the filter in the query string. Always include a filter — without one, DELETE removes every row.
table
string
required
Target table
response = requests.delete(f"{BASE_URL}/rest/v1/users?id=eq.{user_id}", headers=headers)

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.
function_name
string
required
Postgres function name
{ "arg1": "value", "arg2": 42 }
response = requests.post(f"{BASE_URL}/rest/v1/rpc/get_user_stats", headers=headers, json={"user_id": "..."})

Error Responses

StatusCodeDescription
401unauthorizedMissing or invalid apikey/Authorization headers
403rls_deniedRow Level Security policy denied the operation for this user
404not_foundTable or view does not exist in the public schema
409conflictInsert violated a unique constraint or foreign key
422invalid_requestMalformed filter syntax or invalid column reference