The rows a link column may point to, for one row: what an agent or a picker offers before writing
const url = 'https://example.com/datanotes/operations/list_link_targets/';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"table":"example","column":"example","row":null,"values":null,"limit":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/list_link_targets/ \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "table": "example", "column": "example", "row": null, "values": null, "limit": null }'The rows a link column may point to, for one row: what an agent or a picker offers before writing the link. A link column can filter its targets:
ref_where: awherefilter every target must match ({"kind": {"in": ["area", "project"]}}).ref_by: a column of the row picks the targets’ level:{"column": "kind", "map": {"area": null, "project": ["area"], "workstream": ["project"]}}: a workstream’s parent must have kind project;nullis a top level (the link must stay empty); any other level needs the link; a value missing from the map is refused.levels: ["area", "project", "workstream"]writes the same chain short (each level’s parent is the level before it).target_columnreads another column of the target (default: the same name). describe_table shows the expanded map. Writes refuse other targets (coderef, listing the valid ones), a link to the row itself (ref), a link to no row of the table (broken_link) and a missing link a level needs (required). Pass the row (row: path, link or name; a name rows in different folders share is refused, listing their paths) and/or its values (values, e.g.{"kind": "workstream"}for a new row). Returns{rows: [{name, link, path, <level column>}], total, required, empty, reason}(no rows, and the reason, for a level the map lacks); write a row’slinkas the value.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Responses
Section titled “Responses”Done.
object
Qualified table.
The link column.
Qualified table the column links to.
True when the row must have the link.
True when the link must stay empty (a top level of ref_by).
What filters the targets (ref_where, the row’s level).
Valid targets, sorted by name (the row itself left out).
A valid target, with its ref_by level column.
object
File name of the target row.
Link to write as the value ([[path|name]]).
Vault path of the target row.
Valid targets in all (rows is capped by limit).
Example generated
{ "table": "example", "column": "example", "ref": "example", "required": true, "empty": true, "reason": "example", "rows": [ { "name": "example", "link": "example", "path": "example" } ], "total": 1}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"}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"}