# Obsidian (/integrations/obsidian)





{/* MANUAL-CONTENT-START:intro */}

Use [Obsidian](https://obsidian.md/) to read, create, update, search, or delete notes, manage periodic notes, and run commands.

Install and run the [Obsidian Local REST API](https://github.com/coddingtonbear/obsidian-local-rest-api) plugin in the vault. Provide its API key and base URL, plus the selected operation's fields. The plugin endpoint must be reachable from the Sim execution runtime; a URL on your own computer is not automatically reachable from Sim Cloud.

{/* MANUAL-CONTENT-END */}

## Use the block [#usage-instructions]

Read, create, update, search, and delete notes in your Obsidian vault. Manage periodic notes, execute commands, and patch content at specific locations. Requires the Obsidian Local REST API plugin.

## Actions [#actions]

### Obsidian Append to Active File [#obsidian-append-to-active-file]

Append content to the currently active file in Obsidian

<ReferenceDetails>
  #### Input [#input]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `apiKey` | string | Yes | API key from Obsidian Local REST API plugin settings |
  | `baseUrl` | string | Yes | Base URL for the Obsidian Local REST API |
  | `content` | string | Yes | Markdown content to append to the active file |

  #### Output [#output]

  | Parameter | Type | Description |
  | - | - | - |
  | `appended` | boolean | Whether content was successfully appended |
</ReferenceDetails>

### Obsidian Append to Note [#obsidian-append-to-note]

Append content to an existing note in your Obsidian vault

<ReferenceDetails>
  #### Input [#input-1]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `apiKey` | string | Yes | API key from Obsidian Local REST API plugin settings |
  | `baseUrl` | string | Yes | Base URL for the Obsidian Local REST API |
  | `filename` | string | Yes | Path to the note relative to vault root (e.g. "folder/note.md") |
  | `content` | string | Yes | Markdown content to append to the note |

  #### Output [#output-1]

  | Parameter | Type | Description |
  | - | - | - |
  | `filename` | string | Path of the note |
  | `appended` | boolean | Whether content was successfully appended |
</ReferenceDetails>

### Obsidian Append to Periodic Note [#obsidian-append-to-periodic-note]

Append content to the current periodic note (daily, weekly, monthly, quarterly, or yearly). Creates the note if it does not exist.

<ReferenceDetails>
  #### Input [#input-2]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `apiKey` | string | Yes | API key from Obsidian Local REST API plugin settings |
  | `baseUrl` | string | Yes | Base URL for the Obsidian Local REST API |
  | `period` | string | Yes | Period type: daily, weekly, monthly, quarterly, or yearly |
  | `content` | string | Yes | Markdown content to append to the periodic note |

  #### Output [#output-2]

  | Parameter | Type | Description |
  | - | - | - |
  | `period` | string | Period type of the note |
  | `appended` | boolean | Whether content was successfully appended |
</ReferenceDetails>

### Obsidian Create Note [#obsidian-create-note]

Create or replace a note in your Obsidian vault

<ReferenceDetails>
  #### Input [#input-3]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `apiKey` | string | Yes | API key from Obsidian Local REST API plugin settings |
  | `baseUrl` | string | Yes | Base URL for the Obsidian Local REST API |
  | `filename` | string | Yes | Path for the note relative to vault root (e.g. "folder/note.md") |
  | `content` | string | Yes | Markdown content for the note |

  #### Output [#output-3]

  | Parameter | Type | Description |
  | - | - | - |
  | `filename` | string | Path of the created note |
  | `created` | boolean | Whether the note was successfully created |
</ReferenceDetails>

### Obsidian Delete Note [#obsidian-delete-note]

Delete a note from your Obsidian vault

<ReferenceDetails>
  #### Input [#input-4]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `apiKey` | string | Yes | API key from Obsidian Local REST API plugin settings |
  | `baseUrl` | string | Yes | Base URL for the Obsidian Local REST API |
  | `filename` | string | Yes | Path to the note to delete relative to vault root |

  #### Output [#output-4]

  | Parameter | Type | Description |
  | - | - | - |
  | `filename` | string | Path of the deleted note |
  | `deleted` | boolean | Whether the note was successfully deleted |
</ReferenceDetails>

### Obsidian Execute Command [#obsidian-execute-command]

Execute a command in Obsidian (e.g. open daily note, toggle sidebar)

<ReferenceDetails>
  #### Input [#input-5]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `apiKey` | string | Yes | API key from Obsidian Local REST API plugin settings |
  | `baseUrl` | string | Yes | Base URL for the Obsidian Local REST API |
  | `commandId` | string | Yes | ID of the command to execute (use List Commands operation to discover available commands) |

  #### Output [#output-5]

  | Parameter | Type | Description |
  | - | - | - |
  | `commandId` | string | ID of the executed command |
  | `executed` | boolean | Whether the command was successfully executed |
</ReferenceDetails>

### Obsidian Get Active File [#obsidian-get-active-file]

Retrieve the content of the currently active file in Obsidian

<ReferenceDetails>
  #### Input [#input-6]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `apiKey` | string | Yes | API key from Obsidian Local REST API plugin settings |
  | `baseUrl` | string | Yes | Base URL for the Obsidian Local REST API |

  #### Output [#output-6]

  | Parameter | Type | Description |
  | - | - | - |
  | `content` | string | Markdown content of the active file |
  | `filename` | string | Path to the active file |
</ReferenceDetails>

### Obsidian Get Note [#obsidian-get-note]

Retrieve the content of a note from your Obsidian vault

<ReferenceDetails>
  #### Input [#input-7]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `apiKey` | string | Yes | API key from Obsidian Local REST API plugin settings |
  | `baseUrl` | string | Yes | Base URL for the Obsidian Local REST API |
  | `filename` | string | Yes | Path to the note relative to vault root (e.g. "folder/note.md") |

  #### Output [#output-7]

  | Parameter | Type | Description |
  | - | - | - |
  | `content` | string | Markdown content of the note |
  | `filename` | string | Path to the note |
</ReferenceDetails>

### Obsidian Get Periodic Note [#obsidian-get-periodic-note]

Retrieve the current periodic note (daily, weekly, monthly, quarterly, or yearly)

<ReferenceDetails>
  #### Input [#input-8]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `apiKey` | string | Yes | API key from Obsidian Local REST API plugin settings |
  | `baseUrl` | string | Yes | Base URL for the Obsidian Local REST API |
  | `period` | string | Yes | Period type: daily, weekly, monthly, quarterly, or yearly |

  #### Output [#output-8]

  | Parameter | Type | Description |
  | - | - | - |
  | `content` | string | Markdown content of the periodic note |
  | `period` | string | Period type of the note |
</ReferenceDetails>

### Obsidian List Commands [#obsidian-list-commands]

List all available commands in Obsidian

<ReferenceDetails>
  #### Input [#input-9]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `apiKey` | string | Yes | API key from Obsidian Local REST API plugin settings |
  | `baseUrl` | string | Yes | Base URL for the Obsidian Local REST API |

  #### Output [#output-9]

  | Parameter | Type | Description |
  | - | - | - |
  | `commands` | json | List of available commands with IDs and names |
  | ↳ `id` | string | Command identifier |
  | ↳ `name` | string | Human-readable command name |
</ReferenceDetails>

### Obsidian List Files [#obsidian-list-files]

List files and directories in your Obsidian vault

<ReferenceDetails>
  #### Input [#input-10]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `apiKey` | string | Yes | API key from Obsidian Local REST API plugin settings |
  | `baseUrl` | string | Yes | Base URL for the Obsidian Local REST API |
  | `path` | string | No | Directory path relative to vault root. Leave empty to list root. |

  #### Output [#output-10]

  | Parameter | Type | Description |
  | - | - | - |
  | `files` | json | List of files and directories |
  | ↳ `path` | string | File or directory path |
  | ↳ `type` | string | Whether the entry is a file or directory |
</ReferenceDetails>

### Obsidian Open File [#obsidian-open-file]

Open a file in the Obsidian UI (creates the file if it does not exist)

<ReferenceDetails>
  #### Input [#input-11]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `apiKey` | string | Yes | API key from Obsidian Local REST API plugin settings |
  | `baseUrl` | string | Yes | Base URL for the Obsidian Local REST API |
  | `filename` | string | Yes | Path to the file relative to vault root |
  | `newLeaf` | boolean | No | Whether to open the file in a new leaf/tab |

  #### Output [#output-11]

  | Parameter | Type | Description |
  | - | - | - |
  | `filename` | string | Path of the opened file |
  | `opened` | boolean | Whether the file was successfully opened |
</ReferenceDetails>

### Obsidian Patch Active File [#obsidian-patch-active-file]

Insert or replace content at a specific heading, block reference, or frontmatter field in the active file

<ReferenceDetails>
  #### Input [#input-12]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `apiKey` | string | Yes | API key from Obsidian Local REST API plugin settings |
  | `baseUrl` | string | Yes | Base URL for the Obsidian Local REST API |
  | `content` | string | Yes | Content to insert at the target location |
  | `operation` | string | Yes | How to insert content: append, prepend, or replace |
  | `targetType` | string | Yes | Type of target: heading, block, or frontmatter |
  | `target` | string | Yes | Target identifier (heading text, block reference ID, or frontmatter field name) |
  | `targetDelimiter` | string | No | Delimiter for nested headings (default: "::") |
  | `trimTargetWhitespace` | boolean | No | Whether to trim whitespace from target before matching (default: false) |

  #### Output [#output-12]

  | Parameter | Type | Description |
  | - | - | - |
  | `patched` | boolean | Whether the active file was successfully patched |
</ReferenceDetails>

### Obsidian Patch Note [#obsidian-patch-note]

Insert or replace content at a specific heading, block reference, or frontmatter field in a note

<ReferenceDetails>
  #### Input [#input-13]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `apiKey` | string | Yes | API key from Obsidian Local REST API plugin settings |
  | `baseUrl` | string | Yes | Base URL for the Obsidian Local REST API |
  | `filename` | string | Yes | Path to the note relative to vault root (e.g. "folder/note.md") |
  | `content` | string | Yes | Content to insert at the target location |
  | `operation` | string | Yes | How to insert content: append, prepend, or replace |
  | `targetType` | string | Yes | Type of target: heading, block, or frontmatter |
  | `target` | string | Yes | Target identifier (heading text, block reference ID, or frontmatter field name) |
  | `targetDelimiter` | string | No | Delimiter for nested headings (default: "::") |
  | `trimTargetWhitespace` | boolean | No | Whether to trim whitespace from target before matching (default: false) |

  #### Output [#output-13]

  | Parameter | Type | Description |
  | - | - | - |
  | `filename` | string | Path of the patched note |
  | `patched` | boolean | Whether the note was successfully patched |
</ReferenceDetails>

### Obsidian Search [#obsidian-search]

Search for text across notes in your Obsidian vault

<ReferenceDetails>
  #### Input [#input-14]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `apiKey` | string | Yes | API key from Obsidian Local REST API plugin settings |
  | `baseUrl` | string | Yes | Base URL for the Obsidian Local REST API |
  | `query` | string | Yes | Text to search for across vault notes |
  | `contextLength` | number | No | Number of characters of context around each match (default: 100) |

  #### Output [#output-14]

  | Parameter | Type | Description |
  | - | - | - |
  | `results` | json | Search results with filenames, scores, and matching contexts |
  | ↳ `filename` | string | Path to the matching note |
  | ↳ `score` | number | Relevance score |
  | ↳ `matches` | json | Matching text contexts |
  | ↳ `context` | string | Text surrounding the match |
</ReferenceDetails>
