Skip to content

Models

Vault Models

FileStat

Bases: BaseModel

File system metadata for a vault file.

Attributes:

Name Type Description
ctime int

Creation time as a Unix timestamp in milliseconds.

mtime int

Last modification time as a Unix timestamp in milliseconds.

size int

File size in bytes.

NoteJson

Bases: BaseModel

Structured JSON representation of a note.

Returned when requesting a file with ContentType.NOTE_JSON.

Attributes:

Name Type Description
content str

The raw Markdown content of the note.

frontmatter dict[str, Any]

Parsed YAML frontmatter as a dictionary.

tags list[str]

List of tags found in the note.

path str

Path to the file relative to the vault root.

stat FileStat

File system metadata.

DocumentMap

Bases: BaseModel

Map of a note's structure (headings, blocks, frontmatter fields).

Returned when requesting a file with ContentType.DOCUMENT_MAP. Useful for discovering valid patch targets.

Attributes:

Name Type Description
headings list[str]

List of heading texts in the document.

blocks list[str]

List of block reference IDs.

frontmatter_fields list[str]

List of frontmatter field names.

VaultDirectory

Bases: BaseModel

Directory listing of files in the vault.

Attributes:

Name Type Description
files list[str]

List of file paths relative to the vault root.

Search Models

SearchMatch

Bases: BaseModel

A single match within a search result.

Attributes:

Name Type Description
match MatchSpan

Span with start and end positions of the match.

context str

Surrounding text context for the match.

SearchResult

Bases: BaseModel

A search result entry.

Attributes:

Name Type Description
filename str

Path to the matching file relative to the vault root.

score float | None

Relevance score (present for simple search).

matches list[SearchMatch] | None

List of match locations with context (present for simple search).

result dict[str, Any] | list[Any] | None

Raw result data (present for Dataview/JsonLogic queries).

System Models

Versions

Bases: BaseModel

Version information for Obsidian and the REST API plugin.

Attributes:

Name Type Description
obsidian str

Obsidian application version string.

self_ str

REST API plugin version string (aliased from "self").

ServerStatus

Bases: BaseModel

Status response from the Obsidian REST API root endpoint.

Attributes:

Name Type Description
status str

Status message (typically "OK").

service str

Service identifier string.

authenticated bool

Whether the request was authenticated.

versions Versions

Version information for Obsidian and the plugin.

Command Models

Command

Bases: BaseModel

An Obsidian command.

Attributes:

Name Type Description
id str

Unique command identifier (e.g. "editor:toggle-bold").

name str

Human-readable command name (e.g. "Toggle bold").