Flikk
API

Tables

Create tables, write rows, and query them from code.

Create a table

Create a table with a table slug, a name, and its columns. Each column needs a column slug and a type, and GET /api/meta/types lists the types you can use.

curl -X POST https://api.flikk.dev/api/tables \
  -H "Authorization: Bearer flk_your_api_key" \
  -H "x-org-slug: your-org" \
  -H "Content-Type: application/json" \
  -d '{
    "table": "customers",
    "name": "Customers",
    "columns": [
      { "column": "name", "type": "text" },
      { "column": "email", "type": "email" }
    ]
  }'
flikk tables create --name Customers \
  --columns '[{ "column": "name", "type": "text" }, { "column": "email", "type": "email" }]' \
  -o your-org

The CLI makes the slug from the name, and --slug sets your own.

List tables

List your organization's tables, or fetch one by its slug to see its columns.

curl https://api.flikk.dev/api/tables/customers \
  -H "Authorization: Bearer flk_your_api_key" \
  -H "x-org-slug: your-org"
flikk tables get customers -o your-org

Leave out the slug (GET /api/tables or flikk tables list) to list every table.

Insert rows

Insert one row as values, keyed by column slug. The response is the stored row with its id. To insert up to 1000 rows in one call, send them as rows to POST /api/tables/{table}/rows/bulk.

curl -X POST https://api.flikk.dev/api/tables/customers/rows \
  -H "Authorization: Bearer flk_your_api_key" \
  -H "x-org-slug: your-org" \
  -H "Content-Type: application/json" \
  -d '{ "values": { "name": "Ana", "email": "ana@example.com" } }'
flikk tables insert customers --values '{ "name": "Ana", "email": "ana@example.com" }' -o your-org

The CLI takes one row as an object or many as an array.

Query rows

Send a where condition to get the rows that match it. A rule compares a column (left) with a value (right) using an op, and a group joins rules with and or or.

curl -X POST https://api.flikk.dev/api/tables/customers/rows/query \
  -H "Authorization: Bearer flk_your_api_key" \
  -H "x-org-slug: your-org" \
  -H "Content-Type: application/json" \
  -d '{
    "where": { "kind": "rule", "left": "email", "op": "ends_with", "right": "@example.com" },
    "pageSize": 50
  }'
flikk tables query customers \
  --where '{ "kind": "rule", "left": "email", "op": "ends_with", "right": "@example.com" }' \
  --limit 50 -o your-org

This group matches customers named Ana or Bia:

{
  "kind": "group",
  "conj": "or",
  "items": [
    { "kind": "rule", "left": "name", "op": "is", "right": "Ana" },
    { "kind": "rule", "left": "name", "op": "is", "right": "Bia" }
  ]
}

The operators are is, is_not, less, less_or_equal, greater, greater_or_equal, contains, not_contains, starts_with, ends_with, is_empty, is_not_empty, is_any_of, has_all_of, within and matches. is_empty and is_not_empty take no right.

A page holds up to pageSize rows, at most 1000. Pass back nextCursor as cursor for the next page, and stop when the response has no nextCursor. To count the matches without fetching them, send the same where to POST /api/tables/{table}/rows/count.

Update rows

Send a patch with the new values and pick the rows with either ids or a where condition. The response holds the changed rows.

curl -X PATCH https://api.flikk.dev/api/tables/customers/rows \
  -H "Authorization: Bearer flk_your_api_key" \
  -H "x-org-slug: your-org" \
  -H "Content-Type: application/json" \
  -d '{
    "where": { "kind": "rule", "left": "email", "op": "is", "right": "ana@example.com" },
    "patch": { "name": "Ana Souza" }
  }'
flikk tables update customers \
  --where '{ "kind": "rule", "left": "email", "op": "is", "right": "ana@example.com" }' \
  --set '{ "name": "Ana Souza" }' -o your-org

Delete rows

Pick the rows with either ids or a where condition. The response holds the number of rows deleted.

curl -X DELETE https://api.flikk.dev/api/tables/customers/rows \
  -H "Authorization: Bearer flk_your_api_key" \
  -H "x-org-slug: your-org" \
  -H "Content-Type: application/json" \
  -d '{ "where": { "kind": "rule", "left": "email", "op": "is", "right": "ana@example.com" } }'
flikk tables delete customers \
  --where '{ "kind": "rule", "left": "email", "op": "is", "right": "ana@example.com" }' \
  -o your-org

Query with SQL

Run a read-only select over your organization's tables, naming each table by its slug. The response holds the rows, at most 1000, and cut is true when the query matched more.

curl -X POST https://api.flikk.dev/api/queries/run \
  -H "Authorization: Bearer flk_your_api_key" \
  -H "x-org-slug: your-org" \
  -H "Content-Type: application/json" \
  -d '{ "sql": "select name, email from customers order by name" }'
flikk tables sql "select name, email from customers order by name" -o your-org

On this page