Obsidian URI - Obsidian Help

Obsidian URI

aliases:
  - Using Obsidian URI
  - Advanced topics/Using obsidian URI
  - Concepts/Obsidian URI
  - Extending Obsidian/Obsidian URI
permalink: uri

Obsidian URI is a custom URI protocol supported by Obsidian that lets you trigger various actions, such as opening a note or creating a note. Obsidian URI enables automation and cross-app workflows.

URI format

Obsidian URIs use the following format:

obsidian://action?param1=value&param2=value

The action parameter is the action that you would like to perform. Available actions include:

Encoding

Ensure that your values are properly URI encoded. For example, forward slash characters / must be encoded as %2F and space characters must be encoded as %20.

This is especially important because an improperly encoded "reserved" character may break the interpretation of the URI. See here for details.

Open note

The open action opens an Obsidian vault, or opens a file within that vault.

Examples

This opens the vault my vault. If the vault is already open, focus on the window.

This opens the vault identified by the ID ef6ca3e3b524d22f.

This opens the note my note.md in the vault my vault, assuming the file exists.

This will look for any vault that contains the path /home/user/my vault/path/to/my note. Then, the rest of the path is passed to the file parameter. For example, if a vault exists at /home/user/my vault, then this would be equivalent to file parameter set to path/to/my note.

Open a heading or block

With proper URI encoding, you can navigate to a heading or block within a note. Note%23Heading would navigate to the heading called "Heading", whereas Note%23%5EBlock would navigate to the block called "Block".

Parameters

Create note

The new action, creates a new note in the vault, optionally with some content.

Examples

This opens the vault my vault, and creates a new note called my note.

This opens the vault my vault, and creates a new note at path/to/my note.

Parameters

Create or open daily note

The daily action creates or opens your daily note. The Daily notes plugin must be enabled.

Examples

This opens the vault my vault, and creates or opens the daily note.

Parameters

The daily action accepts the same parameters as the new action.

Unique Note

The unique action creates a new unique note in the vault. The Unique note creator plugin must be enabled.

Examples

This opens the vault my vault, and creates a new unique note.

This opens the vault my vault, and creates a new unique note with the content Hello World.

Parameters

Open search

The search action opens Search in the specified vault, and optionally perform a search term.

Examples

This opens the vault my vault, and opens Search.

This opens the vault my vault, opens Search, and performs a search for Obsidian.

Parameters

Open Vault Manager

The choose-vault action opens the vault manager.

Examples

Integrate with Hook

This Obsidian URI action is to be used with Hook.

Example

obsidian://hook-get-address

Parameters

If x-success is defined, this API will use it as the x-callback-url. Otherwise, it will copy a Markdown link of the current focused note to the clipboard, as an obsidian://open URL.

Use x-callback-url parameters

Some endpoints will accept the x-callback-url parameters x-success and x-error. When it's provided, Obsidian will provide the following to the x-success callback:

For example, if Obsidian receives

obsidian://.....x-success=myapp://x-callback-url, the response would be myapp://x-callback-url?name=...&url=obsidian%3A%2F%2Fopen...&file=file%3A%2F%2F...

Shorthand formats

In addition to the formats above, there are two more "shorthand" formats available to open vaults and files:

  1. obsidian://vault/my vault/my note is equivalent to obsidian://open?vault=my%20vault&file=my%20note.
  2. obsidian:///absolute/path/to/my note is equivalent to obsidian://open?path=%2Fabsolute%2Fpath%2Fto%2Fmy%20note.

Troubleshooting

Register Obsidian URI

On Windows and macOS, running the app once should be sufficient to register the Obsidian URI protocol on your computer.

On Linux, it is a much more involved process:

  1. Ensure you create a obsidian.desktop file. See here for details.
  2. Ensure that your desktop file specifies the Exec field as Exec=executable %u. The %u is used to pass the obsidian:// URIs to the app.
  3. If you're using the AppImage installer, you may have to unpack it using Obsidian-x.y.z.AppImage --appimage-extract. Then make sure the Exec directive points to the unpacked executable.