Skip to content

Read a note or another file of the vault: `{path, content, front_matter, tags, modified_at,

POST
/datanotes/operations/read_note/
curl --request POST \
--url https://example.com/datanotes/operations/read_note/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "path": "example" }'

Read a note or another file of the vault: {path, content, front_matter, tags, modified_at, created_at, size}. content is the whole text, front matter included; tags are without #, from the text and the front matter; the times are in the database’s time zone. A missing file is an error. path: vault-relative, forward slashes.

X-Datanotes-View-As
string

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.

Media typeapplication/json
object
path
required

The file’s vault path, with its extension (“Films/Metropolis.md”).

string

Example generated

{
"path": "example"
}

Done.

Media typeapplication/json

A file of the vault with its front matter and tags.

object
path
required

Vault path.

string
content
required

The whole text, front matter included.

string
front_matter
required

Parsed front matter (empty without one).

object
key
additional properties
any
tags
required

Tags (without #), in the text and in the front matter.

Array<string>
modified_at
required

Last change, in the database’s time zone.

string | null
created_at
required

Creation, in the database’s time zone.

string | null
size
required

Size in bytes.

integer | null

Example generated

{
"path": "example",
"content": "example",
"front_matter": {},
"tags": [
"example"
],
"modified_at": "example",
"created_at": "example",
"size": 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"
}

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.

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