No description
  • PHP 66.1%
  • Blade 33.7%
  • CSS 0.2%
Find a file
2025-08-08 23:19:30 +02:00
.github/workflows test: fix OpenAPI spec path; normalize workflow yaml 2025-08-08 14:18:11 +02:00
app chore: add OpenAPI source of truth and cross-repo dispatch workflows; add sync receivers in MCP and n8n repos 2025-08-08 13:38:21 +02:00
bootstrap feat: scaffold API endpoints, add controllers, tests, and update README 2025-04-24 21:47:52 +02:00
config Update environment configuration and README for Obsidian local REST API integration 2025-04-24 20:00:46 +02:00
database install laravel 2025-04-24 19:48:54 +02:00
public chore: remove unused files and update CI workflow 2025-04-29 00:27:06 +02:00
resources install laravel 2025-04-24 19:48:54 +02:00
routes chore: add OpenAPI source of truth and cross-repo dispatch workflows; add sync receivers in MCP and n8n repos 2025-08-08 13:38:21 +02:00
storage install laravel 2025-04-24 19:48:54 +02:00
tests test: fix OpenAPI spec path; normalize workflow yaml 2025-08-08 14:18:11 +02:00
.editorconfig install laravel 2025-04-24 19:48:54 +02:00
.env.example chore: add API_AUTH_DISABLED variable for local development configuration 2025-06-26 00:53:26 +02:00
.gitattributes install laravel 2025-04-24 19:48:54 +02:00
.gitignore install laravel 2025-04-24 19:48:54 +02:00
artisan install laravel 2025-04-24 19:48:54 +02:00
composer.json Refactor OpenAPI schema and update tests 2025-05-18 01:09:30 +02:00
composer.lock Refactor OpenAPI schema and update tests 2025-05-18 01:09:30 +02:00
openapi.json fix(openapi): correct components location and flatten paths; fix 2025-08-08 23:19:30 +02:00
phpunit.xml chore: comment out Unit testsuite in phpunit.xml 2025-04-29 01:01:46 +02:00
README.md refactor: update response structure in FileController and MetadataController, add BulkDeleteResource and BulkUpdateResource 2025-05-01 01:18:31 +02:00

Obsidian Vault REST API

Banner A Laravel-based REST API to interact with your local Obsidian vault. Provides endpoints to list, create, edit, and delete files and notes, as well as access and manage front matter metadata.

Prerequisites

If you plan to integrate this API in an n8n workflow, install the community node n8n-nodes-obsidian-vault-rest-api in your n8n instance. Ensure this API is running (e.g. at http://localhost:8000) before using that node.

Table of Contents

Overview

This project provides a REST API for managing your Obsidian vault using Laravel. It enables programmatic access to files and notes, supporting automation and integration scenarios.

API Usage

Base URL

https://{host}/api

Replace {host} with your environment or hostname. Do not call /api directly; always use a resource endpoint such as /api/files or /api/notes.

Authentication

All endpoints require a Bearer token in the Authorization header:

Authorization: Bearer <JWT_TOKEN>

Troubleshooting

  • If you get a 404 error with the message The route api could not be found., make sure you are not requesting /api or /api/api. Only resource endpoints like /api/files or /api/notes are valid.
  • If your vault appears empty or the API returns null, ensure OBSIDIAN_VAULT_PATH in your .env is an absolute path (not using ~).

Endpoints

  • GET /files - List vault files (returns an array of objects: [ { "path": "filename.md" }, ... ])

  • POST /files - Create a file or directory

  • GET /files/{path} - Download file content

  • PUT /files/{path} - Update file

  • DELETE /files/{path} - Delete file

  • GET /notes - List notes with front matter

  • POST /notes - Create a new note

  • GET /notes/{path} - Get a note

  • PUT /notes/{path} - Replace a note

  • PATCH /notes/{path} - Partially update a note

  • DELETE /notes/{path} - Delete a note

  • DELETE /bulk/notes/delete - Bulk delete notes

  • PATCH /bulk/notes/update - Bulk update notes

  • GET /metadata/keys - List all front matter keys

  • GET /metadata/values/{key} - List unique values for a key

Refer to the OpenAPI spec for full details.

Local Development

git clone https://github.com/j-shelfwood/obsidian-local-rest-api.git
cd obsidian-local-rest-api
composer install
cp .env.example .env
php artisan key:generate

Important: In your .env, set OBSIDIAN_VAULT_PATH to the full absolute path to your vault directory. Do not use ~ for your home directory, as PHP does not expand it. For example:

OBSIDIAN_VAULT_PATH=/Users/your-username/Obsidian/TestVault

Then start the API server (or use Laravel Valet):

php artisan serve  # starts API server on http://localhost:8000

n8n Community Node

To automate and integrate this API within n8n, install the community node:

npm install n8n-nodes-obsidian-vault-rest-api

That node will send requests to your running API instance; follow its README for credential setup, resource/operation usage, and workflow examples.

Contributing

Contributions welcome. Open issues or PRs as needed.

License

MIT