siyuan

Search and manage SiYuan blocks and documents via HTTP POST JSON requests.

19|4|Updated Apr 22, 2026
One-click install
npx skills add https://github.com/carterwayneskhizeine/hermes-agent-windows-R --skill siyuan-carterwayneskhizeine
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: siyuan
Source: https://github.com/carterwayneskhizeine/hermes-agent-windows-R/tree/main/optional-skills/productivity/siyuan
Command: npx skills add https://github.com/carterwayneskhizeine/hermes-agent-windows-R --skill siyuan-carterwayneskhizeine

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill solves the problem of programmatically searching, reading, creating, updating, and deleting blocks and documents in a self-hosted SiYuan knowledge base instead of doing everything manually in the UI.

Core Features & Use Cases

  • Full-text and SQL search: Find relevant blocks/documents quickly using /api/search/fullTextSearchBlock and safe SELECT queries via /api/query/sql.
  • Block and document management: Read content (Kramdown), traverse child blocks, create notebooks/documents, append/update blocks, rename documents, and delete blocks or documents.
  • Attributes and export: Set custom attributes on blocks and export documents as Markdown for downstream workflows.

Use case example: You want to build an automated daily notes workflow that searches for meetings from yesterday, appends a new agenda section into the right document, sets a priority attribute, and exports the updated document as Markdown.

Quick Start

Ask your assistant: "Using the siyuan skill, export the Markdown of document ID 20210808180117-6v0mkxr from my local SiYuan instance and return the content."

Frequently Asked Questions about siyuan

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I programmatically search and manage blocks in a SiYuan knowledge base?

You can programmatically search and manage SiYuan blocks by sending HTTP POST JSON requests via curl, using a SIYUAN_TOKEN for authentication to execute full-text retrieval, SQL queries, and CRUD operations.

Can I run SQL queries to find specific documents in SiYuan?

Yes, you can run safe SELECT statements via the `/api/query/sql` endpoint to discover specific blocks and documents in your SiYuan knowledge base programmatically.

What do I need to set up before using the SiYuan API for note automation?

You need to configure a SIYUAN_TOKEN for authentication and optionally define a SIYUAN_URL, enabling your HTTP POST JSON requests to successfully target local or remote SiYuan instances for note automation.

How do I export a SiYuan document as Markdown through the API?

You export a SiYuan document as Markdown by sending an HTTP POST JSON request to the designated SiYuan API export endpoint, which returns the document content formatted for downstream workflows.

Why are my SiYuan API requests returning errors during block creation?

SiYuan API requests return errors during block creation if the JSON response contains a code not equal to zero, indicating a failure in your HTTP POST request payload or token authentication.

Does the SiYuan API support setting custom attributes on blocks?

Yes, the SiYuan API supports setting custom attributes on blocks, allowing you to append, update, or modify block metadata alongside standard document creation and traversal operations.