Create note
create_noteCreate a note under an existing parent note, with HTML or Markdown content plus optional images and files, and get back the note, branch, and URL for sharing.
Instructions
Create a note under an existing parent and return the note, its branch and a url. Pick the parent with search_notes/get_note_tree; use "root" only for genuinely top-level notes. Text content is HTML or markdown (format="markdown"). Images/files can be uploaded and embedded in the same call (see the images/files fields). Give the user the returned url.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"parentNoteId": "<parentNoteId>",
"title": "<title>",
"type": "<type>",
"content": "<content>"
},
"name": "create_note"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mime | No | MIME type (required for code, file, image notes). Examples: application/javascript, text/x-python, text/markdown. For runnable scripts use application/javascript;env=frontend (browser) or application/javascript;env=backend (server). canvas/mindMap use application/json; render notes use an empty mime. | |
| type | Yes | Type of the note. For runnable scripts, render notes, or widgets, see the server instructions for the required mime and the follow-up set_attribute wiring that makes them work. | |
| files | No | Files to upload as attachments of this note and link as downloads. Reference entry N with <a href="file:N">label</a> (HTML, double quotes) or [label](file:N) (markdown); same indexing rules as images. Unreferenced files are appended as download links. To link an existing attachment use <a href="api/attachments/{attachmentId}/download">label</a>. | |
| title | Yes | Title of the new note | |
| format | No | "markdown" converts content to HTML before saving. Applies to type="text" only; ignored for other types. | html |
| images | No | Images to upload as attachments of this note and embed. Reference entry N from the content with <img src="image:N"> (HTML, double quotes) or  (markdown); N indexes THIS array only, not attachments from earlier calls. Unreferenced images are appended at the end; an unresolved placeholder fails the call. To embed an existing attachment use its real URL: <img src="api/attachments/{attachmentId}/image/{filename}">. Images and files together may total at most the server's per-input content limit; add more with create_attachment. | |
| noteId | No | Force a specific note ID (for imports/migrations). Must be 4-32 alphanumeric chars. | |
| prefix | No | Branch-specific title prefix (e.g., "Archive:", "Draft:") | |
| content | Yes | Note body. Text notes: HTML, or markdown with format="markdown"; code blocks as <pre><code class="language-X">...</code></pre> (class on <code>). Code/mermaid/canvas notes: the raw source. Binary notes (file/image with a binary mime): a path, URL, data URL or base64, in the forms images[].data accepts. Link to another note with <a href="note:TARGET_NOTE_ID">text</a> (HTML) or [text](note:TARGET_NOTE_ID) (markdown): the server rewrites it into a real Trilium reference link and rejects unknown IDs; empty link text becomes the target title. Hand-written #root/... anchors are stored as inert links. | |
| branchId | No | Force a specific branch ID (for imports/migrations). Must be 4-32 alphanumeric chars. | |
| isExpanded | No | Whether this note (as a folder) should appear expanded in the tree | |
| dateCreated | No | Set creation date for backdating. Format: "2024-01-15 10:30:00.000+0100" | |
| notePosition | No | Position in parent (10, 20, 30...). Use 5 for first position, 1000000 for last | |
| parentNoteId | Yes | ID of an existing parent note (find one with search_notes/get_note_tree); use "root" only for genuinely top-level notes. | |
| utcDateCreated | No | Set UTC creation date. Format: "2024-01-15 09:30:00.000Z" | |
| utcDateModified | No | Set the UTC last-modified date (e.g. to keep the original date of a note migrated from another app). Format: "2024-01-15 09:30:00.000Z". Needs a Trilium newer than 0.105 (older ones reject it). |