Data tables API

Routes to manage data tables and rows.

Routes to manage data tables and rows. See Filter rows.

List data tables

GET /api/v1/tables

Answer: 200. Fields: items.

Create a data table

POST /api/v1/tables

This route needs the admin role.

Body

Name Type Required Notes
name string Yes
description string No Maximum length: 500.
columns array Yes

Answer: 201. Fields: id, name, description, columns, rowCount.

Get a data table by id or name

GET /api/v1/tables/{id}

Path parameters

Name Type Required Notes
id string Yes

Answer: 200. Fields: id, name, description, columns, rowCount.

Change a table

PATCH /api/v1/tables/{id}

Rename the table. Add, rename, retype, or delete columns.

This route needs the admin role.

Path parameters

Name Type Required Notes
id string Yes

Body

Name Type Required Notes
name string No
description string No Maximum length: 500.
ops array No Items: 1 to 20.

Answer: 200. Fields: id, name, description, columns, rowCount.

Delete a data table and its rows

DELETE /api/v1/tables/{id}

This route needs the admin role.

Path parameters

Name Type Required Notes
id string Yes

Answer: 200. Fields: deleted.

List rows in insert order

GET /api/v1/tables/{id}/rows

Path parameters

Name Type Required Notes
id string Yes

Query parameters

Name Type Required Notes
limit integer No Default: 100. Range: 1 to 1000.
cursor string No Maximum length: 512.

Answer: 200. Fields: rows, nextCursor.

Insert rows

POST /api/v1/tables/{id}/rows

Zerodot checks each row against the column schema.

Path parameters

Name Type Required Notes
id string Yes

Body

Name Type Required Notes
rows array Yes Items: 1 to 1000.

Answer: 201. Fields: count, rows.

Update the rows that match a filter

PATCH /api/v1/tables/{id}/rows

To update all rows without a filter, send all: true.

Path parameters

Name Type Required Notes
id string Yes

Body

Name Type Required Notes
filter object No
all boolean No
set object No
increment object No

Answer: 200. Fields: count, rows.

Find rows with a filter and a sort

POST /api/v1/tables/{id}/rows/query

Path parameters

Name Type Required Notes
id string Yes

Body

Name Type Required Notes
filter object No
sort array No
limit integer No Default: 100. Range: 1 to 1000.
cursor string or null No

Answer: 200. Fields: rows, nextCursor.

Update one row

PATCH /api/v1/tables/{id}/rows/{rowId}

Path parameters

Name Type Required Notes
id string Yes
rowId UUID Yes

Body

Name Type Required Notes
set object Yes

Answer: 200. Fields: id, createdAt, updatedAt.

Delete one row

DELETE /api/v1/tables/{id}/rows/{rowId}

Path parameters

Name Type Required Notes
id string Yes
rowId UUID Yes

Answer: 200. Fields: deleted.

Filter rows

A filter is one condition, or a group of filters.

{
  "filter": {
    "and": [
      { "field": "status", "op": "eq", "value": "open" },
      { "field": "total", "op": "gte", "value": 100 }
    ]
  },
  "sort": [{ "field": "total", "direction": "desc" }],
  "limit": 100
}
  • Operators: eq, neq, gt, gte, lt, lte, in, contains, isNull.
  • Groups: and, or.
  • A filter can have 4 levels and 20 conditions. An in list can have 100 values.
  • A sort can have 3 fields.

Change this page on GitHub