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.
| Method | Path | Does |
|---|---|---|
| GET | /v1/projects/{project}/tables | List the Databases of the project |
| GET | /v1/projects/{project}/tables/{table} | Columns and row count of one Database |
| GET | /v1/projects/{project}/tables/{table}/rows | Rows, with filters, sorting and a cursor |
| POST | /v1/projects/{project}/tables/{table}/rows | Insert 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}/sql | Run 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.
curl https://store.openthink.app/v1/projects/$PROJECT/tables \
-H "Authorization: Bearer $THK"Read rows
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"{
"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.
| Operator | Means | Example |
|---|---|---|
eq, neq | equal, not equal | Status=eq.Paid |
gt, gte, lt, lte | greater, less | Total=gte.100 |
in | one of a list | Status=in.(New,Paid) |
like | text pattern, * is any text | Name=like.*pho* |
is | the cell is empty | Note=is.null, Note=not.is.null |
cs | a multi-value cell contains all of these | Tags=cs.{red,blue} |
order=Column.asc|descsorts by one column; rows with the same value follow by ID. Without it, rows come in the table's own order.select=A,Breturns only those columns.limitis 1 to 1,000, 100 by default.nextCursorisnullon the last page. Pass it back ascursorwith the sameorderto 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
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
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.
| HTTP | code | When |
|---|---|---|
| 400 | INVALID_ARGUMENT | A bad filter, column, cursor or body |
| 401 | UNAUTHENTICATED | No key, or a revoked or expired key |
| 403 | PERMISSION_DENIED | A key of another project, or a read-only key writing |
| 403 | POLICY | A table policy refuses the change |
| 404 | NOT_FOUND | No such project, table or row |
| 409 | CONSTRAINT | A required, unique or relation constraint |
| 500 | INTERNAL | Something failed on our side |