Xpersona
S

SiYuan API

CLAWHUB · Unverified

思源笔记 - SiYuan API Skill,支持笔记本、文档、块、资源、数据库/属性视图和 SQL 操作。Local-only SiYuan API integration for notebooks, documents, blocks, assets, database/attribute views, and SQL operations. Skill: SiYuan API Owner: xybio Summary: 思源笔记 - SiYuan API Skill,支持笔记本、文档、块、资源、数据库/属性视图和 SQL 操作。Local-only SiYuan API integration for notebooks, documents, blocks, assets, database/attribute views, and SQL operations. Tags: agent-skill:1.4.7, api:1.4.7, knowledge-management:1.4.7, latest:1.4.7, openclaw:1.4.7, siyuan:1.4.7 Version history: v1.4.7 | 2026-05-13T12:11:22.504Z | user Restore display name to SiYuan API. No

62
Rank
84
Safety
1.4k
Downloads

About

What it does, and when to use it.

Capability contract not published. No trust telemetry is available yet. 1.4K downloads reported by the source. Last updated 10/10/2026.

Avoid when

  • Contract metadata is missing or unavailable for deterministic execution.

Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing

Install and run

Setup complexity: low.

clawhub skill install s177jx896h62b1dyq88fq313kn83f3fa:siyuan-api
  1. Setup complexity is classified as HIGH. You must provision dedicated cloud infrastructure or an isolated VM. Do not run this directly on your local workstation.
  2. Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.

Contract: missing

curl -s "https://www.xpersona.co/api/v1/agents/clawhub-xybio-siyuan-api/snapshot"

Run-check

$0.02 USD

1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.

Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.

Documentation

CLAWHUB

148,966 characters of source documentation, loaded on request.

Extracted files

4 files captured from the source.

SKILL.md

---
name: siyuan-api
description: Local SiYuan API integration for notebook, document, block, asset, database/attribute view, and limited SQL operations. Restricted to local HTTP endpoints and environment-based token auth.
homepage: https://github.com/siyuan-note/siyuan
metadata: {"openclaw":{"primaryEnv":"SIYUAN_API_TOKEN","requires":{"env":["SIYUAN_API_TOKEN","SIYUAN_API_URL"]}}}
---

# SiYuan Skill

本技能用于调用本地运行的 SiYuan HTTP API,面向笔记本、文档、块、资源和受限查询场景。
它是一个 instruction-only skill:只描述允许调用的接口范围、约束和示例,不包含安装脚本、代理逻辑或可执行第三方依赖。

## Security Scope

- Only call a local SiYuan endpoint: `127.0.0.1`, `localhost`, or a user-provided local LAN address explicitly confirmed by the user.
- Never call third-party internet endpoints through SiYuan.
- Never hardcode, echo, or log `SIYUAN_API_TOKEN`.
- Treat this skill as high-trust local automation over the user's SiYuan workspace.
- Prefer note/block/document APIs over raw file APIs whenever both can solve the task.

## Explicitly Disallowed Endpoints

Do not use the following APIs through this skill:

- `/api/network/forwardProxy`
- `/api/convert/pandoc`
- Any endpoint whose main purpose is external network access, command-style conversion, or indirect execution

Reason: these endpoints materially expand the attack surface beyond ordinary note management and are intentionally out of scope for this published skill.

## Configuration

Configuration is provided via environment variables:

```bash
export SIYUAN_API_TOKEN=your_token_here
export SIYUAN_API_URL=http://127.0.0.1:6806
```

- `SIYUAN_API_TOKEN` required: from SiYuan `Settings > About`
- `SIYUAN_API_URL` optional: defaults to `http://127.0.0.1:6806`

Before using the skill:

- confirm the endpoint is local
- confirm SiYuan is already running
- stop if the task requires internet proxying or document conversion via external tools

## Allowed Operations

This skill is intended for the following operations:

- list, create, rename, move, and remove notebooks/documents
- create documents from Markdown
- insert, append, update, move, and delete blocks
- inspect and update database/attribute view rows and cells
- upload assets used by notes
- export Markdown content from documents
- run limited read-oriented SQL queries for note discovery or metadata inspection
- read or write workspace files only when the task is clearly about SiYuan-managed content or assets

## Database / Attribute View Notes

SiYuan databases are exposed as Attribute Views. Use `/api/av/*` endpoints for database rows and cells; ordinary block attributes and SQL are not enough for this workflow.

Safe database workflow:

1. Read the database schema and values with `/api/av/getAttributeView`.
2. Find the target row by matching the primary `block` key value, usually the database's first/key column.
3. Use the matched value's `blockID` as `itemID` when updating cells.
4. Update one cell with `/api/av/setAttributeViewBlockAttr`, or multiple cells with `/api/av/batchSetAttributeViewBlockAttrs`.
5. R

_meta.json

{
  "ownerId": "kn7ffwqj9rqhvsxcm6qgv09kvx81ymjs",
  "slug": "siyuan-api",
  "version": "1.4.7",
  "publishedAt": 1778674282504
}

references/safe-api.md

# SiYuan Safe API Reference

This file is the default reference for the published `siyuan-api` skill.
It intentionally lists only the safer, in-scope API families for local note management.

