Query rows: `{table, total, rows: [{path, ...}]}`. `table` may be a view,
const url = 'https://example.com/datanotes/operations/select_rows/';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"table":"example","columns":null,"where":null,"order_by":null,"limit":null,"offset":null,"expand":null,"join":null,"group_by":null,"aggregates":null,"include_body":false,"version":null,"timestamp":null,"this_note":null}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/datanotes/operations/select_rows/ \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "table": "example", "columns": null, "where": null, "order_by": null, "limit": null, "offset": null, "expand": null, "join": null, "group_by": null, "aggregates": null, "include_body": false, "version": null, "timestamp": null, "this_note": null }'Query rows: {table, total, rows: [{path, ...}]}. table may be a view,
system.information_schema.<catalogs|schemata|tables|columns|views|check_constraints>, or
base:<name> — every table that extends that base (e.g. base:record: all event-like tables),
on the base’s columns, each row tagged _source with its table.
where: as in update_rows; relative dates"{today}","{today-7d}","{now-24h}"(on a date column a date-time counts by its day); file columnsfile_name,file_link,file_modified,file_backlink_count.columns,order_by(-coldescending),limit(default 100, max 1000),offset,expand(inline linked rows’ frontmatter),include_body(the note body asbody).join:{"table", "on": {"date(occurred_at)+1": "date(timestamp)"}, "as", "type": "inner"|"left", "columns", "where"}— matches attached underas.group_by(column,pathordate(col)±n; a list column counts once per item) +aggregates{"n": "count", "kcal": "sum:meal.kcal"}(count, count:col, sum, avg, min, max).this_note: vault path of the note the result is for:{this.*}tokens in a view’s query and inwhereread it ({this.date},{this.link},{this.name},{this.path}); without it (or a front matter key the note lacks) a token stays as written and matches no row, whatever the operator (withinincluded).- Ordered enums compare by position. Time travel:
version(of one table) ortimestamp. Withtimestampa join, a view, a union orbase:<name>reads every table in it as of that time (versions: the version read of each); a table that did not exist then adds no rows to a union or base.versionis refused where several tables are read; information_schema has no history. Views and bases keep today’s definition, and links followed bywhere(project.kind,within) orexpandread the linked rows as they are now.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”Owner only, on reads only (an operation that only reads, tokens/me/, extensions/, the change stream): the request runs with this named token’s permissions and read scope, and the token’s last_seen does not change. A named token sending it gets 403; a request that is not a read gets 400.
Request Bodyrequired
Section titled “Request Bodyrequired”object
Responses
Section titled “Responses”Done.
object
The table, view or base selected, as given.
Matching rows before limit/offset.
The rows returned.
A row: path plus the selected columns (missing values are null); body with include_body; the group keys and aggregates with group_by.
object
Log version read (time travel only; of the left table with a join, absent for a union or a base).
Commit time of that version (time travel only); for a union or a base, the time asked for.
Time travel over several tables (a join, a union, a base): the version read of each, by full name.
object
The view whose query ran.
Example generated
{ "table": "example", "total": 1, "rows": [ {} ], "version": 1, "timestamp": "example", "versions": { "additionalProperty": 1 }, "view": "example"}Bad input: the body is not a JSON object, or an argument is unknown, missing or of the wrong type.
object
What went wrong, for a person or an agent.
Example generated
{ "error": "example"}Missing or wrong bearer token.
object
What went wrong, for a person or an agent.
Example generated
{ "error": "example"}A named token whose read patterns do not cover the table, view or note the request names (such as token cook may not read personal.health.weight). Sets it did not name (listings, bases, search, the graph, the change feed) are filtered instead.
object
What went wrong, for a person or an agent.
Example generated
{ "error": "example"}Unknown table, view, migration, note or folder.
object
What went wrong, for a person or an agent.
Example generated
{ "error": "example"}Ambiguous table name: it matches several tables (paths or tables lists them).
object
The tables’ folders the name matches.
The qualified tables the name matches.
Example generated
{ "error": "example", "paths": [ "example" ], "tables": [ "example" ]}Unexpected error.
object
What went wrong, for a person or an agent.
Example generated
{ "error": "example"}