Rezin Core Rezin Core Docs Sign in

Database

The data API

Rows of your project's tables as JSON over HTTPS. Row-level security decides which rows the caller gets; the API never widens it.

https://api.rezincore.com/v1/data/<table>

Every request carries the project key in apikey, and normally a user's token in Authorization: Bearer <token>. See who a request acts for.

The examples use:

export API=https://api.rezincore.com
export KEY=rzc_pub_your_publishable_key
export TOKEN=the_signed_in_users_token

Read rows

GET /v1/data/<table>
curl -s "$API/v1/data/notes?pinned=eq.true&order=created_at.desc&limit=20" \
  -H "apikey: $KEY" -H "authorization: Bearer $TOKEN"
{ "rows": [ { "id": "…", "title": "Hello", "pinned": true, "created_at": "2026-11-26T15:04:05.000Z" } ] }

Filters

A filter is a query parameter: column=operator.value. Several filters must all match.

OperatorMeaningExample
eqequalsstatus=eq.open
neqdoes not equalstatus=neq.closed
gt, gtegreater than, or equalamount=gte.100
lt, lteless than, or equalcreated_at=lt.2026-12-01
likematches a pattern, case-sensitive; * is the wildcardtitle=like.Report*
ilikethe same, ignoring casetitle=ilike.*invoice*
inis one of a liststatus=in.(open,waiting)
isis or is not nullclosed_at=is.null, closed_at=is.notnull

The same column can be filtered twice: amount=gte.100&amount=lt.500.

Other options

ParameterMeaningDefault
select=a,bOnly these columnsall columns
order=a.asc,b.descSort orderno order promised
limitHow many rows, 1 to 1000100
offsetHow many rows to skip0

For stable paging, always send order with a column that does not repeat, such as the primary key.

select, order, limit and offset are reserved words here: a column with one of those names cannot be used as a filter.

Add rows

POST /v1/data/<table>

Send one row as a JSON object, or up to 500 rows as a list. The answer is 201 with the rows as stored, defaults included.

curl -s $API/v1/data/notes -H "apikey: $KEY" -H "authorization: Bearer $TOKEN" \
  -H "content-type: application/json" -d '{"title":"Hello"}'
{ "rows": [ { "id": "…", "organization_id": "…", "title": "Hello", "pinned": false } ] }

If the table has an organization_id column and the row does not say, it is set to the caller's organization. Naming another organization is refused by your policy's "with check".

A value that is a JSON object or list is stored as JSON, for a jsonb column.

Change rows

PATCH /v1/data/<table>?<filter>

Send the values to change as a JSON object. A filter is required: without one the answer is 400 filter_required. The answer has the changed rows.

curl -s -X PATCH "$API/v1/data/notes?id=eq.$ID" -H "apikey: $KEY" -H "authorization: Bearer $TOKEN" \
  -H "content-type: application/json" -d '{"pinned":true}'
{ "rows": [ { "id": "…", "title": "Hello", "pinned": true } ] }

If no row matches, or the caller may not see the matching rows, rows is empty. That is not an error.

Delete rows

DELETE /v1/data/<table>?<filter>

A filter is required. The answer says how many rows went.

curl -s -X DELETE "$API/v1/data/notes?id=eq.$ID" -H "apikey: $KEY" -H "authorization: Bearer $TOKEN"
{ "deleted": 1 }

From your own server, without a user

With a secret key and no token, name the organization to act for:

curl -s "$API/v1/data/notes?limit=50" \
  -H "apikey: $SECRET_KEY" -H "x-organization-id: 0d9c8b7a-6f5e-4d3c-8b2a-1f0e9d8c7b6a"

Row-level security still applies. core.app_org() is that organization and core.app_user() is null, so a policy that compares a column with core.app_user() lets nothing through.

What the API will not do

  • Reach a table outside the project, or a table the application's role has not been allowed to touch (403 not_allowed).
  • Join tables, count, or aggregate. Make a view or a function in SQL for that, or do it in your application.
  • Change or delete without a filter.
  • Echo your data in an error. A refusal says what kind of thing went wrong and names the constraint or column, never the values.

Errors you will meet

StatusCodeWhen
400bad_requestAn unknown column, a malformed filter, a wrong type, a missing required value
400filter_requiredPATCH or DELETE without a filter
401sign_in_requiredA publishable key with no token
401signed_outThe token has ended
403not_allowedThe application's role may not do that to this table, or the row is outside what the caller may write
404not_foundNo such table
409conflictA unique value already exists, or a linked row does not
408timeoutThe request took too long

The full list is on Errors. Every call is on the audit trail: who, which table, how many rows, which fields were changed. Never the values.

This page as Markdown · llms.txt · Rezin Core is in development and available by invitation.