## In Scope

### Notebook

- `/api/notebook/lsNotebooks`
- `/api/notebook/openNotebook`
- `/api/notebook/closeNotebook`
- `/api/notebook/createNotebook`
- `/api/notebook/removeNotebook`
- `/api/notebook/renameNotebook`

### Document and File Tree

- `/api/filetree/createDocWithMd`
- `/api/filetree/renameDoc`
- `/api/filetree/renameDocByID`
- `/api/filetree/removeDoc`
- `/api/filetree/removeDocByID`
- `/api/filetree/moveDocs`
- `/api/filetree/moveDocsByID`
- `/api/filetree/getHPathByPath`
- `/api/filetree/getHPathByID`
- `/api/filetree/getPathByID`
- `/api/filetree/getIDsByHPath`

### Block

- `/api/block/insertBlock`
- `/api/block/prependBlock`
- `/api/block/appendBlock`
- `/api/block/updateBlock`
- `/api/block/deleteBlock`
- `/api/block/moveBlock`
- `/api/block/getBlockInfo`
- `/api/block/getBlockAttrs`
- `/api/block/setBlockAttrs`

### Database / Attribute View

Use these for SiYuan database tables and database row/cell updates.

- `/api/av/getAttributeView`
- `/api/av/renderAttributeView`
- `/api/av/getAttributeViewKeys`
- `/api/av/getAttributeViewKeysByAvID`
- `/api/av/getAttributeViewKeysByID`
- `/api/av/setAttributeViewBlockAttr`
- `/api/av/batchSetAttributeViewBlockAttrs`

Allowed use:

- inspect a database schema and field IDs
- find a row/item by primary block value
- update clearly requested cells in an existing row
- batch update a small set of cells in one database

Avoid:

- broad or unreviewed database rewrites
- deleting database rows or keys unless the user explicitly asks
- deprecated `rowID` request fields; use `itemID`

Notes:

- Databases are Attribute Views; the database ID is the Attribute View ID (`avID`).
- Row updates require the row item's `itemID`, which is usually the `blockID` of the primary `block` value in `av.keyValues`.
- `renderAttributeView` is display-oriented. Grouped tables may have empty top-level `view.rows`; inspect `view.groups[*].rows` or use `getAttributeView` for storage-oriented lookup.
- Database cell text does not reliably support Markdown tables. Use newline-separated lines for multiple records or structured notes inside one field.
- Common update value shapes are `{ "text": { "content": "..." } }`, `{ "url": { "content": "https://..." } }`, `{ "number": { "content": 1, "isNotEmpty": true } }`, `{ "checkbox": { "checked": true } }`, and `{ "mSelect": [{ "content": "bulk", "color": "1" }] }`.

### Asset

- `/api/asset/upload`

### Export

- `/api/export/exportMdContent`

### Limited SQL

- `/api/query/sql`

Allowed use:

- read-oriented discovery
- small result sets
- metadata inspection

Avoid:

- mutation-heavy SQL
- large unbounded scans
- using SQL when a notebook/document/block API already exists

### Workspace File APIs

- `/api/file/getFile`
- `/api/file/putFile`
- `/api/file/removeFile`
- `/api/file/rena

skill-card.md

## Description:

Local SiYuan API integration for notebook, document, block, asset, database/attribute view, and limited SQL operations.

This skill is ready for commercial/non-commercial use.

## Publisher:

[xybio](https://clawhub.ai/user/xybio)

### License/Terms of Use:

MIT-0

## Use Case:

Developers and end users use this skill to let an agent work with a local SiYuan workspace: managing notebooks, documents, blocks, assets, database rows, and limited read-oriented SQL queries.

### Deployment Geography for Use:

Global

## Known Risks and Mitigations:

Risk: The skill can read and modify local SiYuan workspace content when the API token is available.

Mitigation: Install only when local workspace automation is intended, keep the API token in environment variables, and avoid logging or echoing the token.

Risk: Using a non-loopback HTTP LAN endpoint can expose the SiYuan API token or workspace operations on an untrusted network.

Mitigation: Prefer localhost or 127.0.0.1; for another LAN machine, use HTTPS or a trusted private network and rotate the token if exposure is suspected.

Risk: Broad file, SQL, proxy, or conversion operations could expand the impact beyond ordinary note management.

Mitigation: Stay within the curated safe API scope, prefer structured note APIs, keep SQL read-oriented and limited, and avoid proxy or external conversion endpoints.

## Reference(s):

- [SiYuan Safe API Reference](references/safe-api.md)
- [SiYuan Project](https://github.com/siyuan-note/siyuan)
- [ClawHub Skill Page](https://clawhub.ai/xybio/skills/siyuan-api)

## Skill Output:

**Output Type(s):** [Guidance, Code, Shell commands, Configuration, API Calls]

**Output Format:** [Markdown with inline code blocks and API request examples]

**Output Parameters:** [1D]

**Other Properties Related to Output:** [Uses environment-based SiYuan API configuration and local endpoint constraints.]

## Skill Version(s):

1.4.7 (source: server release evidence)

## Ethical Considerations:

Users should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.

Sponsored

Ads related to SiYuan API and adjacent AI workflows.