Skip to content

Direct neighbours of notes: what they link to (`out`) and what links to them (`in`,

POST
/datanotes/operations/graph_neighbors/
curl --request POST \
--url https://example.com/datanotes/operations/graph_neighbors/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "from_nodes": {}, "direction": null, "edges": null }'

Direct neighbours of notes: what they link to (out) and what links to them (in, backlinks), with counts per edge label. direction: out, in or both (default).

from_nodes selects the notes: {"paths": [...]} and/or {"table": ..., "where": {...}}. Edges are labelled with their link column (people, event, …) or link for other links.

Media typeapplication/json
object
from_nodes
required
object
key
additional properties
any
direction
Any of:
string
Allowed values: out in both
edges
Any of:
Array<string>

Done.

Media typeapplication/json
object
nodes
required

One entry per start note.

Array<object>
object
path
required

Start note.

string
table
string
counts
required

Edges per direction:label.

object
key
additional properties
integer
edges
required
Array<object>
object
path
required
string
table
string
label
required
string
direction
required
string
Allowed values: out in

Example

{
"nodes": [
{
"edges": [
{
"direction": "out"
}
]
}
]
}

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"
}