SiYuan icon

SiYuan

Manage SiYuan notebooks, documents, blocks, attributes, and more. Designed for AI agent workflows.

Document → Create

AI-generated

Summary

Create a new document with specified Markdown content inside a given notebook at the defined folder-like path.

Inputs

  • Notebook ID (required) — The unique ID of the notebook where the document will be created.
  • Document Path (required) — The folder-like path for the document inside the notebook (e.g., "/My Project/Meeting Notes"). Must start with a '/'.
  • Markdown Content (required) — The Markdown content that will populate the new document.

Output shape

an object containing the newly created document ID, the specified notebook ID, the document path, and a boolean indicating if the document was successfully created.

The returned object includes 'id' (the new document's ID), 'notebookId', 'path' (the document path), and 'found' indicating creation success.

Examples

Example 1: Creating a new document inside a notebook at a specified path with Markdown content

Provide the unique Notebook ID, specify the Document Path starting with '/', and fill in the Markdown Content for the document.

Links

Discussion