OpenThink Cloud

Data API

Read and write the Databases of a project over HTTPS: filters, sorting, cursor pagination and SQL.

The Data API is Think Store's public endpoint. One host serves every project, and the project is part of the path, as in Google Cloud APIs. {project} is the project ID; {table} is a Database's ID or its name.

MethodPathDoes
GET/v1/projects/{project}/tablesList the Databases of the project
GET/v1/projects/{project}/tables/{table}Columns and row count of one Database
GET/v1/projects/{project}/tables/{table}/rowsRows, with filters, sorting and a cursor
POST/v1/projects/{project}/tables/{table}/rowsInsert one row or up to 500
GET/v1/projects/{project}/tables/{table}/rows/{row}One row
PATCH/v1/projects/{project}/tables/{table}/rows/{row}Change some cells; null clears a cell
DELETE/v1/projects/{project}/tables/{table}/rows/{row}Delete a row
POST/v1/projects/{project}/sqlRun one SELECT over the project's Databases

Authenticate

Send a project API key as a bearer token. Create keys in the console under API keys. A key belongs to one project: calling another project with it returns 403. A read-only key can read and run SQL; writing needs a read-and-write key. A key limited to some tables sees only those tables.

bash
curl https://store.openthink.app/v1/projects/$PROJECT/tables \
  -H "Authorization: Bearer $THK"

Read rows

bash
curl -G https://store.openthink.app/v1/projects/$PROJECT/tables/Orders/rows \
  -H "Authorization: Bearer $THK" \
  --data-urlencode "Status=in.(New,Paid)" \
  --data-urlencode "Total=gte.100" \
  --data-urlencode "order=Total.desc" \
  --data-urlencode "select=Customer,Total" \
  --data-urlencode "limit=50"
json
{
  "rows": [
    { "id": "3f2a…", "createdAt": "2026-12-03T02:10:00.000Z", "updatedAt": "…", "createdBy": { "id": "…", "name": "An" },
      "values": { "Customer": "An", "Total": 240 }, "url": "https://openthink.app/n/…?row=3f2a…" }
  ],
  "nextCursor": "WyJwMjpkIiwyNDAsIjNmMmEiXQ"
}

Each query parameter named after a column is a filter, written column=operator.value as in PostgREST. Filters combine with AND. Add not. before the operator to negate it. Values follow the column type: numbers for Number, true or false for Checkbox, option names for Select. The row fields id, createdAt, updatedAt and createdBy filter too, unless a column has the same name.

OperatorMeansExample
eq, neqequal, not equalStatus=eq.Paid
gt, gte, lt, ltegreater, lessTotal=gte.100
inone of a listStatus=in.(New,Paid)
liketext pattern, * is any textName=like.*pho*
isthe cell is emptyNote=is.null, Note=not.is.null
csa multi-value cell contains all of theseTags=cs.{red,blue}
  • order=Column.asc|desc sorts by one column; rows with the same value follow by ID. Without it, rows come in the table's own order.
  • select=A,B returns only those columns.
  • limit is 1 to 1,000, 100 by default.
  • nextCursor is null on the last page. Pass it back as cursor with the same order to get the next page. The cursor marks a position, not an offset, so rows added or deleted between pages do not make a page repeat a row.
  • Filtering, sorting and paging run inside the project's store and only the page leaves it. Turn on Index for the columns you filter and sort large tables by.

Write rows

bash
curl -X POST https://store.openthink.app/v1/projects/$PROJECT/tables/Orders/rows \
  -H "Authorization: Bearer $THK" -H "Content-Type: application/json" \
  -d '{ "rows": [ { "values": { "Customer": "An", "Total": 240, "Status": "New" } } ] }'

Cells are keyed by column name. Select takes option names and adds new ones; dates are yyyy-mm-dd; Checkbox takes true or false. A batch is written in one transaction: if one row breaks a constraint, none is written and the call returns 409 with code CONSTRAINT.

SQL

bash
curl -X POST https://store.openthink.app/v1/projects/$PROJECT/sql \
  -H "Authorization: Bearer $THK" -H "Content-Type: application/json" \
  -d '{ "sql": "SELECT \"Status\", SUM(\"Total\") AS total FROM \"Orders\" GROUP BY 1", "params": [] }'

One SELECT per call, over the Databases of the project, run inside the store. It returns { columns, rows }. Write with the row endpoints. See Query with SQL for the dialect.

Errors

Errors are JSON { error, code }. code follows Google API status codes.

HTTPcodeWhen
400INVALID_ARGUMENTA bad filter, column, cursor or body
401UNAUTHENTICATEDNo key, or a revoked or expired key
403PERMISSION_DENIEDA key of another project, or a read-only key writing
403POLICYA table policy refuses the change
404NOT_FOUNDNo such project, table or row
409CONSTRAINTA required, unique or relation constraint
500INTERNALSomething failed on our side

Last updated 2026-12-03 UTC. Something wrong or missing? Send feedback.