REST API - Data#

CRUD over your project's tables. Table name is a slug, e.g. profiles, messages, users (the managed auth users table is always available, read-only).

List rows#

GET /data/{table}
Text
curl "https://api.rafikidb.com/api/v1/data/profiles?limit=25" \
  -H "X-AFRIBASE-API-Key: raf_live_..."
Bash

Query parameters#

ParamExampleDescription
selectselect=id,full_nameProject only these columns
{column}nationality=eq.TanzaniaFilter (see operators)
orderorder=created_at.desc,full_name.ascSort columns
limitlimit=50Max 200
offsetoffset=100Offset pagination
cursorcursor={last_id}Keyset pagination (created_at ordering)
countcount=exactReturn only { "count": n }

Filter operators#

OperatorExample
eqstatus=eq.active
neqstatus=neq.archived
gt / gteage=gt.18 / age=gte.18
lt / lteprice=lt.10000
likename=like.%asha%
ilikename=ilike.%ASHA%
isuser_id=is.null / user_id=is.not.null
instatus=in.(active,pending)

Columns are validated against the table metadata; values are parameterized.

Get a row#

GET /data/{table}/{id}
Text

Insert#

POST /data/{table}
Text
{ "full_name": "Asha Mwinyi", "nationality": "Tanzania" }
JSON

Returns the created row. Server fills id, created_at, updated_at, deleted_at.

Update#

PATCH /data/{table}/{id}
Text
{ "nationality": "Kenya" }
JSON

Delete (soft)#

DELETE /data/{table}/{id}
Text

The users table#

users is the managed auth users table for every project:

  • Lists project users (email, phone, full_name, is_active, timestamps)
  • Read-only over the data API: writes return 400
  • Schema (id, email, phone, full_name, is_active, created_at, updated_at) is managed by the platform; columns cannot be modified

RLS#

Policies on the table decide what each request can do. See Security (RLS).