Skip to content

The rows a link column may point to, for one row: what an agent or a picker offers before writing

POST
/datanotes/operations/list_link_targets/
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: a where filter 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; null is 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_column reads another column of the target (default: the same name). describe_table shows the expanded map. Writes refuse other targets (code ref, 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’s link as the value.
Media typeapplication/json
object
table
required
string
column
required

A link column (or list of links) with ref.

string
row
Any of:
string
values
Any of:
object
key
additional properties
any
limit
Any of:
integer

Done.

Media typeapplication/json
object
table
required

Qualified table.

string
column
required

The link column.

string
ref
required

Qualified table the column links to.

string
required
required

True when the row must have the link.

boolean
empty
required

True when the link must stay empty (a top level of ref_by).

boolean
reason
required

What filters the targets (ref_where, the row’s level).

string
rows
required

Valid targets, sorted by name (the row itself left out).

Array<object>

A valid target, with its ref_by level column.

object
name
required

File name of the target row.

string
link
required

Link to write as the value ([[path|name]]).

string
path
required

Vault path of the target row.

string
key
additional properties
any
total
required

Valid targets in all (rows is capped by limit).

integer

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.

Media typeapplication/json
object
error
required

What went wrong, for a person or an agent.

string

Example generated

{
"error": "example"
}

Missing or wrong bearer token.

Media typeapplication/json
object
error
required

What went wrong, for a person or an agent.

string

Example generated

{
"error": "example"
}

Unknown table, view, migration, note or folder.

Media typeapplication/json
object
error
required

What went wrong, for a person or an agent.

string

Example generated

{
"error": "example"
}

Ambiguous table name: it matches several tables (paths or tables lists them).

Media typeapplication/json
object
error
required
string
paths

The tables’ folders the name matches.

Array<string>
tables

The qualified tables the name matches.

Array<string>

Example generated

{
"error": "example",
"paths": [
"example"
],
"tables": [
"example"
]
}

Unexpected error.

Media typeapplication/json
object
error
required

What went wrong, for a person or an agent.

string

Example generated

{
"error": "example"
}