Actions11
- Vault Actions
- Search Actions
- Periodic Note Actions
- Recent Actions
Overview
This node operation allows users to patch the content of a file within an Obsidian vault via the Local REST API. It supports modifying file content by appending, prepending, or replacing text at specific targets such as headings, blocks, or frontmatter fields. This is useful for automating updates to notes, managing structured content, or dynamically inserting information into files in an Obsidian vault.
Use Case Examples
- Appending a new task under a specific heading in a project note.
- Prepending metadata to the frontmatter of a markdown file.
- Replacing the content of a specific block identified by a block ID.
Properties
| Name | Meaning |
|---|---|
| File Path | Path to the file to patch (relative to vault root) |
| Patch Operation | Type of patch operation to perform on the file content (append, prepend, replace) |
| Target Type | Type of target within the file to patch (heading, block, frontmatter) |
| Target | Identifier for the target within the file (e.g., heading path, block reference, or frontmatter field) |
| Content | Content to insert or replace at the target location |
Output
JSON
success- Indicates if the patch operation was successfulpatchedFilePath- The path of the file that was patchedpatchedContent- The content of the file after patching
Dependencies
- Requires an API key credential for the Obsidian Local REST API to authenticate requests.
Troubleshooting
- Ensure the file path is correct and relative to the vault root to avoid file not found errors.
- Verify the target identifier matches the target type (e.g., correct heading syntax, valid block ID, or existing frontmatter field).
- Check network connectivity and API endpoint settings if requests fail.
- If SSL issues occur, consider enabling the option to ignore SSL certificate validation, especially in local or self-signed environments.