Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
docs(internal-api): render the API reference as a User Guide page
Elian Doran744479be8896
diff --git a/apps/server/internal.openapi.yaml b/apps/server/internal.openapi.yamlindex e2b94863fa..06c1ebd2d6 100644--- a/apps/server/internal.openapi.yaml+++ b/apps/server/internal.openapi.yaml@@ -8,7 +8,7 @@ info:**Important:** This API is primarily intended for internal use by the Trilium client.For external integrations, please use the [ETAPI (External Trilium API)](https://github.com/TriliumNext/Trilium/blob/main/docs/User%20Guide/User%20Guide/Advanced%20Usage/ETAPI%20(REST%20API).md#etapi-rest-api) instead.- ## Authentication+ ## Signing inMost endpoints require session-based authentication. You can authenticate using:- **Password login**: POST to `/api/login` with password@@ -38,7 +38,7 @@ servers:description: Your Trilium servertags:- - name: Authentication+ - name: Sessionsdescription: Login, logout, and session management- name: Notesdescription: Core note operations@@ -80,10 +80,10 @@ security:- tokenAuth: []paths:- # Authentication endpoints+ # Session endpoints/api/login:post:- tags: [Authentication]+ tags: [Sessions]summary: Login with passwordoperationId: loginsecurity: []@@ -114,7 +114,7 @@ paths:/api/login/token:post:- tags: [Authentication]+ tags: [Sessions]summary: Generate API tokenoperationId: generateTokensecurity: []@@ -146,7 +146,7 @@ paths:/api/login/sync:post:- tags: [Authentication, Sync]+ tags: [Sessions, Sync]summary: Sync login using document secretoperationId: loginSyncsecurity: []@@ -181,7 +181,7 @@ paths:/api/login/protected:post:- tags: [Authentication, Security]+ tags: [Sessions, Security]summary: Enter protected sessionoperationId: enterProtectedSessionrequestBody:@@ -203,7 +203,7 @@ paths:/api/logout/protected:post:- tags: [Authentication, Security]+ tags: [Sessions, Security]summary: Exit protected sessionoperationId: exitProtectedSessionresponses:@@ -212,7 +212,7 @@ paths:/api/login/protected/touch:post:- tags: [Authentication, Security]+ tags: [Sessions, Security]summary: Keep protected session aliveoperationId: touchProtectedSessionresponses:@@ -222,7 +222,7 @@ paths:# OAuth endpoints/api/oauth/status:get:- tags: [Authentication]+ tags: [Sessions]summary: Get OAuth statusoperationId: getOAuthStatusresponses:@@ -244,7 +244,7 @@ paths:/api/oauth/validate:get:- tags: [Authentication]+ tags: [Sessions]summary: Validate OAuth configurationoperationId: validateOAuthresponses:diff --git a/apps/server/src/assets/help/help_content.json b/apps/server/src/assets/help/help_content.jsonindex 862974b204..b9776b1dea 100644--- a/apps/server/src/assets/help/help_content.json+++ b/apps/server/src/assets/help/help_content.json@@ -234,7 +234,7 @@"_help_1YeN2MzFUluU": "<p>One core aspect of Trilium that allows it to have support for multiple <a href=\"#root/_help_KSZ04uQ2D1St\">Note Types</a> is the fact that it makes use of various off-the-shelf or reusable libraries.</p><p>This page showcases some of the technologies used, for a better understanding of how Trilium works but also to credit the developers of that particular technology.</p><h2>CKEditor</h2><p>CKEditor is the editor behind <a class=\"reference-link\" href=\"#root/_help_iPIMuisry3hd\">Text</a> notes, as well as integrated in various facets of the application such as the attribute editor in the <a class=\"reference-link\" href=\"#root/_help_AlJ73vBCjWDw\">Status bar</a> or the chat box in the <a class=\"reference-link\" href=\"#root/_help_GBBMSlVSOIGP\">AI</a> sidebar or notes.</p><p>For more information see <a class=\"reference-link\" href=\"#root/_help_MI26XDLSAlCD\">CKEditor</a>.</p><h2>Excalidraw</h2><p><a href=\"https://excalidraw.com/\">Excalidraw</a> is the technology behind the <a class=\"reference-link\" href=\"#root/_help_grjYqerjn243\">Canvas</a> notes. The source code of the library is available on <a href=\"https://github.com/excalidraw/excalidraw\">GitHub</a>.</p><p>We are using an unmodified version of it, so it shares the same <a href=\"https://github.com/excalidraw/excalidraw/issues\">issues</a> as the original.</p><h2>MapLibre GL JS</h2><p>Trilium v0.105.0 introduces <a href=\"https://github.com/maplibre/maplibre-gl-js\">MapLibre GL JS</a> for the <a class=\"reference-link\" href=\"#root/_help_81SGnPGMk7Xc\">Geo Map</a> collection, which brings improved performance by using graphical acceleration (WebGL). Trilium ships its own track parsing logic as well as most of the UI such as the right panel.</p><h2>MindElixir</h2><p>MindElixir is the library we are using for <a class=\"reference-link\" href=\"#root/_help_gBbsAeiuUxI5\">Mind Map</a> note types. The main library is available on <a href=\"https://github.com/SSShooter/mind-elixir-core/issues\">GitHub as mind-elixir-core</a>.</p><p>Trilium ships its own UI which covers the toolbars, the contextual menu, the zoom buttons and the right panel that shows when clicking a node.</p><h2>FullCalendar</h2><p><a href=\"https://fullcalendar.io/\">FullCalendar</a> is the technology behind the <a class=\"reference-link\" href=\"#root/_help_xWbu3jpNWapp\">Calendar</a> collection, providing the various views (day, week, month, year) and the event management. Trilium also ships its own UI in the form of the popup that appears when editing, as well as the header that appears in the <a class=\"reference-link\" href=\"#root/_help_CssoWBu8I7jF\">Collection Properties</a>.</p><p>Licensed under the MIT license.</p>","_help_MI26XDLSAlCD": "<h2>Editor core</h2><p>The CKEditor is the WYSIWYG (standing for What You See Is What You Get) editor behind <a href=\"#root/_help_iPIMuisry3hd\">Text</a> notes.</p><p>Their website is <a href=\"https://ckeditor.com/\">ckeditor.com</a>.</p><p>CKEditor by itself is a commercial product, but the core is open-source. As described in <a href=\"https://ckeditor.com/docs/ckeditor5/latest/features/index.html\">its documentation</a>, the editor supports quite a large number of features. Do note that not all the features are enabled in Trilium.</p><h2>Premium features</h2><p>CKEditor ships some plugins as premium (slash commands, templates, AI integration). Initially Trilium (since v0.96.0) shipped some of them like slash commands as part of a license grant from CKEditor to the Trilium Notes developers.</p><p>In v0.105.0 we've decided to replace those premium plugins with our own open-source implementations. This also means that we can better tailor those plugins to the Trilium app.</p><h2>Plugins</h2><p>The CKEditor ecosystem is quite extensible, in the sense that custom plugins can be written to extend the functionality of the editor beyond its original scope.</p><p>Trilium makes use of such features:</p><ul><li>The math feature is added by a version of <a href=\"https://github.com/isaul32/ckeditor5-math\">isaul32/ckeditor5-math: Math feature for CKEditor 5.</a> modified by us to fit our needs.</li><li><a href=\"https://github.com/mlewand/ckeditor5-keyboard-marker\">mlewand/ckeditor5-keyboard-marker: Plugin adds support for the keyboard input element (<code><kbd></code>) to CKEditor 5.</a></li><li>A modified version of <a href=\"https://github.com/ThomasAitken/ckeditor5-footnotes\">ThomasAitken/ckeditor5-footnotes: Footnotes plugin for CKEditor5</a> to allow footnotes.</li></ul><p>Apart from that, Trilium also has its own set of specific plugins such as:</p><ul><li><a class=\"reference-link\" href=\"#root/_help_2x0ZAX9ePtzV\">Cut to subnote</a></li><li><a class=\"reference-link\" href=\"#root/_help_nBAXQFj20hS1\">Include Note</a>, which also shows drawing canvases and <a href=\"#root/_help_CohkqWQC1iBv\">Mermaid diagrams</a> in place.</li><li>Mentions, for linking pages.</li><li><a class=\"reference-link\" href=\"#root/_help_Oau6X9rCuegd\">Markdown</a></li><li><a href=\"#root/_help_QEAPj01N5f7w\">Reference links</a></li><li><a href=\"#root/_help_NwBbFdNZ9h7O\">Admonitions</a>, we ended up creating our own plugin but <a href=\"https://github.com/aarkue/ckeditor5-admonition\">aarkue/ckeditor5-admonition</a> was a good inspiration (including the toolbar icon).</li></ul>","_help_m1lbrzyKDaRB": "<p>Whereas some applications use file names to uniquely identify notes, Trilium uses the concept of Note ID.</p><p>Generally, the Note ID is a 12-character long alphanumeric sequence (including both lower and upper case letter) that is randomly generated for each new note.</p><h2>How does the import/export affect the note IDs</h2><p>When notes are exported, their note ID is kept in the metadata of the export. However when they are imported back in, a new note ID is generated for all the notes. This also includes other entities that are part of the import/export process such as <a class=\"reference-link\" href=\"#root/_help_0vhv7lsOLy82\">Attachments</a>.</p><h2>Note collisions</h2><p>Since the Note ID is a fixed-width randomly generated number, due to the <a href=\"https://en.wikipedia.org/wiki/Pigeonhole_principle\">pigeonhole principle</a>, there is a possibility that a newly created note will have the same ID as an existing note.</p><p>Since the note ID is alphanumeric and the length is 12 we have <span class=\"math-tex\">\\(62^{12}\\)</span> unique IDs. However since we are generating them randomly, we can use a collision calculator such as the one for <a href=\"https://alex7kom.github.io/nano-nanoid-cc/?alphabet=0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz&size=12&speed=1000&speedUnit=hour\">Nano ID</a> to determine that we'd need to create 1000 notes per hour every hour for 9 centuries in order to have at least 1% probability of a note collision.</p><p>As such, Trilium does not take any explicit action against potential note collisions, similar to other software that makes uses of unique hashes such as <a href=\"https://stackoverflow.com/questions/10434326/hash-collision-in-git\">Git</a>. If one would theoretically occur, what would most likely happen is that the existing note will be replaced by the new one.</p>",- "_help_z8O2VG4ZZJD7": "<p>This is the internal API used by the Trilium Notes client application.</p><p><strong>Important:</strong> This API is primarily intended for internal use by the Trilium client. For external integrations, please use the <a href=\"https://github.com/TriliumNext/Trilium/blob/main/docs/User%20Guide/User%20Guide/Advanced%20Usage/ETAPI%20(REST%20API).md#etapi-rest-api\">ETAPI (External Trilium API)</a> instead.</p><h2>Authentication</h2><p>Most endpoints require session-based authentication. You can authenticate using:</p><ul><li><strong>Password login</strong>: POST to <code>/api/login</code> with password</li><li><strong>Token authentication</strong>: Generate a token via <code>/api/login/token</code></li><li><strong>Sync authentication</strong>: Use document secret for sync operations</li></ul><h2>Rate Limiting</h2><p>Authentication endpoints are rate-limited to prevent brute force attacks.</p><h2>CSRF Protection</h2><p>State-changing operations require CSRF tokens when using session authentication.</p><h2>Authentication</h2><h3><code>sessionAuth</code></h3><p>API key in the <code>trilium.sid</code> cookie.</p><p>Session cookie obtained from login</p><h3><code>tokenAuth</code></h3><p>API key in the <code>Authorization</code> header.</p><p>API token in format \"Bearer {token}\"</p><h2>Authentication</h2><p>Login, logout, and session management</p><h3>Login with password</h3><p><code>POST /api/login</code> · <code>login</code></p><p><strong>Authorization</strong>: none</p><p><strong>Request body</strong> (required)</p><ul><li><code>application/x-www-form-urlencoded</code>: <code>object</code></li></ul><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>password</code> <br><em>required</em></td><td><code>string (password)</code></td></tr><tr><td><code>totpToken</code></td><td><code>string</code> <br>TOTP token if 2FA is enabled</td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Login successful</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">401: Invalid credentials or TOTP token</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Generate API token</h3><p><code>POST /api/login/token</code> · <code>generateToken</code></p><p><strong>Authorization</strong>: none</p><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>password</code> <br><em>required</em></td><td><code>string (password)</code></td></tr><tr><td><code>tokenName</code></td><td><code>string</code> <br>Optional name for the token</td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"password\": \"string\",\n \"tokenName\": \"string\"\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">201: Token created</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>authToken</code></td><td><code>string</code> <br>API authentication token</td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"authToken\": \"string\"\n}</code></pre></div></div></div></section></div><h3>Sync login using document secret</h3><p><code>POST /api/login/sync</code> · <code>loginSync</code></p><p><strong>Authorization</strong>: none</p><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>timestamp</code> <br><em>required</em></td><td><code>string (date-time)</code></td></tr><tr><td><code>hash</code> <br><em>required</em></td><td><code>string</code> <br>HMAC hash of document secret and timestamp</td></tr><tr><td><code>syncVersion</code> <br><em>required</em></td><td><code>integer</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"timestamp\": \"2019-08-24T14:15:22Z\",\n \"hash\": \"string\",\n \"syncVersion\": 0\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Login successful</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>instanceId</code></td><td><code>string</code></td></tr><tr><td><code>maxEntityChangeId</code></td><td><code>string</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"instanceId\": \"string\",\n \"maxEntityChangeId\": \"string\"\n}</code></pre></div></div></div></section></div><h3>Enter protected session</h3><p><code>POST /api/login/protected</code> · <code>enterProtectedSession</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>password</code> <br><em>required</em></td><td><code>string (password)</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"password\": \"string\"\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Protected session entered</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">401: Invalid password</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Exit protected session</h3><p><code>POST /api/logout/protected</code> · <code>exitProtectedSession</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: Protected session exited</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Keep protected session alive</h3><p><code>POST /api/login/protected/touch</code> · <code>touchProtectedSession</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: Session refreshed</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Get OAuth status</h3><p><code>GET /api/oauth/status</code> · <code>getOAuthStatus</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: OAuth status</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>enabled</code></td><td><code>boolean</code></td></tr><tr><td><code>configured</code></td><td><code>boolean</code></td></tr><tr><td><code>providers</code></td><td><code>array of string</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"enabled\": true,\n \"configured\": true,\n \"providers\": [\n \"string\"\n ]\n}</code></pre></div></div></div></section></div><h3>Validate OAuth configuration</h3><p><code>GET /api/oauth/validate</code> · <code>validateOAuth</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: OAuth validation result</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>valid</code></td><td><code>boolean</code></td></tr><tr><td><code>errors</code></td><td><code>array of string</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"valid\": true,\n \"errors\": [\n \"string\"\n ]\n}</code></pre></div></div></div></section></div><h2>Notes</h2><p>Core note operations</p><h3>Get note metadata</h3><p><code>GET /api/notes/{noteId}</code> · <code>getNote</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Note metadata</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>Note</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr><tr><td><code>title</code> <br><em>required</em></td><td><code>string</code> <br>Note title</td></tr><tr><td><code>type</code> <br><em>required</em></td><td><code>NoteType</code> <br>One of <code>text</code>, <code>code</code>, <code>render</code>, <code>file</code>, <code>image</code>, <code>search</code>, <code>relationMap</code>, <code>book</code>, <code>noteMap</code>, <code>mermaid</code>, <code>canvas</code>, <code>webView</code>, <code>launcher</code>, <code>doc</code>, <code>contentWidget</code>, <code>mindMap</code>, <code>geoMap</code>.</td></tr><tr><td><code>mime</code> <br><em>required</em></td><td><code>string</code> <br>MIME type</td></tr><tr><td><code>isProtected</code> <br><em>required</em></td><td><code>boolean</code> <br>Whether note is protected</td></tr><tr><td><code>blobId</code></td><td><code>string</code> <br>ID of content blob</td></tr><tr><td><code>dateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>dateModified</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateModified</code></td><td><code>string (date-time)</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"noteId\": \"ur11rSfHkzeV\",\n \"title\": \"string\",\n \"type\": \"text\",\n \"mime\": \"text/html\",\n \"isProtected\": true,\n \"blobId\": \"string\",\n \"dateCreated\": \"2019-08-24T14:15:22Z\",\n \"dateModified\": \"2019-08-24T14:15:22Z\",\n \"utcDateCreated\": \"2019-08-24T14:15:22Z\",\n \"utcDateModified\": \"2019-08-24T14:15:22Z\"\n}</code></pre></div></div></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">404: Note not found</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Delete note</h3><p><code>DELETE /api/notes/{noteId}</code> · <code>deleteNote</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr></tbody></table></figure><p><strong>Query parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>taskId</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>eraseNotes</code></td><td><code>boolean</code></td></tr><tr><td><code>last</code> <br><em>required</em></td><td><code>boolean</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: Note deleted</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">404: Note not found</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Get note content</h3><p><code>GET /api/notes/{noteId}/blob</code> · <code>getNoteContent</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Note content</p><div class=\"trilium-tab-panel\"><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\"><code>text/html</code>: <code>string</code></p><div class=\"trilium-tab-panel\"><p> </p></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\"><code>text/plain</code>: <code>string</code></p><div class=\"trilium-tab-panel\"><p> </p></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\"><code>application/json</code>: <code>object</code></p><div class=\"trilium-tab-panel\"><pre><code class=\"language-application-json\">{}</code></pre></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\"><code>application/octet-stream</code>: <code>string (binary)</code></p><div class=\"trilium-tab-panel\"><p> </p></div></section></div></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">404: Note not found</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Update note content</h3><p><code>PUT /api/notes/{noteId}/data</code> · <code>updateNoteContent</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr></tbody></table></figure><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>content</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>attachments</code></td><td><code>array of Attachment</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"content\": \"string\",\n \"attachments\": [\n {\n \"attachmentId\": \"string\",\n \"ownerId\": \"string\",\n \"role\": \"image\",\n \"mime\": \"string\",\n \"title\": \"string\",\n \"blobId\": \"string\",\n \"dateModified\": \"2019-08-24T14:15:22Z\",\n \"utcDateModified\": \"2019-08-24T14:15:22Z\"\n }\n ]\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: Content updated</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">404: Note not found</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Get note timestamps</h3><p><code>GET /api/notes/{noteId}/metadata</code> · <code>getNoteMetadata</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Note timestamps</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>Timestamps</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>dateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>dateModified</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateModified</code></td><td><code>string (date-time)</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"dateCreated\": \"2019-08-24T14:15:22Z\",\n \"dateModified\": \"2019-08-24T14:15:22Z\",\n \"utcDateCreated\": \"2019-08-24T14:15:22Z\",\n \"utcDateModified\": \"2019-08-24T14:15:22Z\"\n}</code></pre></div></div></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">404: Note not found</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Change note title</h3><p><code>PUT /api/notes/{noteId}/title</code> · <code>updateNoteTitle</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr></tbody></table></figure><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>title</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"title\": \"string\"\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: Title updated</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">404: Note not found</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Change note type and MIME</h3><p><code>PUT /api/notes/{noteId}/type</code> · <code>updateNoteType</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr></tbody></table></figure><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code> <br><em>required</em></td><td><code>NoteType</code> <br>One of <code>text</code>, <code>code</code>, <code>render</code>, <code>file</code>, <code>image</code>, <code>search</code>, <code>relationMap</code>, <code>book</code>, <code>noteMap</code>, <code>mermaid</code>, <code>canvas</code>, <code>webView</code>, <code>launcher</code>, <code>doc</code>, <code>contentWidget</code>, <code>mindMap</code>, <code>geoMap</code>.</td></tr><tr><td><code>mime</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"type\": \"text\",\n \"mime\": \"string\"\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: Type updated</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">404: Note not found</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Protect or unprotect note</h3><p><code>PUT /api/notes/{noteId}/protect/{isProtected}</code> · <code>protectNote</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr><tr><td><code>isProtected</code> <br><em>required</em></td><td><code>boolean</code></td></tr></tbody></table></figure><p><strong>Query parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>subtree</code></td><td><code>boolean</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: Protection status updated</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">404: Note not found</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Undelete note</h3><p><code>PUT /api/notes/{noteId}/undelete</code> · <code>undeleteNote</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: Note undeleted</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">404: Note not found</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Create new note</h3><p><code>POST /api/notes/{parentNoteId}/children</code> · <code>createNote</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>parentNoteId</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Query parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>target</code></td><td><code>string</code> <br>One of <code>after</code>, <code>into</code>.</td></tr><tr><td><code>targetBranchId</code></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>CreateNoteRequest</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>title</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>content</code></td><td><code>string</code></td></tr><tr><td><code>type</code> <br><em>required</em></td><td><code>NoteType</code> <br>One of <code>text</code>, <code>code</code>, <code>render</code>, <code>file</code>, <code>image</code>, <code>search</code>, <code>relationMap</code>, <code>book</code>, <code>noteMap</code>, <code>mermaid</code>, <code>canvas</code>, <code>webView</code>, <code>launcher</code>, <code>doc</code>, <code>contentWidget</code>, <code>mindMap</code>, <code>geoMap</code>.</td></tr><tr><td><code>mime</code></td><td><code>string</code></td></tr><tr><td><code>isProtected</code></td><td><code>boolean</code></td></tr><tr><td><code>isExpanded</code></td><td><code>boolean</code></td></tr><tr><td><code>notePosition</code></td><td><code>integer</code></td></tr><tr><td><code>prefix</code></td><td><code>string</code></td></tr><tr><td><code>parentNoteId</code></td><td><code>string</code></td></tr><tr><td><code>templateNoteId</code></td><td><code>string</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"title\": \"string\",\n \"content\": \"string\",\n \"type\": \"text\",\n \"mime\": \"string\",\n \"isProtected\": true,\n \"isExpanded\": true,\n \"notePosition\": 0,\n \"prefix\": \"string\",\n \"parentNoteId\": \"string\",\n \"templateNoteId\": \"string\"\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">201: Note created</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>note</code></td><td><code>Note</code></td></tr><tr><td><code>branch</code></td><td><code>Branch</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"note\": {\n \"noteId\": \"ur11rSfHkzeV\",\n \"title\": \"string\",\n \"type\": \"text\",\n \"mime\": \"text/html\",\n \"isProtected\": true,\n \"blobId\": \"string\",\n \"dateCreated\": \"2019-08-24T14:15:22Z\",\n \"dateModified\": \"2019-08-24T14:15:22Z\",\n \"utcDateCreated\": \"2019-08-24T14:15:22Z\",\n \"utcDateModified\": \"2019-08-24T14:15:22Z\"\n },\n \"branch\": {\n \"branchId\": \"string\",\n \"noteId\": \"string\",\n \"parentNoteId\": \"string\",\n \"notePosition\": 0,\n \"prefix\": \"string\",\n \"isExpanded\": true\n }\n}</code></pre></div></div></div></section></div><h3>Duplicate note subtree</h3><p><code>POST /api/notes/{noteId}/duplicate/{parentNoteId}</code> · <code>duplicateNote</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr><tr><td><code>parentNoteId</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">201: Note duplicated</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>Note</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr><tr><td><code>title</code> <br><em>required</em></td><td><code>string</code> <br>Note title</td></tr><tr><td><code>type</code> <br><em>required</em></td><td><code>NoteType</code> <br>One of <code>text</code>, <code>code</code>, <code>render</code>, <code>file</code>, <code>image</code>, <code>search</code>, <code>relationMap</code>, <code>book</code>, <code>noteMap</code>, <code>mermaid</code>, <code>canvas</code>, <code>webView</code>, <code>launcher</code>, <code>doc</code>, <code>contentWidget</code>, <code>mindMap</code>, <code>geoMap</code>.</td></tr><tr><td><code>mime</code> <br><em>required</em></td><td><code>string</code> <br>MIME type</td></tr><tr><td><code>isProtected</code> <br><em>required</em></td><td><code>boolean</code> <br>Whether note is protected</td></tr><tr><td><code>blobId</code></td><td><code>string</code> <br>ID of content blob</td></tr><tr><td><code>dateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>dateModified</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateModified</code></td><td><code>string (date-time)</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"noteId\": \"ur11rSfHkzeV\",\n \"title\": \"string\",\n \"type\": \"text\",\n \"mime\": \"text/html\",\n \"isProtected\": true,\n \"blobId\": \"string\",\n \"dateCreated\": \"2019-08-24T14:15:22Z\",\n \"dateModified\": \"2019-08-24T14:15:22Z\",\n \"utcDateCreated\": \"2019-08-24T14:15:22Z\",\n \"utcDateModified\": \"2019-08-24T14:15:22Z\"\n}</code></pre></div></div></div></section></div><h3>Force save revision</h3><p><code>POST /api/notes/{noteId}/revision</code> · <code>saveRevision</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">201: Revision saved</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>Revision</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>revisionId</code></td><td><code>string</code></td></tr><tr><td><code>noteId</code></td><td><code>string</code></td></tr><tr><td><code>title</code></td><td><code>string</code></td></tr><tr><td><code>type</code></td><td><code>NoteType</code> <br>One of <code>text</code>, <code>code</code>, <code>render</code>, <code>file</code>, <code>image</code>, <code>search</code>, <code>relationMap</code>, <code>book</code>, <code>noteMap</code>, <code>mermaid</code>, <code>canvas</code>, <code>webView</code>, <code>launcher</code>, <code>doc</code>, <code>contentWidget</code>, <code>mindMap</code>, <code>geoMap</code>.</td></tr><tr><td><code>mime</code></td><td><code>string</code></td></tr><tr><td><code>dateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateCreated</code></td><td><code>string (date-time)</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"revisionId\": \"string\",\n \"noteId\": \"string\",\n \"title\": \"string\",\n \"type\": \"text\",\n \"mime\": \"string\",\n \"dateCreated\": \"2019-08-24T14:15:22Z\",\n \"utcDateCreated\": \"2019-08-24T14:15:22Z\"\n}</code></pre></div></div></div></section></div><h3>Sort child notes</h3><p><code>PUT /api/notes/{noteId}/sort-children</code> · <code>sortChildren</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr></tbody></table></figure><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>sortBy</code></td><td><code>string</code> <br>One of <code>title</code>, <code>dateCreated</code>, <code>dateModified</code>.</td></tr><tr><td><code>sortDirection</code></td><td><code>string</code> <br>One of <code>asc</code>, <code>desc</code>.</td></tr><tr><td><code>foldersFirst</code></td><td><code>boolean</code></td></tr><tr><td><code>sortNatural</code></td><td><code>boolean</code></td></tr><tr><td><code>sortLocale</code></td><td><code>string</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"sortBy\": \"title\",\n \"sortDirection\": \"asc\",\n \"foldersFirst\": true,\n \"sortNatural\": true,\n \"sortLocale\": \"string\"\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: Children sorted</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Convert note to attachment</h3><p><code>POST /api/notes/{noteId}/convert-to-attachment</code> · <code>convertToAttachment</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Note converted to attachment</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>Attachment</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>attachmentId</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>ownerId</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>role</code> <br><em>required</em></td><td><code>string</code> <br>One of <code>image</code>, <code>file</code>.</td></tr><tr><td><code>mime</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>title</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>blobId</code></td><td><code>string</code></td></tr><tr><td><code>dateModified</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateModified</code></td><td><code>string (date-time)</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"attachmentId\": \"string\",\n \"ownerId\": \"string\",\n \"role\": \"image\",\n \"mime\": \"string\",\n \"title\": \"string\",\n \"blobId\": \"string\",\n \"dateModified\": \"2019-08-24T14:15:22Z\",\n \"utcDateModified\": \"2019-08-24T14:15:22Z\"\n}</code></pre></div></div></div></section></div><h3>Upload file to note</h3><p><code>PUT /api/notes/{noteId}/file</code> · <code>uploadFileToNote</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr></tbody></table></figure><p><strong>Request body</strong> (required)</p><ul><li><code>multipart/form-data</code>: <code>object</code></li></ul><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>upload</code></td><td><code>string (binary)</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: File uploaded</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Open file note</h3><p><code>GET /api/notes/{noteId}/open</code> · <code>openFileNote</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: File content</p><div class=\"trilium-tab-panel\"><ul><li><code>application/octet-stream</code>: <code>string (binary)</code></li></ul></div></section></div><h3>Download file note</h3><p><code>GET /api/notes/download/{noteId}</code> · <code>downloadFileNote</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: File content</p><div class=\"trilium-tab-panel\"><ul><li><code>application/octet-stream</code>: <code>string (binary)</code></li></ul></div></section></div><h3>Download file note (alternative path)</h3><p><code>GET /api/notes/{noteId}/download</code> · <code>downloadFileNoteAlt</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: File content</p><div class=\"trilium-tab-panel\"><ul><li><code>application/octet-stream</code>: <code>string (binary)</code></li></ul></div></section></div><h3>Save note to temp directory</h3><p><code>POST /api/notes/{noteId}/save-to-tmp-dir</code> · <code>saveToTmpDir</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: File saved to temp directory</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>filePath</code></td><td><code>string</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"filePath\": \"string\"\n}</code></pre></div></div></div></section></div><h3>Update note from modified temp file</h3><p><code>POST /api/notes/{noteId}/upload-modified-file</code> · <code>uploadModifiedFile</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr></tbody></table></figure><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>filePath</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"filePath\": \"string\"\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: Note updated from file</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Get image from note</h3><p><code>GET /api/images/{noteId}/{filename}</code> · <code>getNoteImage</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr><tr><td><code>filename</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Image content</p><div class=\"trilium-tab-panel\"><ul><li><code>image/*</code>: <code>string (binary)</code></li></ul></div></section></div><h3>Update image note</h3><p><code>PUT /api/images/{noteId}</code> · <code>updateImageNote</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr></tbody></table></figure><p><strong>Request body</strong> (required)</p><ul><li><code>multipart/form-data</code>: <code>object</code></li></ul><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>upload</code></td><td><code>string (binary)</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: Image updated</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Execute bulk action</h3><p><code>POST /api/bulk-action/execute</code> · <code>executeBulkAction</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>action</code></td><td><code>string</code></td></tr><tr><td><code>noteIds</code></td><td><code>array of string</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"action\": \"string\",\n \"noteIds\": [\n \"string\"\n ]\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Bulk action results</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Get affected notes count</h3><p><code>POST /api/bulk-action/affected-notes</code> · <code>getAffectedNotesCount</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>action</code></td><td><code>string</code></td></tr><tr><td><code>noteIds</code></td><td><code>array of string</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"action\": \"string\",\n \"noteIds\": [\n \"string\"\n ]\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Affected notes count</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>count</code></td><td><code>integer</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"count\": 0\n}</code></pre></div></div></div></section></div><h3>Preview note deletion</h3><p><code>POST /api/delete-notes-preview</code> · <code>previewNoteDeletion</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>branchIdsToDelete</code></td><td><code>array of string</code></td></tr><tr><td><code>deleteAllClones</code></td><td><code>boolean</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"branchIdsToDelete\": [\n \"string\"\n ],\n \"deleteAllClones\": true\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Deletion preview</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>notesToDelete</code></td><td><code>array of string</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"notesToDelete\": [\n \"string\"\n ]\n}</code></pre></div></div></div></section></div><h3>Erase deleted notes</h3><p><code>POST /api/notes/erase-deleted-notes-now</code> · <code>eraseDeletedNotes</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: Deleted notes erased</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h2>Tree</h2><p>Note tree structure and branches</p><h3>Get tree structure</h3><p><code>GET /api/tree</code> · <code>getTree</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Query parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>subTreeNoteId</code></td><td><code>string</code> <br>Limit tree to this note and descendants</td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Tree structure</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>notes</code></td><td><code>array of Note</code></td></tr><tr><td><code>branches</code></td><td><code>array of Branch</code></td></tr><tr><td><code>attributes</code></td><td><code>array of Attribute</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"notes\": [\n {\n \"noteId\": \"ur11rSfHkzeV\",\n \"title\": \"string\",\n \"type\": \"text\",\n \"mime\": \"text/html\",\n \"isProtected\": true,\n \"blobId\": \"string\",\n \"dateCreated\": \"2019-08-24T14:15:22Z\",\n \"dateModified\": \"2019-08-24T14:15:22Z\",\n \"utcDateCreated\": \"2019-08-24T14:15:22Z\",\n \"utcDateModified\": \"2019-08-24T14:15:22Z\"\n }\n ],\n \"branches\": [\n {\n \"branchId\": \"string\",\n \"noteId\": \"string\",\n \"parentNoteId\": \"string\",\n \"notePosition\": 0,\n \"prefix\": \"string\",\n \"isExpanded\": true\n }\n ],\n \"attributes\": [\n {\n \"attributeId\": \"string\",\n \"noteId\": \"string\",\n \"type\": \"label\",\n \"name\": \"string\",\n \"value\": \"string\",\n \"position\": 0,\n \"isInheritable\": true\n }\n ]\n}</code></pre></div></div></div></section></div><h3>Load specific notes</h3><p><code>POST /api/tree/load</code> · <code>loadNotes</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>noteIds</code> <br><em>required</em></td><td><code>array of string</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"noteIds\": [\n \"string\"\n ]\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Loaded notes</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>notes</code></td><td><code>array of Note</code></td></tr><tr><td><code>branches</code></td><td><code>array of Branch</code></td></tr><tr><td><code>attributes</code></td><td><code>array of Attribute</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"notes\": [\n {\n \"noteId\": \"ur11rSfHkzeV\",\n \"title\": \"string\",\n \"type\": \"text\",\n \"mime\": \"text/html\",\n \"isProtected\": true,\n \"blobId\": \"string\",\n \"dateCreated\": \"2019-08-24T14:15:22Z\",\n \"dateModified\": \"2019-08-24T14:15:22Z\",\n \"utcDateCreated\": \"2019-08-24T14:15:22Z\",\n \"utcDateModified\": \"2019-08-24T14:15:22Z\"\n }\n ],\n \"branches\": [\n {\n \"branchId\": \"string\",\n \"noteId\": \"string\",\n \"parentNoteId\": \"string\",\n \"notePosition\": 0,\n \"prefix\": \"string\",\n \"isExpanded\": true\n }\n ],\n \"attributes\": [\n {\n \"attributeId\": \"string\",\n \"noteId\": \"string\",\n \"type\": \"label\",\n \"name\": \"string\",\n \"value\": \"string\",\n \"position\": 0,\n \"isInheritable\": true\n }\n ]\n}</code></pre></div></div></div></section></div><h3>Delete branch</h3><p><code>DELETE /api/branches/{branchId}</code> · <code>deleteBranch</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>branchId</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Query parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>taskId</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>eraseNotes</code></td><td><code>boolean</code></td></tr><tr><td><code>last</code> <br><em>required</em></td><td><code>boolean</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Branch deleted</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>noteDeleted</code></td><td><code>boolean</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"noteDeleted\": true\n}</code></pre></div></div></div></section></div><h3>Move branch to new parent</h3><p><code>PUT /api/branches/{branchId}/move-to/{parentBranchId}</code> · <code>moveBranchToParent</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>branchId</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>parentBranchId</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: Branch moved</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Move branch before another</h3><p><code>PUT /api/branches/{branchId}/move-before/{beforeBranchId}</code> · <code>moveBranchBefore</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>branchId</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>beforeBranchId</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: Branch moved</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Move branch after another</h3><p><code>PUT /api/branches/{branchId}/move-after/{afterBranchId}</code> · <code>moveBranchAfter</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>branchId</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>afterBranchId</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: Branch moved</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Set branch expanded state</h3><p><code>PUT /api/branches/{branchId}/expanded/{expanded}</code> · <code>setBranchExpanded</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>branchId</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>expanded</code> <br><em>required</em></td><td><code>boolean</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: Expanded state updated</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Set subtree expanded state</h3><p><code>PUT /api/branches/{branchId}/expanded-subtree/{expanded}</code> · <code>setSubtreeExpanded</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>branchId</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>expanded</code> <br><em>required</em></td><td><code>boolean</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: Subtree expanded state updated</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Set branch prefix</h3><p><code>PUT /api/branches/{branchId}/set-prefix</code> · <code>setBranchPrefix</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>branchId</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>prefix</code></td><td><code>string | null</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"prefix\": \"string\"\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: Prefix updated</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Clone note to branch</h3><p><code>PUT /api/notes/{noteId}/clone-to-branch/{parentBranchId}</code> · <code>cloneToBranch</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr><tr><td><code>parentBranchId</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Note cloned</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>Branch</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>branchId</code> <br><em>required</em></td><td><code>string</code> <br>Branch ID (parentNoteId_noteId)</td></tr><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>parentNoteId</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>notePosition</code> <br><em>required</em></td><td><code>integer</code></td></tr><tr><td><code>prefix</code></td><td><code>string | null</code></td></tr><tr><td><code>isExpanded</code></td><td><code>boolean</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"branchId\": \"string\",\n \"noteId\": \"string\",\n \"parentNoteId\": \"string\",\n \"notePosition\": 0,\n \"prefix\": \"string\",\n \"isExpanded\": true\n}</code></pre></div></div></div></section></div><h3>Clone note to parent note</h3><p><code>PUT /api/notes/{noteId}/clone-to-note/{parentNoteId}</code> · <code>cloneToNote</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr><tr><td><code>parentNoteId</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Note cloned</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>Branch</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>branchId</code> <br><em>required</em></td><td><code>string</code> <br>Branch ID (parentNoteId_noteId)</td></tr><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>parentNoteId</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>notePosition</code> <br><em>required</em></td><td><code>integer</code></td></tr><tr><td><code>prefix</code></td><td><code>string | null</code></td></tr><tr><td><code>isExpanded</code></td><td><code>boolean</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"branchId\": \"string\",\n \"noteId\": \"string\",\n \"parentNoteId\": \"string\",\n \"notePosition\": 0,\n \"prefix\": \"string\",\n \"isExpanded\": true\n}</code></pre></div></div></div></section></div><h3>Clone note after branch</h3><p><code>PUT /api/notes/{noteId}/clone-after/{afterBranchId}</code> · <code>cloneAfterBranch</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr><tr><td><code>afterBranchId</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Note cloned</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>Branch</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>branchId</code> <br><em>required</em></td><td><code>string</code> <br>Branch ID (parentNoteId_noteId)</td></tr><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>parentNoteId</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>notePosition</code> <br><em>required</em></td><td><code>integer</code></td></tr><tr><td><code>prefix</code></td><td><code>string | null</code></td></tr><tr><td><code>isExpanded</code></td><td><code>boolean</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"branchId\": \"string\",\n \"noteId\": \"string\",\n \"parentNoteId\": \"string\",\n \"notePosition\": 0,\n \"prefix\": \"string\",\n \"isExpanded\": true\n}</code></pre></div></div></div></section></div><h3>Toggle note presence in parent</h3><p><code>PUT /api/notes/{noteId}/toggle-in-parent/{parentNoteId}/{present}</code> · <code>toggleInParent</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr><tr><td><code>parentNoteId</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>present</code> <br><em>required</em></td><td><code>boolean</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: Presence toggled</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h2>Attributes</h2><p>Note attributes and metadata</p><h3>Get effective note attributes</h3><p><code>GET /api/notes/{noteId}/attributes</code> · <code>getNoteAttributes</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Note attributes</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>array of Attribute</code></li></ul><pre><code class=\"language-application-json\">[\n {\n \"attributeId\": \"string\",\n \"noteId\": \"string\",\n \"type\": \"label\",\n \"name\": \"string\",\n \"value\": \"string\",\n \"position\": 0,\n \"isInheritable\": true\n }\n]</code></pre></div></section></div><h3>Update all note attributes</h3><p><code>PUT /api/notes/{noteId}/attributes</code> · <code>updateNoteAttributes</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr></tbody></table></figure><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>array of Attribute</code></li></ul><pre><code class=\"language-application-json\">[\n {\n \"attributeId\": \"string\",\n \"noteId\": \"string\",\n \"type\": \"label\",\n \"name\": \"string\",\n \"value\": \"string\",\n \"position\": 0,\n \"isInheritable\": true\n }\n]</code></pre><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: Attributes updated</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Add note attribute</h3><p><code>POST /api/notes/{noteId}/attributes</code> · <code>addNoteAttribute</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr></tbody></table></figure><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>Attribute</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>attributeId</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>type</code> <br><em>required</em></td><td><code>string</code> <br>One of <code>label</code>, <code>relation</code>.</td></tr><tr><td><code>name</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>value</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>position</code></td><td><code>integer</code></td></tr><tr><td><code>isInheritable</code></td><td><code>boolean</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"attributeId\": \"string\",\n \"noteId\": \"string\",\n \"type\": \"label\",\n \"name\": \"string\",\n \"value\": \"string\",\n \"position\": 0,\n \"isInheritable\": true\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">201: Attribute added</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>Attribute</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>attributeId</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>type</code> <br><em>required</em></td><td><code>string</code> <br>One of <code>label</code>, <code>relation</code>.</td></tr><tr><td><code>name</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>value</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>position</code></td><td><code>integer</code></td></tr><tr><td><code>isInheritable</code></td><td><code>boolean</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"attributeId\": \"string\",\n \"noteId\": \"string\",\n \"type\": \"label\",\n \"name\": \"string\",\n \"value\": \"string\",\n \"position\": 0,\n \"isInheritable\": true\n}</code></pre></div></div></div></section></div><h3>Delete attribute</h3><p><code>DELETE /api/notes/{noteId}/attributes/{attributeId}</code> · <code>deleteAttribute</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr><tr><td><code>attributeId</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: Attribute deleted</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Update single attribute</h3><p><code>PUT /api/notes/{noteId}/attribute</code> · <code>updateAttribute</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr></tbody></table></figure><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>Attribute</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>attributeId</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>type</code> <br><em>required</em></td><td><code>string</code> <br>One of <code>label</code>, <code>relation</code>.</td></tr><tr><td><code>name</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>value</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>position</code></td><td><code>integer</code></td></tr><tr><td><code>isInheritable</code></td><td><code>boolean</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"attributeId\": \"string\",\n \"noteId\": \"string\",\n \"type\": \"label\",\n \"name\": \"string\",\n \"value\": \"string\",\n \"position\": 0,\n \"isInheritable\": true\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: Attribute updated</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Set attribute value</h3><p><code>PUT /api/notes/{noteId}/set-attribute</code> · <code>setAttribute</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr></tbody></table></figure><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code> <br><em>required</em></td><td><code>string</code> <br>One of <code>label</code>, <code>relation</code>.</td></tr><tr><td><code>name</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>value</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"type\": \"label\",\n \"name\": \"string\",\n \"value\": \"string\"\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: Attribute set</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Create relation</h3><p><code>PUT /api/notes/{noteId}/relations/{name}/to/{targetNoteId}</code> · <code>createRelation</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr><tr><td><code>name</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>targetNoteId</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: Relation created</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Delete relation</h3><p><code>DELETE /api/notes/{noteId}/relations/{name}/to/{targetNoteId}</code> · <code>deleteRelation</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr><tr><td><code>name</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>targetNoteId</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: Relation deleted</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Get attribute name suggestions</h3><p><code>GET /api/attribute-names</code> · <code>getAttributeNames</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Query parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code> <br><em>required</em></td><td><code>string</code> <br>One of <code>label</code>, <code>relation</code>.</td></tr><tr><td><code>query</code></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Attribute names</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>array of string</code></li></ul><pre><code class=\"language-application-json\">[\n \"string\"\n]</code></pre></div></section></div><h3>Get values for attribute</h3><p><code>GET /api/attribute-values/{attributeName}</code> · <code>getAttributeValues</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>attributeName</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Attribute values</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>array of string</code></li></ul><pre><code class=\"language-application-json\">[\n \"string\"\n]</code></pre></div></section></div><h2>Attachments</h2><p>File attachments</p><h3>Stream file with partial content support</h3><p><code>GET /api/attachments/{attachmentId}/open-partial</code> · <code>openPartialFileAttachment</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>attachmentId</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Header parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>Range</code></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">206: Partial content</p><div class=\"trilium-tab-panel\"><ul><li><code>application/octet-stream</code>: <code>string (binary)</code></li></ul></div></section></div><h3>Get note attachments</h3><p><code>GET /api/notes/{noteId}/attachments</code> · <code>getNoteAttachments</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Note attachments</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>array of Attachment</code></li></ul><pre><code class=\"language-application-json\">[\n {\n \"attachmentId\": \"string\",\n \"ownerId\": \"string\",\n \"role\": \"image\",\n \"mime\": \"string\",\n \"title\": \"string\",\n \"blobId\": \"string\",\n \"dateModified\": \"2019-08-24T14:15:22Z\",\n \"utcDateModified\": \"2019-08-24T14:15:22Z\"\n }\n]</code></pre></div></section></div><h3>Save attachment</h3><p><code>POST /api/notes/{noteId}/attachments</code> · <code>saveAttachment</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr></tbody></table></figure><p><strong>Query parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>matchBy</code></td><td><code>string</code> <br>One of <code>attachmentId</code>, <code>title</code>.</td></tr></tbody></table></figure><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>Attachment</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>attachmentId</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>ownerId</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>role</code> <br><em>required</em></td><td><code>string</code> <br>One of <code>image</code>, <code>file</code>.</td></tr><tr><td><code>mime</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>title</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>blobId</code></td><td><code>string</code></td></tr><tr><td><code>dateModified</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateModified</code></td><td><code>string (date-time)</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"attachmentId\": \"string\",\n \"ownerId\": \"string\",\n \"role\": \"image\",\n \"mime\": \"string\",\n \"title\": \"string\",\n \"blobId\": \"string\",\n \"dateModified\": \"2019-08-24T14:15:22Z\",\n \"utcDateModified\": \"2019-08-24T14:15:22Z\"\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">201: Attachment saved</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>Attachment</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>attachmentId</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>ownerId</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>role</code> <br><em>required</em></td><td><code>string</code> <br>One of <code>image</code>, <code>file</code>.</td></tr><tr><td><code>mime</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>title</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>blobId</code></td><td><code>string</code></td></tr><tr><td><code>dateModified</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateModified</code></td><td><code>string (date-time)</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"attachmentId\": \"string\",\n \"ownerId\": \"string\",\n \"role\": \"image\",\n \"mime\": \"string\",\n \"title\": \"string\",\n \"blobId\": \"string\",\n \"dateModified\": \"2019-08-24T14:15:22Z\",\n \"utcDateModified\": \"2019-08-24T14:15:22Z\"\n}</code></pre></div></div></div></section></div><h3>Upload attachment file</h3><p><code>POST /api/notes/{noteId}/attachments/upload</code> · <code>uploadAttachment</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr></tbody></table></figure><p><strong>Query parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>link</code></td><td><code>boolean</code> <br><code>true</code> answers with a link to the attachment instead of an image URL, and stores a picture as uploaded, without compressing it or shortening its name.</td></tr></tbody></table></figure><p><strong>Request body</strong> (required)</p><ul><li><code>multipart/form-data</code>: <code>object</code></li></ul><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>upload</code></td><td><code>string (binary)</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">201: Attachment uploaded</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>Attachment</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>attachmentId</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>ownerId</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>role</code> <br><em>required</em></td><td><code>string</code> <br>One of <code>image</code>, <code>file</code>.</td></tr><tr><td><code>mime</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>title</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>blobId</code></td><td><code>string</code></td></tr><tr><td><code>dateModified</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateModified</code></td><td><code>string (date-time)</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"attachmentId\": \"string\",\n \"ownerId\": \"string\",\n \"role\": \"image\",\n \"mime\": \"string\",\n \"title\": \"string\",\n \"blobId\": \"string\",\n \"dateModified\": \"2019-08-24T14:15:22Z\",\n \"utcDateModified\": \"2019-08-24T14:15:22Z\"\n}</code></pre></div></div></div></section></div><h3>Get attachment metadata</h3><p><code>GET /api/attachments/{attachmentId}</code> · <code>getAttachment</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>attachmentId</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Attachment metadata</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>Attachment</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>attachmentId</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>ownerId</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>role</code> <br><em>required</em></td><td><code>string</code> <br>One of <code>image</code>, <code>file</code>.</td></tr><tr><td><code>mime</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>title</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>blobId</code></td><td><code>string</code></td></tr><tr><td><code>dateModified</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateModified</code></td><td><code>string (date-time)</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"attachmentId\": \"string\",\n \"ownerId\": \"string\",\n \"role\": \"image\",\n \"mime\": \"string\",\n \"title\": \"string\",\n \"blobId\": \"string\",\n \"dateModified\": \"2019-08-24T14:15:22Z\",\n \"utcDateModified\": \"2019-08-24T14:15:22Z\"\n}</code></pre></div></div></div></section></div><h3>Delete attachment</h3><p><code>DELETE /api/attachments/{attachmentId}</code> · <code>deleteAttachment</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>attachmentId</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: Attachment deleted</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Get attachment content</h3><p><code>GET /api/attachments/{attachmentId}/blob</code> · <code>getAttachmentBlob</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>attachmentId</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Query parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>preview</code></td><td><code>boolean</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Attachment content</p><div class=\"trilium-tab-panel\"><ul><li><code>application/octet-stream</code>: <code>string (binary)</code></li></ul></div></section></div><h3>Rename attachment</h3><p><code>PUT /api/attachments/{attachmentId}/rename</code> · <code>renameAttachment</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>attachmentId</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>title</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"title\": \"string\"\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: Attachment renamed</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Convert attachment to note</h3><p><code>POST /api/attachments/{attachmentId}/convert-to-note</code> · <code>convertAttachmentToNote</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>attachmentId</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Attachment converted to note</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>Note</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr><tr><td><code>title</code> <br><em>required</em></td><td><code>string</code> <br>Note title</td></tr><tr><td><code>type</code> <br><em>required</em></td><td><code>NoteType</code> <br>One of <code>text</code>, <code>code</code>, <code>render</code>, <code>file</code>, <code>image</code>, <code>search</code>, <code>relationMap</code>, <code>book</code>, <code>noteMap</code>, <code>mermaid</code>, <code>canvas</code>, <code>webView</code>, <code>launcher</code>, <code>doc</code>, <code>contentWidget</code>, <code>mindMap</code>, <code>geoMap</code>.</td></tr><tr><td><code>mime</code> <br><em>required</em></td><td><code>string</code> <br>MIME type</td></tr><tr><td><code>isProtected</code> <br><em>required</em></td><td><code>boolean</code> <br>Whether note is protected</td></tr><tr><td><code>blobId</code></td><td><code>string</code> <br>ID of content blob</td></tr><tr><td><code>dateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>dateModified</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateModified</code></td><td><code>string (date-time)</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"noteId\": \"ur11rSfHkzeV\",\n \"title\": \"string\",\n \"type\": \"text\",\n \"mime\": \"text/html\",\n \"isProtected\": true,\n \"blobId\": \"string\",\n \"dateCreated\": \"2019-08-24T14:15:22Z\",\n \"dateModified\": \"2019-08-24T14:15:22Z\",\n \"utcDateCreated\": \"2019-08-24T14:15:22Z\",\n \"utcDateModified\": \"2019-08-24T14:15:22Z\"\n}</code></pre></div></div></div></section></div><h3>Update attachment file</h3><p><code>PUT /api/attachments/{attachmentId}/file</code> · <code>updateAttachmentFile</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>attachmentId</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Request body</strong> (required)</p><ul><li><code>multipart/form-data</code>: <code>object</code></li></ul><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>upload</code></td><td><code>string (binary)</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: Attachment file updated</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Open attachment</h3><p><code>GET /api/attachments/{attachmentId}/open</code> · <code>openAttachment</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>attachmentId</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Attachment content</p><div class=\"trilium-tab-panel\"><ul><li><code>application/octet-stream</code>: <code>string (binary)</code></li></ul></div></section></div><h3>Download attachment</h3><p><code>GET /api/attachments/download/{attachmentId}</code> · <code>downloadAttachment</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>attachmentId</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Attachment content</p><div class=\"trilium-tab-panel\"><ul><li><code>application/octet-stream</code>: <code>string (binary)</code></li></ul></div></section></div><h3>Download attachment (alternative path)</h3><p><code>GET /api/attachments/{attachmentId}/download</code> · <code>downloadAttachmentAlt</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>attachmentId</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Attachment content</p><div class=\"trilium-tab-panel\"><ul><li><code>application/octet-stream</code>: <code>string (binary)</code></li></ul></div></section></div><h3>Get all attachment information</h3><p><code>GET /api/attachments/{attachmentId}/all</code> · <code>getAllAttachmentInfo</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>attachmentId</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Complete attachment information</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>attachmentId</code></td><td><code>string</code></td></tr><tr><td><code>title</code></td><td><code>string</code></td></tr><tr><td><code>mime</code></td><td><code>string</code></td></tr><tr><td><code>isProtected</code></td><td><code>boolean</code></td></tr><tr><td><code>position</code></td><td><code>integer</code></td></tr><tr><td><code>contentLength</code></td><td><code>integer</code></td></tr><tr><td><code>ownerId</code></td><td><code>string</code></td></tr><tr><td><code>dateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>dateModified</code></td><td><code>string (date-time)</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"attachmentId\": \"string\",\n \"title\": \"string\",\n \"mime\": \"string\",\n \"isProtected\": true,\n \"position\": 0,\n \"contentLength\": 0,\n \"ownerId\": \"string\",\n \"dateCreated\": \"2019-08-24T14:15:22Z\",\n \"dateModified\": \"2019-08-24T14:15:22Z\"\n}</code></pre></div></div></div></section></div><h3>Save attachment to temporary directory</h3><p><code>POST /api/attachments/{attachmentId}/save-to-tmp-dir</code> · <code>saveAttachmentToTmpDir</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>attachmentId</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Attachment saved to temporary directory</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>tmpPath</code></td><td><code>string</code> <br>Path to temporary file</td></tr><tr><td><code>success</code></td><td><code>boolean</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"tmpPath\": \"string\",\n \"success\": true\n}</code></pre></div></div></div></section></div><h3>Upload modified attachment file</h3><p><code>POST /api/attachments/{attachmentId}/upload-modified-file</code> · <code>uploadModifiedAttachmentFile</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>attachmentId</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Request body</strong> (required)</p><ul><li><code>multipart/form-data</code>: <code>object</code></li></ul><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>upload</code></td><td><code>string (binary)</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Modified file uploaded</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>success</code></td><td><code>boolean</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"success\": true\n}</code></pre></div></div></div></section></div><h3>Get attached image</h3><p><code>GET /api/attachments/{attachmentId}/image/{filename}</code> · <code>getAttachmentImage</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>attachmentId</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>filename</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Image content</p><div class=\"trilium-tab-panel\"><ul><li><code>image/*</code>: <code>string (binary)</code></li></ul></div></section></div><h3>Erase unused attachments</h3><p><code>POST /api/notes/erase-unused-attachments-now</code> · <code>eraseUnusedAttachments</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: Unused attachments erased</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h2>Revisions</h2><p>Note revision history</p><h3>Get note revisions</h3><p><code>GET /api/notes/{noteId}/revisions</code> · <code>getNoteRevisions</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Note revisions</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>array of Revision</code></li></ul><pre><code class=\"language-application-json\">[\n {\n \"revisionId\": \"string\",\n \"noteId\": \"string\",\n \"title\": \"string\",\n \"type\": \"text\",\n \"mime\": \"string\",\n \"dateCreated\": \"2019-08-24T14:15:22Z\",\n \"utcDateCreated\": \"2019-08-24T14:15:22Z\"\n }\n]</code></pre></div></section></div><h3>Erase all note revisions</h3><p><code>DELETE /api/notes/{noteId}/revisions</code> · <code>eraseNoteRevisions</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: Revisions erased</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Get revision details</h3><p><code>GET /api/revisions/{revisionId}</code> · <code>getRevision</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>revisionId</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Revision details</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>Revision</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>revisionId</code></td><td><code>string</code></td></tr><tr><td><code>noteId</code></td><td><code>string</code></td></tr><tr><td><code>title</code></td><td><code>string</code></td></tr><tr><td><code>type</code></td><td><code>NoteType</code> <br>One of <code>text</code>, <code>code</code>, <code>render</code>, <code>file</code>, <code>image</code>, <code>search</code>, <code>relationMap</code>, <code>book</code>, <code>noteMap</code>, <code>mermaid</code>, <code>canvas</code>, <code>webView</code>, <code>launcher</code>, <code>doc</code>, <code>contentWidget</code>, <code>mindMap</code>, <code>geoMap</code>.</td></tr><tr><td><code>mime</code></td><td><code>string</code></td></tr><tr><td><code>dateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateCreated</code></td><td><code>string (date-time)</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"revisionId\": \"string\",\n \"noteId\": \"string\",\n \"title\": \"string\",\n \"type\": \"text\",\n \"mime\": \"string\",\n \"dateCreated\": \"2019-08-24T14:15:22Z\",\n \"utcDateCreated\": \"2019-08-24T14:15:22Z\"\n}</code></pre></div></div></div></section></div><h3>Erase revision</h3><p><code>DELETE /api/revisions/{revisionId}</code> · <code>eraseRevision</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>revisionId</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: Revision erased</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Get revision content</h3><p><code>GET /api/revisions/{revisionId}/blob</code> · <code>getRevisionBlob</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>revisionId</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Query parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>preview</code></td><td><code>boolean</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Revision content</p><div class=\"trilium-tab-panel\"><ul><li><code>text/html</code>: <code>string</code></li><li><code>text/plain</code>: <code>string</code></li><li><code>application/octet-stream</code>: <code>string (binary)</code></li></ul></div></section></div><h3>Restore revision</h3><p><code>POST /api/revisions/{revisionId}/restore</code> · <code>restoreRevision</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>revisionId</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Revision restored</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>Note</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr><tr><td><code>title</code> <br><em>required</em></td><td><code>string</code> <br>Note title</td></tr><tr><td><code>type</code> <br><em>required</em></td><td><code>NoteType</code> <br>One of <code>text</code>, <code>code</code>, <code>render</code>, <code>file</code>, <code>image</code>, <code>search</code>, <code>relationMap</code>, <code>book</code>, <code>noteMap</code>, <code>mermaid</code>, <code>canvas</code>, <code>webView</code>, <code>launcher</code>, <code>doc</code>, <code>contentWidget</code>, <code>mindMap</code>, <code>geoMap</code>.</td></tr><tr><td><code>mime</code> <br><em>required</em></td><td><code>string</code> <br>MIME type</td></tr><tr><td><code>isProtected</code> <br><em>required</em></td><td><code>boolean</code> <br>Whether note is protected</td></tr><tr><td><code>blobId</code></td><td><code>string</code> <br>ID of content blob</td></tr><tr><td><code>dateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>dateModified</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateModified</code></td><td><code>string (date-time)</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"noteId\": \"ur11rSfHkzeV\",\n \"title\": \"string\",\n \"type\": \"text\",\n \"mime\": \"text/html\",\n \"isProtected\": true,\n \"blobId\": \"string\",\n \"dateCreated\": \"2019-08-24T14:15:22Z\",\n \"dateModified\": \"2019-08-24T14:15:22Z\",\n \"utcDateCreated\": \"2019-08-24T14:15:22Z\",\n \"utcDateModified\": \"2019-08-24T14:15:22Z\"\n}</code></pre></div></div></div></section></div><h3>Download revision</h3><p><code>GET /api/revisions/{revisionId}/download</code> · <code>downloadRevision</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>revisionId</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Revision content</p><div class=\"trilium-tab-panel\"><ul><li><code>application/octet-stream</code>: <code>string (binary)</code></li></ul></div></section></div><h3>Cleanup old revisions</h3><p><code>POST /api/revisions/erase-all-excess-revisions</code> · <code>eraseExcessRevisions</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Request body</strong></p><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>snapshotsToKeep</code></td><td><code>integer</code> <br>Snapshots to keep per note, standing in for the revisionSnapshotNumberLimit option. -1 keeps every snapshot, 0 keeps none. Omitted, the option applies. A note carrying a valid #versioningLimit follows its own label instead.</td></tr><tr><td><code>keepNamedSnapshots</code></td><td><code>boolean</code> <br>Spare named snapshots (those with a description) from erasure and leave them out of the count, so the limit governs the automatic snapshots alone.</td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"snapshotsToKeep\": 0,\n \"keepNamedSnapshots\": true\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Excess revisions erased</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>erasedCount</code></td><td><code>integer</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"erasedCount\": 0\n}</code></pre></div></div></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">400: Invalid options</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Get notes edited on date</h3><p><code>GET /api/edited-notes/{date}</code> · <code>getEditedNotes</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>date</code> <br><em>required</em></td><td><code>string (date)</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Edited notes</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>array of Note</code></li></ul><pre><code class=\"language-application-json\">[\n {\n \"noteId\": \"ur11rSfHkzeV\",\n \"title\": \"string\",\n \"type\": \"text\",\n \"mime\": \"text/html\",\n \"isProtected\": true,\n \"blobId\": \"string\",\n \"dateCreated\": \"2019-08-24T14:15:22Z\",\n \"dateModified\": \"2019-08-24T14:15:22Z\",\n \"utcDateCreated\": \"2019-08-24T14:15:22Z\",\n \"utcDateModified\": \"2019-08-24T14:15:22Z\"\n }\n]</code></pre></div></section></div><h3>Get image from revision</h3><p><code>GET /api/revisions/{revisionId}/image/{filename}</code> · <code>getRevisionImage</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>revisionId</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>filename</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Image content</p><div class=\"trilium-tab-panel\"><ul><li><code>image/*</code>: <code>string (binary)</code></li></ul></div></section></div><h2>Search</h2><p>Search and discovery</p><h3>Full text search</h3><p><code>GET /api/search</code> · <code>search</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Query parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>searchString</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Search results</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>array of SearchResult</code></li></ul><pre><code class=\"language-application-json\">[\n {\n \"noteId\": \"string\",\n \"title\": \"string\",\n \"path\": \"string\",\n \"score\": 0,\n \"highlights\": [\n \"string\"\n ]\n }\n]</code></pre></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">400: Missing or empty search string</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Quick search with highlighting</h3><p><code>GET /api/quick-search</code> · <code>quickSearch</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Query parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>searchString</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Quick search results</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>array of SearchResult</code></li></ul><pre><code class=\"language-application-json\">[\n {\n \"noteId\": \"string\",\n \"title\": \"string\",\n \"path\": \"string\",\n \"score\": 0,\n \"highlights\": [\n \"string\"\n ]\n }\n]</code></pre></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">400: Missing or empty search string</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Execute search note</h3><p><code>GET /api/search-note/{noteId}</code> · <code>executeSearchNote</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Search results</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>array of SearchResult</code></li></ul><pre><code class=\"language-application-json\">[\n {\n \"noteId\": \"string\",\n \"title\": \"string\",\n \"path\": \"string\",\n \"score\": 0,\n \"highlights\": [\n \"string\"\n ]\n }\n]</code></pre></div></section></div><h3>Search and execute actions</h3><p><code>POST /api/search-and-execute-note/{noteId}</code> · <code>searchAndExecute</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Execution results</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Find related notes by attributes</h3><p><code>POST /api/search-related</code> · <code>searchRelated</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>Attribute</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>attributeId</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>type</code> <br><em>required</em></td><td><code>string</code> <br>One of <code>label</code>, <code>relation</code>.</td></tr><tr><td><code>name</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>value</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>position</code></td><td><code>integer</code></td></tr><tr><td><code>isInheritable</code></td><td><code>boolean</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"attributeId\": \"string\",\n \"noteId\": \"string\",\n \"type\": \"label\",\n \"name\": \"string\",\n \"value\": \"string\",\n \"position\": 0,\n \"isInheritable\": true\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Related notes</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>count</code> <br><em>required</em></td><td><code>integer</code> <br>Distinct notes matching, counted before the twenty-result cap.</td></tr><tr><td><code>results</code> <br><em>required</em></td><td><code>array of object</code> <br>At most twenty, name-and-value matches ahead of name-only ones.</td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"count\": 0,\n \"results\": [\n {\n \"notePathArray\": [\n \"string\"\n ],\n \"score\": 0\n }\n ]\n}</code></pre></div></div></div></section></div><h3>Search template notes</h3><p><code>GET /api/search-templates</code> · <code>searchTemplates</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Template notes</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>array of Note</code></li></ul><pre><code class=\"language-application-json\">[\n {\n \"noteId\": \"ur11rSfHkzeV\",\n \"title\": \"string\",\n \"type\": \"text\",\n \"mime\": \"text/html\",\n \"isProtected\": true,\n \"blobId\": \"string\",\n \"dateCreated\": \"2019-08-24T14:15:22Z\",\n \"dateModified\": \"2019-08-24T14:15:22Z\",\n \"utcDateCreated\": \"2019-08-24T14:15:22Z\",\n \"utcDateModified\": \"2019-08-24T14:15:22Z\"\n }\n]</code></pre></div></section></div><h3>Get autocomplete suggestions</h3><p><code>GET /api/autocomplete</code> · <code>autocomplete</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Query parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>query</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>fastSearch</code></td><td><code>boolean</code></td></tr><tr><td><code>activeNoteId</code></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Autocomplete suggestions</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>array of object</code></li></ul><pre><code class=\"language-application-json\">[\n {\n \"noteId\": \"string\",\n \"title\": \"string\",\n \"path\": \"string\"\n }\n]</code></pre></div></section></div><h3>Find similar notes</h3><p><code>GET /api/similar-notes/{noteId}</code> · <code>findSimilarNotes</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Similar notes</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>array of object</code></li></ul><pre><code class=\"language-application-json\">[\n {\n \"noteId\": \"string\",\n \"title\": \"string\",\n \"similarity\": 0\n }\n]</code></pre></div></section></div><h2>Import/Export</h2><p>Import and export operations</p><h3>Export branch</h3><p><code>GET /api/branches/{branchId}/export/{type}/{format}/{taskId}</code> · <code>exportBranch</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>branchId</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>type</code> <br><em>required</em></td><td><code>string</code> <br>One of <code>subtree</code>, <code>single</code>.</td></tr><tr><td><code>format</code> <br><em>required</em></td><td><code>string</code> <br>One of <code>html</code>, <code>markdown</code>, <code>opml</code>.</td></tr><tr><td><code>taskId</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Exported content</p><div class=\"trilium-tab-panel\"><ul><li><code>application/octet-stream</code>: <code>string (binary)</code></li></ul></div></section></div><h3>Import notes</h3><p><code>POST /api/notes/{parentNoteId}/notes-import</code> · <code>importNotes</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>parentNoteId</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Request body</strong> (required)</p><ul><li><code>multipart/form-data</code>: <code>object</code></li></ul><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>upload</code></td><td><code>string (binary)</code></td></tr><tr><td><code>safeImport</code></td><td><code>boolean</code></td></tr><tr><td><code>shrinkImages</code></td><td><code>boolean</code></td></tr><tr><td><code>textImportedAsText</code></td><td><code>boolean</code></td></tr><tr><td><code>codeImportedAsCode</code></td><td><code>boolean</code></td></tr><tr><td><code>explodeArchives</code></td><td><code>boolean</code></td></tr><tr><td><code>replaceUnderscoresWithSpaces</code></td><td><code>boolean</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Import results</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code></td><td><code>string</code></td></tr><tr><td><code>note</code></td><td><code>Note</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"noteId\": \"string\",\n \"note\": {\n \"noteId\": \"ur11rSfHkzeV\",\n \"title\": \"string\",\n \"type\": \"text\",\n \"mime\": \"text/html\",\n \"isProtected\": true,\n \"blobId\": \"string\",\n \"dateCreated\": \"2019-08-24T14:15:22Z\",\n \"dateModified\": \"2019-08-24T14:15:22Z\",\n \"utcDateCreated\": \"2019-08-24T14:15:22Z\",\n \"utcDateModified\": \"2019-08-24T14:15:22Z\"\n }\n}</code></pre></div></div></div></section></div><h3>Import attachments</h3><p><code>POST /api/notes/{parentNoteId}/attachments-import</code> · <code>importAttachments</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>parentNoteId</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Request body</strong> (required)</p><ul><li><code>multipart/form-data</code>: <code>object</code></li></ul><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>upload</code></td><td><code>array of string (binary)</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Import results</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h2>Sync</h2><p>Synchronization between instances</p><h3>Test sync connection</h3><p><code>POST /api/sync/test</code> · <code>testSync</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Sync test results</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Trigger sync now</h3><p><code>POST /api/sync/now</code> · <code>syncNow</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Sync started</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Get sync status</h3><p><code>GET /api/sync/check</code> · <code>checkSync</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Sync status</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>synced</code></td><td><code>boolean</code></td></tr><tr><td><code>lastSyncedPush</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>lastSyncedPull</code></td><td><code>string (date-time)</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"synced\": true,\n \"lastSyncedPush\": \"2019-08-24T14:15:22Z\",\n \"lastSyncedPull\": \"2019-08-24T14:15:22Z\"\n}</code></pre></div></div></div></section></div><h3>Get sync changes</h3><p><code>GET /api/sync/changed</code> · <code>getSyncChanges</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Query parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>instanceId</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>lastEntityChangeId</code> <br><em>required</em></td><td><code>integer</code></td></tr><tr><td><code>logMarkerId</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Sync changes</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>entityChanges</code></td><td><code>array of EntityChange</code></td></tr><tr><td><code>lastEntityChangeId</code></td><td><code>integer</code></td></tr><tr><td><code>outstandingPullCount</code></td><td><code>integer</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"entityChanges\": [\n {\n \"entityChange\": {\n \"entityName\": \"string\",\n \"changeId\": \"string\"\n },\n \"entity\": {}\n }\n ],\n \"lastEntityChangeId\": 0,\n \"outstandingPullCount\": 0\n}</code></pre></div></div></div></section></div><h3>Push sync changes</h3><p><code>PUT /api/sync/update</code> · <code>pushSyncChanges</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Query parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>logMarkerId</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Header parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>pageCount</code> <br><em>required</em></td><td><code>integer</code></td></tr><tr><td><code>pageIndex</code> <br><em>required</em></td><td><code>integer</code></td></tr><tr><td><code>requestId</code></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>instanceId</code></td><td><code>string</code></td></tr><tr><td><code>entities</code></td><td><code>array of EntityChange</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"instanceId\": \"string\",\n \"entities\": [\n {\n \"entityChange\": {\n \"entityName\": \"string\",\n \"changeId\": \"string\"\n },\n \"entity\": {}\n }\n ]\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Changes processed</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Mark sync as finished</h3><p><code>POST /api/sync/finished</code> · <code>finishSync</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: Sync finished</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Get sync statistics</h3><p><code>GET /api/sync/stats</code> · <code>getSyncStats</code></p><p><strong>Authorization</strong>: none</p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Sync statistics</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>initialized</code></td><td><code>boolean</code></td></tr><tr><td><code>stats</code></td><td><code>object</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"initialized\": true,\n \"stats\": {}\n}</code></pre></div></div></div></section></div><h3>Fill entity changes</h3><p><code>POST /api/sync/fill-entity-changes</code> · <code>fillEntityChanges</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: Entity changes filled</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Force full sync</h3><p><code>POST /api/sync/force-full-sync</code> · <code>forceFullSync</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: Full sync forced</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Check entity changes consistency</h3><p><code>POST /api/sync/check-entity-changes</code> · <code>checkEntityChanges</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Consistency check results</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Queue sector for sync</h3><p><code>POST /api/sync/queue-sector/{entityName}/{sector}</code> · <code>queueSyncSector</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>entityName</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>sector</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: Sector queued</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h2>Scripting</h2><p>Script execution and automation</p><h3>Execute script</h3><p><code>POST /api/script/exec</code> · <code>executeScript</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>script</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>params</code></td><td><code>array of string</code></td></tr><tr><td><code>startNoteId</code></td><td><code>string</code></td></tr><tr><td><code>currentNoteId</code></td><td><code>string</code></td></tr><tr><td><code>originEntityName</code></td><td><code>string</code></td></tr><tr><td><code>originEntityId</code></td><td><code>string</code></td></tr><tr><td><code>transactional</code></td><td><code>boolean</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"script\": \"string\",\n \"params\": [\n \"string\"\n ],\n \"startNoteId\": \"string\",\n \"currentNoteId\": \"string\",\n \"originEntityName\": \"string\",\n \"originEntityId\": \"string\",\n \"transactional\": true\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Script execution results</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><pre><code class=\"language-application-json\">{}</code></pre></div></section></div><h3>Run script note</h3><p><code>POST /api/script/run/{noteId}</code> · <code>runScriptNote</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Script execution results</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Get startup script bundles</h3><p><code>GET /api/script/startup</code> · <code>getStartupScripts</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Query parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>mobile</code></td><td><code>boolean</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Startup scripts</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>array of ScriptBundle</code></li></ul><pre><code class=\"language-application-json\">[\n {\n \"noteId\": \"string\",\n \"script\": \"string\",\n \"html\": \"string\",\n \"css\": \"string\"\n }\n]</code></pre></div></section></div><h3>Get widget script bundles</h3><p><code>GET /api/script/widgets</code> · <code>getWidgetScripts</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Widget scripts</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>array of ScriptBundle</code></li></ul><pre><code class=\"language-application-json\">[\n {\n \"noteId\": \"string\",\n \"script\": \"string\",\n \"html\": \"string\",\n \"css\": \"string\"\n }\n]</code></pre></div></section></div><h3>Get script bundle for note</h3><p><code>POST /api/script/bundle/{noteId}</code> · <code>getScriptBundle</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Script bundle</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>ScriptBundle</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code></td><td><code>string</code></td></tr><tr><td><code>script</code></td><td><code>string</code></td></tr><tr><td><code>html</code></td><td><code>string</code></td></tr><tr><td><code>css</code></td><td><code>string</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"noteId\": \"string\",\n \"script\": \"string\",\n \"html\": \"string\",\n \"css\": \"string\"\n}</code></pre></div></div></div></section></div><h3>Get relation script bundles</h3><p><code>GET /api/script/relation/{noteId}/{relationName}</code> · <code>getRelationScripts</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr><tr><td><code>relationName</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Relation scripts</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>array of ScriptBundle</code></li></ul><pre><code class=\"language-application-json\">[\n {\n \"noteId\": \"string\",\n \"script\": \"string\",\n \"html\": \"string\",\n \"css\": \"string\"\n }\n]</code></pre></div></section></div><h2>Configuration</h2><p>System options and settings</p><h3>Get application information</h3><p><code>GET /api/app-info</code> · <code>getAppInfo</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Application information</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>AppInfo</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>appVersion</code></td><td><code>string</code></td></tr><tr><td><code>dbVersion</code></td><td><code>integer</code></td></tr><tr><td><code>nodeVersion</code></td><td><code>string</code></td></tr><tr><td><code>syncVersion</code></td><td><code>integer</code></td></tr><tr><td><code>buildDate</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>buildRevision</code></td><td><code>string</code></td></tr><tr><td><code>dataDirectory</code></td><td><code>string</code></td></tr><tr><td><code>clipperProtocolVersion</code></td><td><code>string</code></td></tr><tr><td><code>utcDateTime</code></td><td><code>string (date-time)</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"appVersion\": \"0.91.6\",\n \"dbVersion\": 228,\n \"nodeVersion\": \"string\",\n \"syncVersion\": 34,\n \"buildDate\": \"2019-08-24T14:15:22Z\",\n \"buildRevision\": \"string\",\n \"dataDirectory\": \"string\",\n \"clipperProtocolVersion\": \"string\",\n \"utcDateTime\": \"2019-08-24T14:15:22Z\"\n}</code></pre></div></div></div></section></div><h3>Get setup status</h3><p><code>GET /api/setup/status</code> · <code>getSetupStatus</code></p><p><strong>Authorization</strong>: none</p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Setup status</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>isInitialized</code></td><td><code>boolean</code></td></tr><tr><td><code>schemaExists</code></td><td><code>boolean</code></td></tr><tr><td><code>syncVersion</code></td><td><code>integer</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"isInitialized\": true,\n \"schemaExists\": true,\n \"syncVersion\": 0\n}</code></pre></div></div></div></section></div><h3>Initialize new document</h3><p><code>POST /api/setup/new-document</code> · <code>initNewDocument</code></p><p><strong>Authorization</strong>: none</p><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>password</code> <br><em>required</em></td><td><code>string (password)</code></td></tr><tr><td><code>theme</code></td><td><code>string</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"password\": \"string\",\n \"theme\": \"string\"\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">201: Document initialized</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Setup sync from server</h3><p><code>POST /api/setup/sync-from-server</code> · <code>setupSyncFromServer</code></p><p><strong>Authorization</strong>: none</p><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>syncServerHost</code> <br><em>required</em></td><td><code>string (uri)</code></td></tr><tr><td><code>syncProxy</code></td><td><code>string</code></td></tr><tr><td><code>password</code> <br><em>required</em></td><td><code>string (password)</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"syncServerHost\": \"string\",\n \"syncProxy\": \"string\",\n \"password\": \"string\"\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Sync setup successful</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Get sync seed for setup</h3><p><code>GET /api/setup/sync-seed</code> · <code>getSyncSeed</code></p><p><strong>Authorization</strong>: none</p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Sync seed information</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>syncVersion</code></td><td><code>integer</code></td></tr><tr><td><code>schemaVersion</code></td><td><code>integer</code></td></tr><tr><td><code>documentSecret</code></td><td><code>string</code></td></tr><tr><td><code>maxSyncId</code></td><td><code>integer</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"syncVersion\": 0,\n \"schemaVersion\": 0,\n \"documentSecret\": \"string\",\n \"maxSyncId\": 0\n}</code></pre></div></div></div></section></div><h3>Get system options</h3><p><code>GET /api/options</code> · <code>getOptions</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: System options</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><pre><code class=\"language-application-json\">{}</code></pre></div></section></div><h3>Update multiple options</h3><p><code>PUT /api/options</code> · <code>updateOptions</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>object</code></li></ul><pre><code class=\"language-application-json\">{}</code></pre><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: Options updated</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Update single option</h3><p><code>PUT /api/options/{name}/{value}</code> · <code>updateOption</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>name</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>value</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: Option updated</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Get user-defined themes</h3><p><code>GET /api/options/user-themes</code> · <code>getUserThemes</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: User themes</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>array of object</code></li></ul><pre><code class=\"language-application-json\">[\n {\n \"name\": \"string\",\n \"label\": \"string\"\n }\n]</code></pre></div></section></div><h3>Get supported locales</h3><p><code>GET /api/options/locales</code> · <code>getLocales</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Supported locales</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>array of object</code></li></ul><pre><code class=\"language-application-json\">[\n {\n \"code\": \"string\",\n \"name\": \"string\"\n }\n]</code></pre></div></section></div><h2>Database</h2><p>Database operations</p><h3>Get database schema</h3><p><code>GET /api/sql/schema</code> · <code>getDatabaseSchema</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Database schema</p><div class=\"trilium-tab-panel\"><ul><li><code>text/plain</code>: <code>string</code></li></ul></div></section></div><h3>Execute SQL from note</h3><p><code>POST /api/sql/execute/{noteId}</code> · <code>executeSql</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: SQL execution results</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>array of object</code></li></ul><pre><code class=\"language-application-json\">[\n {}\n]</code></pre></div></section></div><h3>Create database backup</h3><p><code>POST /api/database/backup-database</code> · <code>backupDatabase</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: Backup created</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>List existing backups</h3><p><code>GET /api/database/backups</code> · <code>listBackups</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Backup list</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>backupFolderPath</code></td><td><code>string | null</code> <br>Directory where the backups are stored, or null if there is no user-accessible location.</td></tr><tr><td><code>backups</code></td><td><code>array of object</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"backupFolderPath\": \"string\",\n \"backups\": [\n {\n \"fileName\": \"string\",\n \"filePath\": \"string\",\n \"mtime\": \"2019-08-24T14:15:22Z\",\n \"fileSize\": 0\n }\n ]\n}</code></pre></div></div></div></section></div><h3>Vacuum database</h3><p><code>POST /api/database/vacuum-database</code> · <code>vacuumDatabase</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: Database vacuumed</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Anonymize database</h3><p><code>POST /api/database/anonymize/{type}</code> · <code>anonymizeDatabase</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code> <br><em>required</em></td><td><code>string</code> <br>One of <code>save-as-file</code>, <code>save-and-send</code>.</td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Anonymization results</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>List anonymized databases</h3><p><code>GET /api/database/anonymized-databases</code> · <code>listAnonymizedDatabases</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Anonymized database list</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>anonymizedFolderPath</code></td><td><code>string</code> <br>Directory where the anonymized databases are stored.</td></tr><tr><td><code>databases</code></td><td><code>array of object</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"anonymizedFolderPath\": \"string\",\n \"databases\": [\n {\n \"fileName\": \"string\",\n \"filePath\": \"string\",\n \"mtime\": \"2019-08-24T14:15:22Z\",\n \"fileSize\": 0\n }\n ]\n}</code></pre></div></div></div></section></div><h3>Download an anonymized database file</h3><p><code>GET /api/database/anonymized/download</code> · <code>downloadAnonymizedDatabase</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Query parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>filePath</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Anonymized database file</p><div class=\"trilium-tab-panel\"><ul><li><code>application/x-sqlite3</code>: <code>string (binary)</code></li></ul></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">400: Missing filePath</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">403: Path outside the anonymized database directory</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">404: File not found</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Fix consistency issues</h3><p><code>POST /api/database/find-and-fix-consistency-issues</code> · <code>fixConsistencyIssues</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Consistency check results</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Check database integrity</h3><p><code>GET /api/database/check-integrity</code> · <code>checkIntegrity</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Integrity check results</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>results</code></td><td><code>array of string</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"results\": [\n \"string\"\n ]\n}</code></pre></div></div></div></section></div><h2>LLM</h2><p>AI/LLM integration</p><h3>List all chat sessions</h3><p><code>GET /api/llm/chat</code> · <code>listChatSessions</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Chat sessions</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>array of ChatSession</code></li></ul><pre><code class=\"language-application-json\">[\n {\n \"sessionId\": \"string\",\n \"title\": \"string\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"string\",\n \"timestamp\": \"2019-08-24T14:15:22Z\"\n }\n ],\n \"createdAt\": \"2019-08-24T14:15:22Z\",\n \"lastActive\": \"2019-08-24T14:15:22Z\",\n \"messageCount\": 0\n }\n]</code></pre></div></section></div><h3>Create new chat session</h3><p><code>POST /api/llm/chat</code> · <code>createChatSession</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>title</code></td><td><code>string</code></td></tr><tr><td><code>systemPrompt</code></td><td><code>string</code></td></tr><tr><td><code>temperature</code></td><td><code>number</code></td></tr><tr><td><code>maxTokens</code></td><td><code>integer</code></td></tr><tr><td><code>model</code></td><td><code>string</code></td></tr><tr><td><code>provider</code></td><td><code>string</code> <br>One of <code>openai</code>, <code>anthropic</code>, <code>ollama</code>.</td></tr><tr><td><code>contextNoteId</code></td><td><code>string</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"title\": \"string\",\n \"systemPrompt\": \"string\",\n \"temperature\": 0,\n \"maxTokens\": 0,\n \"model\": \"string\",\n \"provider\": \"openai\",\n \"contextNoteId\": \"string\"\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">201: Chat session created</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>ChatSession</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>sessionId</code></td><td><code>string</code></td></tr><tr><td><code>title</code></td><td><code>string</code></td></tr><tr><td><code>messages</code></td><td><code>array of object</code></td></tr><tr><td><code>createdAt</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>lastActive</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>messageCount</code></td><td><code>integer</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"sessionId\": \"string\",\n \"title\": \"string\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"string\",\n \"timestamp\": \"2019-08-24T14:15:22Z\"\n }\n ],\n \"createdAt\": \"2019-08-24T14:15:22Z\",\n \"lastActive\": \"2019-08-24T14:15:22Z\",\n \"messageCount\": 0\n}</code></pre></div></div></div></section></div><h3>Get specific chat session</h3><p><code>GET /api/llm/chat/{sessionId}</code> · <code>getChatSession</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>sessionId</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Chat session details</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>ChatSession</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>sessionId</code></td><td><code>string</code></td></tr><tr><td><code>title</code></td><td><code>string</code></td></tr><tr><td><code>messages</code></td><td><code>array of object</code></td></tr><tr><td><code>createdAt</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>lastActive</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>messageCount</code></td><td><code>integer</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"sessionId\": \"string\",\n \"title\": \"string\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"string\",\n \"timestamp\": \"2019-08-24T14:15:22Z\"\n }\n ],\n \"createdAt\": \"2019-08-24T14:15:22Z\",\n \"lastActive\": \"2019-08-24T14:15:22Z\",\n \"messageCount\": 0\n}</code></pre></div></div></div></section></div><h3>Update chat session</h3><p><code>PATCH /api/llm/chat/{sessionId}</code> · <code>updateChatSession</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>sessionId</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>title</code></td><td><code>string</code></td></tr><tr><td><code>systemPrompt</code></td><td><code>string</code></td></tr><tr><td><code>temperature</code></td><td><code>number</code></td></tr><tr><td><code>maxTokens</code></td><td><code>integer</code></td></tr><tr><td><code>model</code></td><td><code>string</code></td></tr><tr><td><code>provider</code></td><td><code>string</code></td></tr><tr><td><code>contextNoteId</code></td><td><code>string</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"title\": \"string\",\n \"systemPrompt\": \"string\",\n \"temperature\": 0,\n \"maxTokens\": 0,\n \"model\": \"string\",\n \"provider\": \"string\",\n \"contextNoteId\": \"string\"\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Session updated</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>ChatSession</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>sessionId</code></td><td><code>string</code></td></tr><tr><td><code>title</code></td><td><code>string</code></td></tr><tr><td><code>messages</code></td><td><code>array of object</code></td></tr><tr><td><code>createdAt</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>lastActive</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>messageCount</code></td><td><code>integer</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"sessionId\": \"string\",\n \"title\": \"string\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"string\",\n \"timestamp\": \"2019-08-24T14:15:22Z\"\n }\n ],\n \"createdAt\": \"2019-08-24T14:15:22Z\",\n \"lastActive\": \"2019-08-24T14:15:22Z\",\n \"messageCount\": 0\n}</code></pre></div></div></div></section></div><h3>Delete chat session</h3><p><code>DELETE /api/llm/chat/{chatNoteId}</code> · <code>deleteChatSession</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>chatNoteId</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: Session deleted</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Send message to LLM</h3><p><code>POST /api/llm/chat/{chatNoteId}/messages</code> · <code>sendChatMessage</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>sessionId</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>message</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>options</code></td><td><code>object</code></td></tr><tr><td><code>includeContext</code></td><td><code>boolean</code></td></tr><tr><td><code>useNoteContext</code></td><td><code>boolean</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"message\": \"string\",\n \"options\": {\n \"temperature\": 0,\n \"maxTokens\": 0,\n \"model\": \"string\",\n \"provider\": \"string\"\n },\n \"includeContext\": true,\n \"useNoteContext\": true\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: LLM response</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>response</code></td><td><code>string</code></td></tr><tr><td><code>sources</code></td><td><code>array of object</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"response\": \"string\",\n \"sources\": [\n {\n \"noteId\": \"string\",\n \"title\": \"string\",\n \"similarity\": 0\n }\n ]\n}</code></pre></div></div></div></section></div><h3>Stream message to LLM</h3><p><code>POST /api/llm/chat/{chatNoteId}/messages/stream</code> · <code>streamChatMessage</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>sessionId</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>content</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>useAdvancedContext</code></td><td><code>boolean</code></td></tr><tr><td><code>showThinking</code></td><td><code>boolean</code></td></tr><tr><td><code>mentions</code></td><td><code>array of string</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"content\": \"string\",\n \"useAdvancedContext\": true,\n \"showThinking\": true,\n \"mentions\": [\n \"string\"\n ]\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Streaming started</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>List Ollama models</h3><p><code>GET /api/llm/providers/ollama/models</code> · <code>listOllamaModels</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Query parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>baseUrl</code></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Ollama models</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>success</code></td><td><code>boolean</code></td></tr><tr><td><code>models</code></td><td><code>array of object</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"success\": true,\n \"models\": [\n {}\n ]\n}</code></pre></div></div></div></section></div><h3>List OpenAI models</h3><p><code>GET /api/llm/providers/openai/models</code> · <code>listOpenAIModels</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: OpenAI models</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>success</code></td><td><code>boolean</code></td></tr><tr><td><code>chatModels</code></td><td><code>array of object</code></td></tr><tr><td><code>embeddingModels</code></td><td><code>array of object</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"success\": true,\n \"chatModels\": [\n {\n \"id\": \"string\",\n \"name\": \"string\",\n \"type\": \"string\"\n }\n ],\n \"embeddingModels\": [\n {\n \"id\": \"string\",\n \"name\": \"string\",\n \"type\": \"string\"\n }\n ]\n}</code></pre></div></div></div></section></div><h3>List Anthropic models</h3><p><code>GET /api/llm/providers/anthropic/models</code> · <code>listAnthropicModels</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Anthropic models</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>success</code></td><td><code>boolean</code></td></tr><tr><td><code>chatModels</code></td><td><code>array of object</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"success\": true,\n \"chatModels\": [\n {\n \"id\": \"string\",\n \"name\": \"string\",\n \"type\": \"string\"\n }\n ]\n}</code></pre></div></div></div></section></div><h2>Security</h2><p>Security features (2FA, tokens)</p><h3>Change password</h3><p><code>POST /api/password/change</code> · <code>changePassword</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>current_password</code></td><td><code>string (password)</code></td></tr><tr><td><code>new_password</code> <br><em>required</em></td><td><code>string (password)</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"current_password\": \"string\",\n \"new_password\": \"string\"\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: Password changed</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Reset password (destructive)</h3><p><code>POST /api/password/reset</code> · <code>resetPassword</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Query parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>really</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: Password reset</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Generate a TOTP secret</h3><p><code>GET /api/totp/generate</code> · <code>generateTotpSecret</code></p><p>Generates a fresh TOTP secret without persisting it. The caller must verify a code for this secret (see <code>/api/totp/verify</code>) and commit it (see <code>/api/totp/enable</code>) before it becomes active.</p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: TOTP secret generated</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>success</code></td><td><code>boolean</code></td></tr><tr><td><code>message</code></td><td><code>string</code> <br>The bare TOTP secret (for manual entry), or an error message on failure.</td></tr><tr><td><code>url</code></td><td><code>string</code> <br>The <code>otpauth://</code> URL the authenticator expects, rendered as a QR code by the client.</td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"success\": true,\n \"message\": \"string\",\n \"url\": \"string\"\n}</code></pre></div></div></div></section></div><h3>Verify a generated TOTP secret</h3><p><code>POST /api/totp/verify</code> · <code>verifyTotpSecret</code></p><p>Verifies a freshly generated secret against a code the user produced for it, without persisting anything. On success, issues (unpersisted) recovery codes to be shown as the next enrollment step.</p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>secret</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>token</code> <br><em>required</em></td><td><code>string</code> <br>A TOTP code the user generated for the supplied secret.</td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"secret\": \"string\",\n \"token\": \"string\"\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Verification result</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>success</code></td><td><code>boolean</code></td></tr><tr><td><code>recoveryCodes</code></td><td><code>array of string</code> <br>One-time recovery codes, present only when verification succeeds.</td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"success\": true,\n \"recoveryCodes\": [\n \"string\"\n ]\n}</code></pre></div></div></div></section></div><h3>Enable TOTP with a verified secret</h3><p><code>POST /api/totp/enable</code> · <code>enableTotp</code></p><p>Commits a verified secret together with its recovery codes, activating TOTP. This is the final enrollment step and the only point at which the secret and recovery codes are persisted.</p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>secret</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>recoveryCodes</code> <br><em>required</em></td><td><code>array of string</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"secret\": \"string\",\n \"recoveryCodes\": [\n \"string\"\n ]\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Result of enabling TOTP</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>success</code></td><td><code>boolean</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"success\": true\n}</code></pre></div></div></div></section></div><h3>Get TOTP status</h3><p><code>GET /api/totp/status</code> · <code>getTotpStatus</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: TOTP status</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>success</code></td><td><code>boolean</code></td></tr><tr><td><code>message</code></td><td><code>boolean</code> <br>Whether TOTP is the active second factor and a secret is set.</td></tr><tr><td><code>set</code></td><td><code>boolean</code> <br>Whether a TOTP secret is currently stored.</td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"success\": true,\n \"message\": true,\n \"set\": true\n}</code></pre></div></div></div></section></div><h3>Get the stored TOTP secret</h3><p><code>GET /api/totp/get</code> · <code>getTotpSecret</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: The stored TOTP secret, or <code>null</code> if none is set.</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>string | null</code></li></ul><pre><code class=\"language-application-json\">\"string\"</code></pre></div></section></div><h3>Reset (disable) TOTP</h3><p><code>POST /api/totp/reset</code> · <code>resetTotp</code></p><p>Clears the stored TOTP secret and its recovery codes, disabling TOTP.</p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Result of resetting TOTP</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>success</code></td><td><code>boolean</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"success\": true\n}</code></pre></div></div></div></section></div><h3>Check if TOTP recovery codes are set</h3><p><code>GET /api/totp_recovery/enabled</code> · <code>isTotpRecoveryEnabled</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: TOTP recovery status</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>success</code></td><td><code>boolean</code></td></tr><tr><td><code>keysExist</code></td><td><code>boolean</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"success\": true,\n \"keysExist\": true\n}</code></pre></div></div></div></section></div><h3>Regenerate TOTP recovery codes</h3><p><code>POST /api/totp_recovery/regenerate</code> · <code>regenerateTotpRecoveryCodes</code></p><p>Issues a fresh batch of recovery codes for the already-enrolled TOTP secret, replacing any existing ones, and returns them for one-time display. Refuses when no TOTP secret is set.</p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Generated recovery codes</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>success</code></td><td><code>boolean</code></td></tr><tr><td><code>recoveryCodes</code></td><td><code>array of string</code> <br>New recovery codes, present only when regeneration succeeds.</td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"success\": true,\n \"recoveryCodes\": [\n \"string\"\n ]\n}</code></pre></div></div></div></section></div><h3>Get used TOTP recovery codes</h3><p><code>GET /api/totp_recovery/used</code> · <code>getUsedTotpRecoveryCodes</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Used recovery codes status. Returns an empty array if no recovery codes are set, otherwise an object listing each code's status.</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>array of any | object</code></li></ul><pre><code class=\"language-application-json\">[\n null\n]</code></pre></div></section></div><h3>Verify a TOTP recovery code</h3><p><code>POST /api/totp_recovery/verify</code> · <code>verifyTotpRecoveryCode</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>recovery_code_guess</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"recovery_code_guess\": \"string\"\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Verification result</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>success</code></td><td><code>boolean</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"success\": true\n}</code></pre></div></div></div></section></div><h3>List ETAPI tokens</h3><p><code>GET /api/etapi-tokens</code> · <code>listEtapiTokens</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: ETAPI tokens</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>array of EtapiToken</code></li></ul><pre><code class=\"language-application-json\">[\n {\n \"etapiTokenId\": \"string\",\n \"name\": \"string\",\n \"token\": \"string\",\n \"dateCreated\": \"2019-08-24T14:15:22Z\",\n \"isDeleted\": true\n }\n]</code></pre></div></section></div><h3>Create ETAPI token</h3><p><code>POST /api/etapi-tokens</code> · <code>createEtapiToken</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>name</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"name\": \"string\"\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">201: Token created</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>EtapiToken</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>etapiTokenId</code></td><td><code>string</code></td></tr><tr><td><code>name</code></td><td><code>string</code></td></tr><tr><td><code>token</code></td><td><code>string</code></td></tr><tr><td><code>dateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>isDeleted</code></td><td><code>boolean</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"etapiTokenId\": \"string\",\n \"name\": \"string\",\n \"token\": \"string\",\n \"dateCreated\": \"2019-08-24T14:15:22Z\",\n \"isDeleted\": true\n}</code></pre></div></div></div></section></div><h3>Delete ETAPI token</h3><p><code>DELETE /api/etapi-tokens/{etapiTokenId}</code> · <code>deleteEtapiToken</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>etapiTokenId</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: Token deleted</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Update ETAPI token</h3><p><code>PATCH /api/etapi-tokens/{etapiTokenId}</code> · <code>updateEtapiToken</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>etapiTokenId</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>name</code></td><td><code>string</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"name\": \"string\"\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Token updated</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>EtapiToken</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>etapiTokenId</code></td><td><code>string</code></td></tr><tr><td><code>name</code></td><td><code>string</code></td></tr><tr><td><code>token</code></td><td><code>string</code></td></tr><tr><td><code>dateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>isDeleted</code></td><td><code>boolean</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"etapiTokenId\": \"string\",\n \"name\": \"string\",\n \"token\": \"string\",\n \"dateCreated\": \"2019-08-24T14:15:22Z\",\n \"isDeleted\": true\n}</code></pre></div></div></div></section></div><h2>Special Notes</h2><p>Special note types (calendar, inbox)</p><h3>Get/create inbox note</h3><p><code>GET /api/special-notes/inbox/{date}</code> · <code>getInboxNote</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>date</code> <br><em>required</em></td><td><code>string (date)</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Inbox note</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>Note</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr><tr><td><code>title</code> <br><em>required</em></td><td><code>string</code> <br>Note title</td></tr><tr><td><code>type</code> <br><em>required</em></td><td><code>NoteType</code> <br>One of <code>text</code>, <code>code</code>, <code>render</code>, <code>file</code>, <code>image</code>, <code>search</code>, <code>relationMap</code>, <code>book</code>, <code>noteMap</code>, <code>mermaid</code>, <code>canvas</code>, <code>webView</code>, <code>launcher</code>, <code>doc</code>, <code>contentWidget</code>, <code>mindMap</code>, <code>geoMap</code>.</td></tr><tr><td><code>mime</code> <br><em>required</em></td><td><code>string</code> <br>MIME type</td></tr><tr><td><code>isProtected</code> <br><em>required</em></td><td><code>boolean</code> <br>Whether note is protected</td></tr><tr><td><code>blobId</code></td><td><code>string</code> <br>ID of content blob</td></tr><tr><td><code>dateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>dateModified</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateModified</code></td><td><code>string (date-time)</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"noteId\": \"ur11rSfHkzeV\",\n \"title\": \"string\",\n \"type\": \"text\",\n \"mime\": \"text/html\",\n \"isProtected\": true,\n \"blobId\": \"string\",\n \"dateCreated\": \"2019-08-24T14:15:22Z\",\n \"dateModified\": \"2019-08-24T14:15:22Z\",\n \"utcDateCreated\": \"2019-08-24T14:15:22Z\",\n \"utcDateModified\": \"2019-08-24T14:15:22Z\"\n}</code></pre></div></div></div></section></div><h3>Resolve where an inbox capture would go</h3><p><code>GET /api/special-notes/inbox-target</code> · <code>getInboxTarget</code></p><p>Reports the destination <code>/api/special-notes/inbox/{date}</code> would use, without creating anything. Honours the hoisted note, read from the <code>trilium-hoisted-note-id</code> header.</p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: The resolved destination</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>kind</code> <br><em>required</em></td><td><code>string</code> <br>Which rule decided the destination. <code>dayNote</code> names no note, because the day note is created when the capture happens. One of <code>inbox</code>, <code>workspaceInbox</code>, <code>workspaceRoot</code>, <code>dayNote</code>, <code>root</code>.</td></tr><tr><td><code>noteId</code></td><td><code>string</code> <br>Absent for <code>dayNote</code>.</td></tr><tr><td><code>title</code></td><td><code>string</code> <br>Absent for <code>dayNote</code>.</td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"kind\": \"inbox\",\n \"noteId\": \"string\",\n \"title\": \"string\"\n}</code></pre></div></div></div></section></div><h3>Get/create day note</h3><p><code>GET /api/special-notes/days/{date}</code> · <code>getDayNote</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>date</code> <br><em>required</em></td><td><code>string (date)</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Day note</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>Note</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr><tr><td><code>title</code> <br><em>required</em></td><td><code>string</code> <br>Note title</td></tr><tr><td><code>type</code> <br><em>required</em></td><td><code>NoteType</code> <br>One of <code>text</code>, <code>code</code>, <code>render</code>, <code>file</code>, <code>image</code>, <code>search</code>, <code>relationMap</code>, <code>book</code>, <code>noteMap</code>, <code>mermaid</code>, <code>canvas</code>, <code>webView</code>, <code>launcher</code>, <code>doc</code>, <code>contentWidget</code>, <code>mindMap</code>, <code>geoMap</code>.</td></tr><tr><td><code>mime</code> <br><em>required</em></td><td><code>string</code> <br>MIME type</td></tr><tr><td><code>isProtected</code> <br><em>required</em></td><td><code>boolean</code> <br>Whether note is protected</td></tr><tr><td><code>blobId</code></td><td><code>string</code> <br>ID of content blob</td></tr><tr><td><code>dateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>dateModified</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateModified</code></td><td><code>string (date-time)</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"noteId\": \"ur11rSfHkzeV\",\n \"title\": \"string\",\n \"type\": \"text\",\n \"mime\": \"text/html\",\n \"isProtected\": true,\n \"blobId\": \"string\",\n \"dateCreated\": \"2019-08-24T14:15:22Z\",\n \"dateModified\": \"2019-08-24T14:15:22Z\",\n \"utcDateCreated\": \"2019-08-24T14:15:22Z\",\n \"utcDateModified\": \"2019-08-24T14:15:22Z\"\n}</code></pre></div></div></div></section></div><h3>Get/create week note</h3><p><code>GET /api/special-notes/weeks/{week}</code> · <code>getWeekNote</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>week</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Week note</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>Note</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr><tr><td><code>title</code> <br><em>required</em></td><td><code>string</code> <br>Note title</td></tr><tr><td><code>type</code> <br><em>required</em></td><td><code>NoteType</code> <br>One of <code>text</code>, <code>code</code>, <code>render</code>, <code>file</code>, <code>image</code>, <code>search</code>, <code>relationMap</code>, <code>book</code>, <code>noteMap</code>, <code>mermaid</code>, <code>canvas</code>, <code>webView</code>, <code>launcher</code>, <code>doc</code>, <code>contentWidget</code>, <code>mindMap</code>, <code>geoMap</code>.</td></tr><tr><td><code>mime</code> <br><em>required</em></td><td><code>string</code> <br>MIME type</td></tr><tr><td><code>isProtected</code> <br><em>required</em></td><td><code>boolean</code> <br>Whether note is protected</td></tr><tr><td><code>blobId</code></td><td><code>string</code> <br>ID of content blob</td></tr><tr><td><code>dateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>dateModified</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateModified</code></td><td><code>string (date-time)</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"noteId\": \"ur11rSfHkzeV\",\n \"title\": \"string\",\n \"type\": \"text\",\n \"mime\": \"text/html\",\n \"isProtected\": true,\n \"blobId\": \"string\",\n \"dateCreated\": \"2019-08-24T14:15:22Z\",\n \"dateModified\": \"2019-08-24T14:15:22Z\",\n \"utcDateCreated\": \"2019-08-24T14:15:22Z\",\n \"utcDateModified\": \"2019-08-24T14:15:22Z\"\n}</code></pre></div></div></div></section></div><h3>Get/create month note</h3><p><code>GET /api/special-notes/months/{month}</code> · <code>getMonthNote</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>month</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Month note</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>Note</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr><tr><td><code>title</code> <br><em>required</em></td><td><code>string</code> <br>Note title</td></tr><tr><td><code>type</code> <br><em>required</em></td><td><code>NoteType</code> <br>One of <code>text</code>, <code>code</code>, <code>render</code>, <code>file</code>, <code>image</code>, <code>search</code>, <code>relationMap</code>, <code>book</code>, <code>noteMap</code>, <code>mermaid</code>, <code>canvas</code>, <code>webView</code>, <code>launcher</code>, <code>doc</code>, <code>contentWidget</code>, <code>mindMap</code>, <code>geoMap</code>.</td></tr><tr><td><code>mime</code> <br><em>required</em></td><td><code>string</code> <br>MIME type</td></tr><tr><td><code>isProtected</code> <br><em>required</em></td><td><code>boolean</code> <br>Whether note is protected</td></tr><tr><td><code>blobId</code></td><td><code>string</code> <br>ID of content blob</td></tr><tr><td><code>dateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>dateModified</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateModified</code></td><td><code>string (date-time)</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"noteId\": \"ur11rSfHkzeV\",\n \"title\": \"string\",\n \"type\": \"text\",\n \"mime\": \"text/html\",\n \"isProtected\": true,\n \"blobId\": \"string\",\n \"dateCreated\": \"2019-08-24T14:15:22Z\",\n \"dateModified\": \"2019-08-24T14:15:22Z\",\n \"utcDateCreated\": \"2019-08-24T14:15:22Z\",\n \"utcDateModified\": \"2019-08-24T14:15:22Z\"\n}</code></pre></div></div></div></section></div><h3>Get/create year note</h3><p><code>GET /api/special-notes/years/{year}</code> · <code>getYearNote</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>year</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Year note</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>Note</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr><tr><td><code>title</code> <br><em>required</em></td><td><code>string</code> <br>Note title</td></tr><tr><td><code>type</code> <br><em>required</em></td><td><code>NoteType</code> <br>One of <code>text</code>, <code>code</code>, <code>render</code>, <code>file</code>, <code>image</code>, <code>search</code>, <code>relationMap</code>, <code>book</code>, <code>noteMap</code>, <code>mermaid</code>, <code>canvas</code>, <code>webView</code>, <code>launcher</code>, <code>doc</code>, <code>contentWidget</code>, <code>mindMap</code>, <code>geoMap</code>.</td></tr><tr><td><code>mime</code> <br><em>required</em></td><td><code>string</code> <br>MIME type</td></tr><tr><td><code>isProtected</code> <br><em>required</em></td><td><code>boolean</code> <br>Whether note is protected</td></tr><tr><td><code>blobId</code></td><td><code>string</code> <br>ID of content blob</td></tr><tr><td><code>dateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>dateModified</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateModified</code></td><td><code>string (date-time)</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"noteId\": \"ur11rSfHkzeV\",\n \"title\": \"string\",\n \"type\": \"text\",\n \"mime\": \"text/html\",\n \"isProtected\": true,\n \"blobId\": \"string\",\n \"dateCreated\": \"2019-08-24T14:15:22Z\",\n \"dateModified\": \"2019-08-24T14:15:22Z\",\n \"utcDateCreated\": \"2019-08-24T14:15:22Z\",\n \"utcDateModified\": \"2019-08-24T14:15:22Z\"\n}</code></pre></div></div></div></section></div><h3>Create SQL console note</h3><p><code>POST /api/special-notes/sql-console</code> · <code>createSqlConsole</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">201: SQL console created</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>Note</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr><tr><td><code>title</code> <br><em>required</em></td><td><code>string</code> <br>Note title</td></tr><tr><td><code>type</code> <br><em>required</em></td><td><code>NoteType</code> <br>One of <code>text</code>, <code>code</code>, <code>render</code>, <code>file</code>, <code>image</code>, <code>search</code>, <code>relationMap</code>, <code>book</code>, <code>noteMap</code>, <code>mermaid</code>, <code>canvas</code>, <code>webView</code>, <code>launcher</code>, <code>doc</code>, <code>contentWidget</code>, <code>mindMap</code>, <code>geoMap</code>.</td></tr><tr><td><code>mime</code> <br><em>required</em></td><td><code>string</code> <br>MIME type</td></tr><tr><td><code>isProtected</code> <br><em>required</em></td><td><code>boolean</code> <br>Whether note is protected</td></tr><tr><td><code>blobId</code></td><td><code>string</code> <br>ID of content blob</td></tr><tr><td><code>dateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>dateModified</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateModified</code></td><td><code>string (date-time)</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"noteId\": \"ur11rSfHkzeV\",\n \"title\": \"string\",\n \"type\": \"text\",\n \"mime\": \"text/html\",\n \"isProtected\": true,\n \"blobId\": \"string\",\n \"dateCreated\": \"2019-08-24T14:15:22Z\",\n \"dateModified\": \"2019-08-24T14:15:22Z\",\n \"utcDateCreated\": \"2019-08-24T14:15:22Z\",\n \"utcDateModified\": \"2019-08-24T14:15:22Z\"\n}</code></pre></div></div></div></section></div><h3>Create search note</h3><p><code>POST /api/special-notes/search-note</code> · <code>createSearchNote</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">201: Search note created</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>Note</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr><tr><td><code>title</code> <br><em>required</em></td><td><code>string</code> <br>Note title</td></tr><tr><td><code>type</code> <br><em>required</em></td><td><code>NoteType</code> <br>One of <code>text</code>, <code>code</code>, <code>render</code>, <code>file</code>, <code>image</code>, <code>search</code>, <code>relationMap</code>, <code>book</code>, <code>noteMap</code>, <code>mermaid</code>, <code>canvas</code>, <code>webView</code>, <code>launcher</code>, <code>doc</code>, <code>contentWidget</code>, <code>mindMap</code>, <code>geoMap</code>.</td></tr><tr><td><code>mime</code> <br><em>required</em></td><td><code>string</code> <br>MIME type</td></tr><tr><td><code>isProtected</code> <br><em>required</em></td><td><code>boolean</code> <br>Whether note is protected</td></tr><tr><td><code>blobId</code></td><td><code>string</code> <br>ID of content blob</td></tr><tr><td><code>dateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>dateModified</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateModified</code></td><td><code>string (date-time)</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"noteId\": \"ur11rSfHkzeV\",\n \"title\": \"string\",\n \"type\": \"text\",\n \"mime\": \"text/html\",\n \"isProtected\": true,\n \"blobId\": \"string\",\n \"dateCreated\": \"2019-08-24T14:15:22Z\",\n \"dateModified\": \"2019-08-24T14:15:22Z\",\n \"utcDateCreated\": \"2019-08-24T14:15:22Z\",\n \"utcDateModified\": \"2019-08-24T14:15:22Z\"\n}</code></pre></div></div></div></section></div><h3>Create launcher</h3><p><code>POST /api/special-notes/launchers/{parentNoteId}/{launcherType}</code> · <code>createLauncher</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>parentNoteId</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>launcherType</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">201: Launcher created</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>Note</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr><tr><td><code>title</code> <br><em>required</em></td><td><code>string</code> <br>Note title</td></tr><tr><td><code>type</code> <br><em>required</em></td><td><code>NoteType</code> <br>One of <code>text</code>, <code>code</code>, <code>render</code>, <code>file</code>, <code>image</code>, <code>search</code>, <code>relationMap</code>, <code>book</code>, <code>noteMap</code>, <code>mermaid</code>, <code>canvas</code>, <code>webView</code>, <code>launcher</code>, <code>doc</code>, <code>contentWidget</code>, <code>mindMap</code>, <code>geoMap</code>.</td></tr><tr><td><code>mime</code> <br><em>required</em></td><td><code>string</code> <br>MIME type</td></tr><tr><td><code>isProtected</code> <br><em>required</em></td><td><code>boolean</code> <br>Whether note is protected</td></tr><tr><td><code>blobId</code></td><td><code>string</code> <br>ID of content blob</td></tr><tr><td><code>dateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>dateModified</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateModified</code></td><td><code>string (date-time)</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"noteId\": \"ur11rSfHkzeV\",\n \"title\": \"string\",\n \"type\": \"text\",\n \"mime\": \"text/html\",\n \"isProtected\": true,\n \"blobId\": \"string\",\n \"dateCreated\": \"2019-08-24T14:15:22Z\",\n \"dateModified\": \"2019-08-24T14:15:22Z\",\n \"utcDateCreated\": \"2019-08-24T14:15:22Z\",\n \"utcDateModified\": \"2019-08-24T14:15:22Z\"\n}</code></pre></div></div></div></section></div><h3>Get notes for specific month</h3><p><code>GET /api/special-notes/notes-for-month/{month}</code> · <code>getNotesForMonth</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>month</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Notes for the month</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>array of Note</code></li></ul><pre><code class=\"language-application-json\">[\n {\n \"noteId\": \"ur11rSfHkzeV\",\n \"title\": \"string\",\n \"type\": \"text\",\n \"mime\": \"text/html\",\n \"isProtected\": true,\n \"blobId\": \"string\",\n \"dateCreated\": \"2019-08-24T14:15:22Z\",\n \"dateModified\": \"2019-08-24T14:15:22Z\",\n \"utcDateCreated\": \"2019-08-24T14:15:22Z\",\n \"utcDateModified\": \"2019-08-24T14:15:22Z\"\n }\n]</code></pre></div></section></div><h3>Get quarter note</h3><p><code>GET /api/special-notes/quarters/{quarter}</code> · <code>getQuarter</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>quarter</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Quarter note</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>Note</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr><tr><td><code>title</code> <br><em>required</em></td><td><code>string</code> <br>Note title</td></tr><tr><td><code>type</code> <br><em>required</em></td><td><code>NoteType</code> <br>One of <code>text</code>, <code>code</code>, <code>render</code>, <code>file</code>, <code>image</code>, <code>search</code>, <code>relationMap</code>, <code>book</code>, <code>noteMap</code>, <code>mermaid</code>, <code>canvas</code>, <code>webView</code>, <code>launcher</code>, <code>doc</code>, <code>contentWidget</code>, <code>mindMap</code>, <code>geoMap</code>.</td></tr><tr><td><code>mime</code> <br><em>required</em></td><td><code>string</code> <br>MIME type</td></tr><tr><td><code>isProtected</code> <br><em>required</em></td><td><code>boolean</code> <br>Whether note is protected</td></tr><tr><td><code>blobId</code></td><td><code>string</code> <br>ID of content blob</td></tr><tr><td><code>dateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>dateModified</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateModified</code></td><td><code>string (date-time)</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"noteId\": \"ur11rSfHkzeV\",\n \"title\": \"string\",\n \"type\": \"text\",\n \"mime\": \"text/html\",\n \"isProtected\": true,\n \"blobId\": \"string\",\n \"dateCreated\": \"2019-08-24T14:15:22Z\",\n \"dateModified\": \"2019-08-24T14:15:22Z\",\n \"utcDateCreated\": \"2019-08-24T14:15:22Z\",\n \"utcDateModified\": \"2019-08-24T14:15:22Z\"\n}</code></pre></div></div></div></section></div><h3>Get first day of week for date</h3><p><code>GET /api/special-notes/week-first-day/{date}</code> · <code>getWeekFirstDay</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>date</code> <br><em>required</em></td><td><code>string (date)</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: First day of week</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>date</code></td><td><code>string (date)</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"date\": \"2019-08-24\"\n}</code></pre></div></div></div></section></div><h3>Reset launcher note</h3><p><code>POST /api/special-notes/launchers/{noteId}/reset</code> · <code>resetLauncher</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Launcher reset</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>Note</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr><tr><td><code>title</code> <br><em>required</em></td><td><code>string</code> <br>Note title</td></tr><tr><td><code>type</code> <br><em>required</em></td><td><code>NoteType</code> <br>One of <code>text</code>, <code>code</code>, <code>render</code>, <code>file</code>, <code>image</code>, <code>search</code>, <code>relationMap</code>, <code>book</code>, <code>noteMap</code>, <code>mermaid</code>, <code>canvas</code>, <code>webView</code>, <code>launcher</code>, <code>doc</code>, <code>contentWidget</code>, <code>mindMap</code>, <code>geoMap</code>.</td></tr><tr><td><code>mime</code> <br><em>required</em></td><td><code>string</code> <br>MIME type</td></tr><tr><td><code>isProtected</code> <br><em>required</em></td><td><code>boolean</code> <br>Whether note is protected</td></tr><tr><td><code>blobId</code></td><td><code>string</code> <br>ID of content blob</td></tr><tr><td><code>dateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>dateModified</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateModified</code></td><td><code>string (date-time)</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"noteId\": \"ur11rSfHkzeV\",\n \"title\": \"string\",\n \"type\": \"text\",\n \"mime\": \"text/html\",\n \"isProtected\": true,\n \"blobId\": \"string\",\n \"dateCreated\": \"2019-08-24T14:15:22Z\",\n \"dateModified\": \"2019-08-24T14:15:22Z\",\n \"utcDateCreated\": \"2019-08-24T14:15:22Z\",\n \"utcDateModified\": \"2019-08-24T14:15:22Z\"\n}</code></pre></div></div></div></section></div><h3>Save search note</h3><p><code>POST /api/special-notes/save-search-note</code> · <code>saveSearchNote</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>query</code></td><td><code>string</code></td></tr><tr><td><code>title</code></td><td><code>string</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"query\": \"string\",\n \"title\": \"string\"\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">201: Search note saved</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>Note</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr><tr><td><code>title</code> <br><em>required</em></td><td><code>string</code> <br>Note title</td></tr><tr><td><code>type</code> <br><em>required</em></td><td><code>NoteType</code> <br>One of <code>text</code>, <code>code</code>, <code>render</code>, <code>file</code>, <code>image</code>, <code>search</code>, <code>relationMap</code>, <code>book</code>, <code>noteMap</code>, <code>mermaid</code>, <code>canvas</code>, <code>webView</code>, <code>launcher</code>, <code>doc</code>, <code>contentWidget</code>, <code>mindMap</code>, <code>geoMap</code>.</td></tr><tr><td><code>mime</code> <br><em>required</em></td><td><code>string</code> <br>MIME type</td></tr><tr><td><code>isProtected</code> <br><em>required</em></td><td><code>boolean</code> <br>Whether note is protected</td></tr><tr><td><code>blobId</code></td><td><code>string</code> <br>ID of content blob</td></tr><tr><td><code>dateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>dateModified</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateModified</code></td><td><code>string (date-time)</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"noteId\": \"ur11rSfHkzeV\",\n \"title\": \"string\",\n \"type\": \"text\",\n \"mime\": \"text/html\",\n \"isProtected\": true,\n \"blobId\": \"string\",\n \"dateCreated\": \"2019-08-24T14:15:22Z\",\n \"dateModified\": \"2019-08-24T14:15:22Z\",\n \"utcDateCreated\": \"2019-08-24T14:15:22Z\",\n \"utcDateModified\": \"2019-08-24T14:15:22Z\"\n}</code></pre></div></div></div></section></div><h3>Save SQL console note</h3><p><code>POST /api/special-notes/save-sql-console</code> · <code>saveSqlConsole</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>sql</code></td><td><code>string</code></td></tr><tr><td><code>title</code></td><td><code>string</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"sql\": \"string\",\n \"title\": \"string\"\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">201: SQL console saved</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>Note</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr><tr><td><code>title</code> <br><em>required</em></td><td><code>string</code> <br>Note title</td></tr><tr><td><code>type</code> <br><em>required</em></td><td><code>NoteType</code> <br>One of <code>text</code>, <code>code</code>, <code>render</code>, <code>file</code>, <code>image</code>, <code>search</code>, <code>relationMap</code>, <code>book</code>, <code>noteMap</code>, <code>mermaid</code>, <code>canvas</code>, <code>webView</code>, <code>launcher</code>, <code>doc</code>, <code>contentWidget</code>, <code>mindMap</code>, <code>geoMap</code>.</td></tr><tr><td><code>mime</code> <br><em>required</em></td><td><code>string</code> <br>MIME type</td></tr><tr><td><code>isProtected</code> <br><em>required</em></td><td><code>boolean</code> <br>Whether note is protected</td></tr><tr><td><code>blobId</code></td><td><code>string</code> <br>ID of content blob</td></tr><tr><td><code>dateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>dateModified</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateModified</code></td><td><code>string (date-time)</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"noteId\": \"ur11rSfHkzeV\",\n \"title\": \"string\",\n \"type\": \"text\",\n \"mime\": \"text/html\",\n \"isProtected\": true,\n \"blobId\": \"string\",\n \"dateCreated\": \"2019-08-24T14:15:22Z\",\n \"dateModified\": \"2019-08-24T14:15:22Z\",\n \"utcDateCreated\": \"2019-08-24T14:15:22Z\",\n \"utcDateModified\": \"2019-08-24T14:15:22Z\"\n}</code></pre></div></div></div></section></div><h3>Update API script launcher</h3><p><code>PUT /api/special-notes/api-script-launcher</code> · <code>updateApiScriptLauncher</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>code</code></td><td><code>string</code> <br>Script code</td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"code\": \"string\"\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: API script launcher updated</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>Note</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr><tr><td><code>title</code> <br><em>required</em></td><td><code>string</code> <br>Note title</td></tr><tr><td><code>type</code> <br><em>required</em></td><td><code>NoteType</code> <br>One of <code>text</code>, <code>code</code>, <code>render</code>, <code>file</code>, <code>image</code>, <code>search</code>, <code>relationMap</code>, <code>book</code>, <code>noteMap</code>, <code>mermaid</code>, <code>canvas</code>, <code>webView</code>, <code>launcher</code>, <code>doc</code>, <code>contentWidget</code>, <code>mindMap</code>, <code>geoMap</code>.</td></tr><tr><td><code>mime</code> <br><em>required</em></td><td><code>string</code> <br>MIME type</td></tr><tr><td><code>isProtected</code> <br><em>required</em></td><td><code>boolean</code> <br>Whether note is protected</td></tr><tr><td><code>blobId</code></td><td><code>string</code> <br>ID of content blob</td></tr><tr><td><code>dateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>dateModified</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateModified</code></td><td><code>string (date-time)</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"noteId\": \"ur11rSfHkzeV\",\n \"title\": \"string\",\n \"type\": \"text\",\n \"mime\": \"text/html\",\n \"isProtected\": true,\n \"blobId\": \"string\",\n \"dateCreated\": \"2019-08-24T14:15:22Z\",\n \"dateModified\": \"2019-08-24T14:15:22Z\",\n \"utcDateCreated\": \"2019-08-24T14:15:22Z\",\n \"utcDateModified\": \"2019-08-24T14:15:22Z\"\n}</code></pre></div></div></div></section></div><h2>Visualization</h2><p>Maps and visualizations</p><h3>Get tree map</h3><p><code>POST /api/note-map/{noteId}/tree</code> · <code>getTreeMap</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Tree map data</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><pre><code class=\"language-application-json\">{}</code></pre></div></section></div><h3>Get link map</h3><p><code>POST /api/note-map/{noteId}/link</code> · <code>getLinkMap</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Link map data</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><pre><code class=\"language-application-json\">{}</code></pre></div></section></div><h3>Get backlinks</h3><p><code>GET /api/note-map/{noteId}/backlinks</code> · <code>getBacklinks</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Backlinks</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>array of object</code></li></ul><pre><code class=\"language-application-json\">[\n {\n \"noteId\": \"string\",\n \"title\": \"string\"\n }\n]</code></pre></div></section></div><h3>Get backlink count for note</h3><p><code>GET /api/note-map/{noteId}/backlink-count</code> · <code>getBacklinkCount</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Backlink count</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>count</code></td><td><code>integer</code> <br>Number of backlinks to this note</td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"count\": 0\n}</code></pre></div></div></div></section></div><h3>Get relation map data</h3><p><code>POST /api/relation-map</code> · <code>getRelationMap</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code></td><td><code>string</code></td></tr><tr><td><code>maxDepth</code></td><td><code>integer</code></td></tr><tr><td><code>excludeArchived</code></td><td><code>boolean</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"noteId\": \"string\",\n \"maxDepth\": 0,\n \"excludeArchived\": true\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Relation map data</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><pre><code class=\"language-application-json\">{}</code></pre></div></section></div><h2>External</h2><p>External integrations (clipper, sender)</p><h3>Clipper handshake</h3><p><code>GET /api/clipper/handshake</code> · <code>clipperHandshake</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Handshake successful</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>protocolVersion</code></td><td><code>string</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"protocolVersion\": \"string\"\n}</code></pre></div></div></div></section></div><h3>Add web clipping</h3><p><code>POST /api/clipper/clippings</code> · <code>addClipping</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>title</code></td><td><code>string</code></td></tr><tr><td><code>content</code></td><td><code>string</code></td></tr><tr><td><code>url</code></td><td><code>string</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"title\": \"string\",\n \"content\": \"string\",\n \"url\": \"string\"\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">201: Clipping created</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>Note</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr><tr><td><code>title</code> <br><em>required</em></td><td><code>string</code> <br>Note title</td></tr><tr><td><code>type</code> <br><em>required</em></td><td><code>NoteType</code> <br>One of <code>text</code>, <code>code</code>, <code>render</code>, <code>file</code>, <code>image</code>, <code>search</code>, <code>relationMap</code>, <code>book</code>, <code>noteMap</code>, <code>mermaid</code>, <code>canvas</code>, <code>webView</code>, <code>launcher</code>, <code>doc</code>, <code>contentWidget</code>, <code>mindMap</code>, <code>geoMap</code>.</td></tr><tr><td><code>mime</code> <br><em>required</em></td><td><code>string</code> <br>MIME type</td></tr><tr><td><code>isProtected</code> <br><em>required</em></td><td><code>boolean</code> <br>Whether note is protected</td></tr><tr><td><code>blobId</code></td><td><code>string</code> <br>ID of content blob</td></tr><tr><td><code>dateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>dateModified</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateModified</code></td><td><code>string (date-time)</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"noteId\": \"ur11rSfHkzeV\",\n \"title\": \"string\",\n \"type\": \"text\",\n \"mime\": \"text/html\",\n \"isProtected\": true,\n \"blobId\": \"string\",\n \"dateCreated\": \"2019-08-24T14:15:22Z\",\n \"dateModified\": \"2019-08-24T14:15:22Z\",\n \"utcDateCreated\": \"2019-08-24T14:15:22Z\",\n \"utcDateModified\": \"2019-08-24T14:15:22Z\"\n}</code></pre></div></div></div></section></div><h3>Create clipper note</h3><p><code>POST /api/clipper/notes</code> · <code>createClipperNote</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>title</code></td><td><code>string</code></td></tr><tr><td><code>content</code></td><td><code>string</code></td></tr><tr><td><code>parentNoteId</code></td><td><code>string</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"title\": \"string\",\n \"content\": \"string\",\n \"parentNoteId\": \"string\"\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">201: Note created</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>Note</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr><tr><td><code>title</code> <br><em>required</em></td><td><code>string</code> <br>Note title</td></tr><tr><td><code>type</code> <br><em>required</em></td><td><code>NoteType</code> <br>One of <code>text</code>, <code>code</code>, <code>render</code>, <code>file</code>, <code>image</code>, <code>search</code>, <code>relationMap</code>, <code>book</code>, <code>noteMap</code>, <code>mermaid</code>, <code>canvas</code>, <code>webView</code>, <code>launcher</code>, <code>doc</code>, <code>contentWidget</code>, <code>mindMap</code>, <code>geoMap</code>.</td></tr><tr><td><code>mime</code> <br><em>required</em></td><td><code>string</code> <br>MIME type</td></tr><tr><td><code>isProtected</code> <br><em>required</em></td><td><code>boolean</code> <br>Whether note is protected</td></tr><tr><td><code>blobId</code></td><td><code>string</code> <br>ID of content blob</td></tr><tr><td><code>dateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>dateModified</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateModified</code></td><td><code>string (date-time)</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"noteId\": \"ur11rSfHkzeV\",\n \"title\": \"string\",\n \"type\": \"text\",\n \"mime\": \"text/html\",\n \"isProtected\": true,\n \"blobId\": \"string\",\n \"dateCreated\": \"2019-08-24T14:15:22Z\",\n \"dateModified\": \"2019-08-24T14:15:22Z\",\n \"utcDateCreated\": \"2019-08-24T14:15:22Z\",\n \"utcDateModified\": \"2019-08-24T14:15:22Z\"\n}</code></pre></div></div></div></section></div><h3>Open note in clipper</h3><p><code>POST /api/clipper/open/{noteId}</code> · <code>openNoteInClipper</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Note opened in clipper</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>success</code></td><td><code>boolean</code></td></tr><tr><td><code>url</code></td><td><code>string</code> <br>URL to open in clipper</td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"success\": true,\n \"url\": \"string\"\n}</code></pre></div></div></div></section></div><h3>Sender login</h3><p><code>POST /api/sender/login</code> · <code>senderLogin</code></p><p><strong>Authorization</strong>: none</p><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>username</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>password</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"username\": \"string\",\n \"password\": \"string\"\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Login successful</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>token</code></td><td><code>string</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"token\": \"string\"\n}</code></pre></div></div></div></section></div><h3>Upload image from sender</h3><p><code>POST /api/sender/image</code> · <code>uploadSenderImage</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Request body</strong> (required)</p><ul><li><code>multipart/form-data</code>: <code>object</code></li></ul><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>upload</code></td><td><code>string (binary)</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">201: Image uploaded</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>Note</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr><tr><td><code>title</code> <br><em>required</em></td><td><code>string</code> <br>Note title</td></tr><tr><td><code>type</code> <br><em>required</em></td><td><code>NoteType</code> <br>One of <code>text</code>, <code>code</code>, <code>render</code>, <code>file</code>, <code>image</code>, <code>search</code>, <code>relationMap</code>, <code>book</code>, <code>noteMap</code>, <code>mermaid</code>, <code>canvas</code>, <code>webView</code>, <code>launcher</code>, <code>doc</code>, <code>contentWidget</code>, <code>mindMap</code>, <code>geoMap</code>.</td></tr><tr><td><code>mime</code> <br><em>required</em></td><td><code>string</code> <br>MIME type</td></tr><tr><td><code>isProtected</code> <br><em>required</em></td><td><code>boolean</code> <br>Whether note is protected</td></tr><tr><td><code>blobId</code></td><td><code>string</code> <br>ID of content blob</td></tr><tr><td><code>dateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>dateModified</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateModified</code></td><td><code>string (date-time)</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"noteId\": \"ur11rSfHkzeV\",\n \"title\": \"string\",\n \"type\": \"text\",\n \"mime\": \"text/html\",\n \"isProtected\": true,\n \"blobId\": \"string\",\n \"dateCreated\": \"2019-08-24T14:15:22Z\",\n \"dateModified\": \"2019-08-24T14:15:22Z\",\n \"utcDateCreated\": \"2019-08-24T14:15:22Z\",\n \"utcDateModified\": \"2019-08-24T14:15:22Z\"\n}</code></pre></div></div></div></section></div><h3>Save note from sender</h3><p><code>POST /api/sender/note</code> · <code>saveSenderNote</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>title</code></td><td><code>string</code></td></tr><tr><td><code>content</code></td><td><code>string</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"title\": \"string\",\n \"content\": \"string\"\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">201: Note saved</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>Note</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr><tr><td><code>title</code> <br><em>required</em></td><td><code>string</code> <br>Note title</td></tr><tr><td><code>type</code> <br><em>required</em></td><td><code>NoteType</code> <br>One of <code>text</code>, <code>code</code>, <code>render</code>, <code>file</code>, <code>image</code>, <code>search</code>, <code>relationMap</code>, <code>book</code>, <code>noteMap</code>, <code>mermaid</code>, <code>canvas</code>, <code>webView</code>, <code>launcher</code>, <code>doc</code>, <code>contentWidget</code>, <code>mindMap</code>, <code>geoMap</code>.</td></tr><tr><td><code>mime</code> <br><em>required</em></td><td><code>string</code> <br>MIME type</td></tr><tr><td><code>isProtected</code> <br><em>required</em></td><td><code>boolean</code> <br>Whether note is protected</td></tr><tr><td><code>blobId</code></td><td><code>string</code> <br>ID of content blob</td></tr><tr><td><code>dateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>dateModified</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateModified</code></td><td><code>string (date-time)</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"noteId\": \"ur11rSfHkzeV\",\n \"title\": \"string\",\n \"type\": \"text\",\n \"mime\": \"text/html\",\n \"isProtected\": true,\n \"blobId\": \"string\",\n \"dateCreated\": \"2019-08-24T14:15:22Z\",\n \"dateModified\": \"2019-08-24T14:15:22Z\",\n \"utcDateCreated\": \"2019-08-24T14:15:22Z\",\n \"utcDateModified\": \"2019-08-24T14:15:22Z\"\n}</code></pre></div></div></div></section></div><h2>Utilities</h2><p>Miscellaneous utilities</p><h3>Get system metrics</h3><p><code>GET /api/metrics</code> · <code>getMetrics</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Query parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>format</code></td><td><code>string</code> <br>One of <code>prometheus</code>, <code>json</code>.</td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: System metrics</p><div class=\"trilium-tab-panel\"><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\"><code>application/json</code>: <code>object</code></p><div class=\"trilium-tab-panel\"><pre><code class=\"language-application-json\">{}</code></pre></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\"><code>text/plain</code>: <code>string</code></p><div class=\"trilium-tab-panel\"><p> </p></div></section></div></div></section></div><h3>Run system diagnostics</h3><p><code>GET /api/system-checks</code> · <code>runSystemChecks</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: System check results</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>array of object</code></li></ul><pre><code class=\"language-application-json\">[\n {\n \"name\": \"string\",\n \"status\": \"pass\",\n \"message\": \"string\"\n }\n]</code></pre></div></section></div><h3>Health check endpoint</h3><p><code>GET /api/health-check</code> · <code>healthCheck</code></p><p><strong>Authorization</strong>: none</p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Service is healthy</p><div class=\"trilium-tab-panel\"><ul><li><code>text/plain</code>: <code>string</code></li></ul></div></section></div><h3>Get backend log</h3><p><code>GET /api/backend-log</code> · <code>getBackendLog</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Backend log entries</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>array of object</code></li></ul><pre><code class=\"language-application-json\">[\n {\n \"timestamp\": \"2019-08-24T14:15:22Z\",\n \"level\": \"string\",\n \"message\": \"string\"\n }\n]</code></pre></div></section></div><h3>Get note size</h3><p><code>GET /api/stats/note-size/{noteId}</code> · <code>getNoteSize</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Note size</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>size</code></td><td><code>integer</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"size\": 0\n}</code></pre></div></div></div></section></div><h3>Get subtree size</h3><p><code>GET /api/stats/subtree-size/{noteId}</code> · <code>getSubtreeSize</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Subtree size</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>size</code></td><td><code>integer</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"size\": 0\n}</code></pre></div></div></div></section></div><h3>Get keyboard actions</h3><p><code>GET /api/keyboard-actions</code> · <code>getKeyboardActions</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Keyboard actions</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>array of object</code></li></ul><pre><code class=\"language-application-json\">[\n {\n \"actionName\": \"string\",\n \"shortcut\": \"string\",\n \"description\": \"string\"\n }\n]</code></pre></div></section></div><h3>Get keyboard shortcuts for notes</h3><p><code>GET /api/keyboard-shortcuts-for-notes</code> · <code>getKeyboardShortcutsForNotes</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Keyboard shortcuts for notes</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>array of object</code></li></ul><pre><code class=\"language-application-json\">[\n {\n \"noteId\": \"string\",\n \"shortcut\": \"string\",\n \"title\": \"string\"\n }\n]</code></pre></div></section></div><h3>Get font CSS</h3><p><code>GET /api/fonts</code> · <code>getFonts</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Font CSS</p><div class=\"trilium-tab-panel\"><ul><li><code>text/css</code>: <code>string</code></li></ul></div></section></div><h3>Add recent note</h3><p><code>POST /api/recent-notes</code> · <code>addRecentNote</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"noteId\": \"string\"\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: Note added to recent</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Get recent changes</h3><p><code>GET /api/recent-changes/{ancestorNoteId}</code> · <code>getRecentChanges</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>ancestorNoteId</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Recent changes</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>array of object</code></li></ul><pre><code class=\"language-application-json\">[\n {\n \"noteId\": \"string\",\n \"title\": \"string\",\n \"dateModified\": \"2019-08-24T14:15:22Z\"\n }\n]</code></pre></div></section></div><h3>Get icon usage statistics</h3><p><code>GET /api/other/icon-usage</code> · <code>getIconUsage</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Icon usage stats</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><pre><code class=\"language-application-json\">{}</code></pre></div></section></div><h3>Render markdown to HTML</h3><p><code>POST /api/other/render-markdown</code> · <code>renderMarkdown</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>markdownContent</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"markdownContent\": \"string\"\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Rendered HTML</p><div class=\"trilium-tab-panel\"><ul><li><code>text/html</code>: <code>string</code></li></ul></div></section></div><h3>Renders given HTML to Markdown</h3><p><code>POST /api/other/to-markdown</code> · <code>toMarkdown</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>htmlContent</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"htmlContent\": \"string\"\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: The input text rendered as Markdown</p><div class=\"trilium-tab-panel\"><ul><li><code>text/plain</code>: <code>string</code></li></ul></div></section></div><h2>Schemas</h2><h3><code>Note</code></h3><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr><tr><td><code>title</code> <br><em>required</em></td><td><code>string</code> <br>Note title</td></tr><tr><td><code>type</code> <br><em>required</em></td><td><code>NoteType</code> <br>One of <code>text</code>, <code>code</code>, <code>render</code>, <code>file</code>, <code>image</code>, <code>search</code>, <code>relationMap</code>, <code>book</code>, <code>noteMap</code>, <code>mermaid</code>, <code>canvas</code>, <code>webView</code>, <code>launcher</code>, <code>doc</code>, <code>contentWidget</code>, <code>mindMap</code>, <code>geoMap</code>.</td></tr><tr><td><code>mime</code> <br><em>required</em></td><td><code>string</code> <br>MIME type</td></tr><tr><td><code>isProtected</code> <br><em>required</em></td><td><code>boolean</code> <br>Whether note is protected</td></tr><tr><td><code>blobId</code></td><td><code>string</code> <br>ID of content blob</td></tr><tr><td><code>dateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>dateModified</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateModified</code></td><td><code>string (date-time)</code></td></tr></tbody></table></figure><h3><code>NoteType</code></h3><p>Type: <code>string</code></p><h3><code>Branch</code></h3><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>branchId</code> <br><em>required</em></td><td><code>string</code> <br>Branch ID (parentNoteId_noteId)</td></tr><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>parentNoteId</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>notePosition</code> <br><em>required</em></td><td><code>integer</code></td></tr><tr><td><code>prefix</code></td><td><code>string | null</code></td></tr><tr><td><code>isExpanded</code></td><td><code>boolean</code></td></tr></tbody></table></figure><h3><code>Attribute</code></h3><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>attributeId</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>type</code> <br><em>required</em></td><td><code>string</code> <br>One of <code>label</code>, <code>relation</code>.</td></tr><tr><td><code>name</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>value</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>position</code></td><td><code>integer</code></td></tr><tr><td><code>isInheritable</code></td><td><code>boolean</code></td></tr></tbody></table></figure><h3><code>Attachment</code></h3><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>attachmentId</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>ownerId</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>role</code> <br><em>required</em></td><td><code>string</code> <br>One of <code>image</code>, <code>file</code>.</td></tr><tr><td><code>mime</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>title</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>blobId</code></td><td><code>string</code></td></tr><tr><td><code>dateModified</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateModified</code></td><td><code>string (date-time)</code></td></tr></tbody></table></figure><h3><code>Revision</code></h3><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>revisionId</code></td><td><code>string</code></td></tr><tr><td><code>noteId</code></td><td><code>string</code></td></tr><tr><td><code>title</code></td><td><code>string</code></td></tr><tr><td><code>type</code></td><td><code>NoteType</code> <br>One of <code>text</code>, <code>code</code>, <code>render</code>, <code>file</code>, <code>image</code>, <code>search</code>, <code>relationMap</code>, <code>book</code>, <code>noteMap</code>, <code>mermaid</code>, <code>canvas</code>, <code>webView</code>, <code>launcher</code>, <code>doc</code>, <code>contentWidget</code>, <code>mindMap</code>, <code>geoMap</code>.</td></tr><tr><td><code>mime</code></td><td><code>string</code></td></tr><tr><td><code>dateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateCreated</code></td><td><code>string (date-time)</code></td></tr></tbody></table></figure><h3><code>SearchResult</code></h3><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code></td><td><code>string</code></td></tr><tr><td><code>title</code></td><td><code>string</code></td></tr><tr><td><code>path</code></td><td><code>string</code></td></tr><tr><td><code>score</code></td><td><code>number</code></td></tr><tr><td><code>highlights</code></td><td><code>array of string</code></td></tr></tbody></table></figure><h3><code>EntityChange</code></h3><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>entityChange</code></td><td><code>object</code></td></tr><tr><td><code>entity</code></td><td><code>object</code></td></tr></tbody></table></figure><h3><code>Timestamps</code></h3><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>dateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>dateModified</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateModified</code></td><td><code>string (date-time)</code></td></tr></tbody></table></figure><h3><code>CreateNoteRequest</code></h3><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>title</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>content</code></td><td><code>string</code></td></tr><tr><td><code>type</code> <br><em>required</em></td><td><code>NoteType</code> <br>One of <code>text</code>, <code>code</code>, <code>render</code>, <code>file</code>, <code>image</code>, <code>search</code>, <code>relationMap</code>, <code>book</code>, <code>noteMap</code>, <code>mermaid</code>, <code>canvas</code>, <code>webView</code>, <code>launcher</code>, <code>doc</code>, <code>contentWidget</code>, <code>mindMap</code>, <code>geoMap</code>.</td></tr><tr><td><code>mime</code></td><td><code>string</code></td></tr><tr><td><code>isProtected</code></td><td><code>boolean</code></td></tr><tr><td><code>isExpanded</code></td><td><code>boolean</code></td></tr><tr><td><code>notePosition</code></td><td><code>integer</code></td></tr><tr><td><code>prefix</code></td><td><code>string</code></td></tr><tr><td><code>parentNoteId</code></td><td><code>string</code></td></tr><tr><td><code>templateNoteId</code></td><td><code>string</code></td></tr></tbody></table></figure><h3><code>ScriptBundle</code></h3><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code></td><td><code>string</code></td></tr><tr><td><code>script</code></td><td><code>string</code></td></tr><tr><td><code>html</code></td><td><code>string</code></td></tr><tr><td><code>css</code></td><td><code>string</code></td></tr></tbody></table></figure><h3><code>AppInfo</code></h3><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>appVersion</code></td><td><code>string</code></td></tr><tr><td><code>dbVersion</code></td><td><code>integer</code></td></tr><tr><td><code>nodeVersion</code></td><td><code>string</code></td></tr><tr><td><code>syncVersion</code></td><td><code>integer</code></td></tr><tr><td><code>buildDate</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>buildRevision</code></td><td><code>string</code></td></tr><tr><td><code>dataDirectory</code></td><td><code>string</code></td></tr><tr><td><code>clipperProtocolVersion</code></td><td><code>string</code></td></tr><tr><td><code>utcDateTime</code></td><td><code>string (date-time)</code></td></tr></tbody></table></figure><h3><code>ChatSession</code></h3><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>sessionId</code></td><td><code>string</code></td></tr><tr><td><code>title</code></td><td><code>string</code></td></tr><tr><td><code>messages</code></td><td><code>array of object</code></td></tr><tr><td><code>createdAt</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>lastActive</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>messageCount</code></td><td><code>integer</code></td></tr></tbody></table></figure><h3><code>EtapiToken</code></h3><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>etapiTokenId</code></td><td><code>string</code></td></tr><tr><td><code>name</code></td><td><code>string</code></td></tr><tr><td><code>token</code></td><td><code>string</code></td></tr><tr><td><code>dateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>isDeleted</code></td><td><code>boolean</code></td></tr></tbody></table></figure>",+ "_help_z8O2VG4ZZJD7": "<p>This is the internal API used by the Trilium Notes client application.</p><p><strong>Important:</strong> This API is primarily intended for internal use by the Trilium client. For external integrations, please use the <a href=\"https://github.com/TriliumNext/Trilium/blob/main/docs/User%20Guide/User%20Guide/Advanced%20Usage/ETAPI%20(REST%20API).md#etapi-rest-api\">ETAPI (External Trilium API)</a> instead.</p><h2>Signing in</h2><p>Most endpoints require session-based authentication. You can authenticate using:</p><ul><li><strong>Password login</strong>: POST to <code>/api/login</code> with password</li><li><strong>Token authentication</strong>: Generate a token via <code>/api/login/token</code></li><li><strong>Sync authentication</strong>: Use document secret for sync operations</li></ul><h2>Rate Limiting</h2><p>Authentication endpoints are rate-limited to prevent brute force attacks.</p><h2>CSRF Protection</h2><p>State-changing operations require CSRF tokens when using session authentication.</p><h2>Authentication</h2><h3><code>sessionAuth</code></h3><p>API key in the <code>trilium.sid</code> cookie.</p><p>Session cookie obtained from login</p><h3><code>tokenAuth</code></h3><p>API key in the <code>Authorization</code> header.</p><p>API token in format \"Bearer {token}\"</p><h2>Sessions</h2><p>Login, logout, and session management</p><h3>Login with password</h3><p><code>POST /api/login</code> · <code>login</code></p><p><strong>Authorization</strong>: none</p><p><strong>Request body</strong> (required)</p><ul><li><code>application/x-www-form-urlencoded</code>: <code>object</code></li></ul><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>password</code> <br><em>required</em></td><td><code>string (password)</code></td></tr><tr><td><code>totpToken</code></td><td><code>string</code> <br>TOTP token if 2FA is enabled</td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Login successful</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">401: Invalid credentials or TOTP token</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Generate API token</h3><p><code>POST /api/login/token</code> · <code>generateToken</code></p><p><strong>Authorization</strong>: none</p><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>password</code> <br><em>required</em></td><td><code>string (password)</code></td></tr><tr><td><code>tokenName</code></td><td><code>string</code> <br>Optional name for the token</td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"password\": \"string\",\n \"tokenName\": \"string\"\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">201: Token created</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>authToken</code></td><td><code>string</code> <br>API authentication token</td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"authToken\": \"string\"\n}</code></pre></div></div></div></section></div><h3>Sync login using document secret</h3><p><code>POST /api/login/sync</code> · <code>loginSync</code></p><p><strong>Authorization</strong>: none</p><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>timestamp</code> <br><em>required</em></td><td><code>string (date-time)</code></td></tr><tr><td><code>hash</code> <br><em>required</em></td><td><code>string</code> <br>HMAC hash of document secret and timestamp</td></tr><tr><td><code>syncVersion</code> <br><em>required</em></td><td><code>integer</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"timestamp\": \"2019-08-24T14:15:22Z\",\n \"hash\": \"string\",\n \"syncVersion\": 0\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Login successful</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>instanceId</code></td><td><code>string</code></td></tr><tr><td><code>maxEntityChangeId</code></td><td><code>string</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"instanceId\": \"string\",\n \"maxEntityChangeId\": \"string\"\n}</code></pre></div></div></div></section></div><h3>Enter protected session</h3><p><code>POST /api/login/protected</code> · <code>enterProtectedSession</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>password</code> <br><em>required</em></td><td><code>string (password)</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"password\": \"string\"\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Protected session entered</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">401: Invalid password</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Exit protected session</h3><p><code>POST /api/logout/protected</code> · <code>exitProtectedSession</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: Protected session exited</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Keep protected session alive</h3><p><code>POST /api/login/protected/touch</code> · <code>touchProtectedSession</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: Session refreshed</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Get OAuth status</h3><p><code>GET /api/oauth/status</code> · <code>getOAuthStatus</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: OAuth status</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>enabled</code></td><td><code>boolean</code></td></tr><tr><td><code>configured</code></td><td><code>boolean</code></td></tr><tr><td><code>providers</code></td><td><code>array of string</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"enabled\": true,\n \"configured\": true,\n \"providers\": [\n \"string\"\n ]\n}</code></pre></div></div></div></section></div><h3>Validate OAuth configuration</h3><p><code>GET /api/oauth/validate</code> · <code>validateOAuth</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: OAuth validation result</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>valid</code></td><td><code>boolean</code></td></tr><tr><td><code>errors</code></td><td><code>array of string</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"valid\": true,\n \"errors\": [\n \"string\"\n ]\n}</code></pre></div></div></div></section></div><h2>Notes</h2><p>Core note operations</p><h3>Get note metadata</h3><p><code>GET /api/notes/{noteId}</code> · <code>getNote</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Note metadata</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>Note</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr><tr><td><code>title</code> <br><em>required</em></td><td><code>string</code> <br>Note title</td></tr><tr><td><code>type</code> <br><em>required</em></td><td><code>NoteType</code> <br>One of <code>text</code>, <code>code</code>, <code>render</code>, <code>file</code>, <code>image</code>, <code>search</code>, <code>relationMap</code>, <code>book</code>, <code>noteMap</code>, <code>mermaid</code>, <code>canvas</code>, <code>webView</code>, <code>launcher</code>, <code>doc</code>, <code>contentWidget</code>, <code>mindMap</code>, <code>geoMap</code>.</td></tr><tr><td><code>mime</code> <br><em>required</em></td><td><code>string</code> <br>MIME type</td></tr><tr><td><code>isProtected</code> <br><em>required</em></td><td><code>boolean</code> <br>Whether note is protected</td></tr><tr><td><code>blobId</code></td><td><code>string</code> <br>ID of content blob</td></tr><tr><td><code>dateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>dateModified</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateModified</code></td><td><code>string (date-time)</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"noteId\": \"ur11rSfHkzeV\",\n \"title\": \"string\",\n \"type\": \"text\",\n \"mime\": \"text/html\",\n \"isProtected\": true,\n \"blobId\": \"string\",\n \"dateCreated\": \"2019-08-24T14:15:22Z\",\n \"dateModified\": \"2019-08-24T14:15:22Z\",\n \"utcDateCreated\": \"2019-08-24T14:15:22Z\",\n \"utcDateModified\": \"2019-08-24T14:15:22Z\"\n}</code></pre></div></div></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">404: Note not found</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Delete note</h3><p><code>DELETE /api/notes/{noteId}</code> · <code>deleteNote</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr></tbody></table></figure><p><strong>Query parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>taskId</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>eraseNotes</code></td><td><code>boolean</code></td></tr><tr><td><code>last</code> <br><em>required</em></td><td><code>boolean</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: Note deleted</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">404: Note not found</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Get note content</h3><p><code>GET /api/notes/{noteId}/blob</code> · <code>getNoteContent</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Note content</p><div class=\"trilium-tab-panel\"><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\"><code>text/html</code>: <code>string</code></p><div class=\"trilium-tab-panel\"><p> </p></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\"><code>text/plain</code>: <code>string</code></p><div class=\"trilium-tab-panel\"><p> </p></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\"><code>application/json</code>: <code>object</code></p><div class=\"trilium-tab-panel\"><pre><code class=\"language-application-json\">{}</code></pre></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\"><code>application/octet-stream</code>: <code>string (binary)</code></p><div class=\"trilium-tab-panel\"><p> </p></div></section></div></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">404: Note not found</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Update note content</h3><p><code>PUT /api/notes/{noteId}/data</code> · <code>updateNoteContent</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr></tbody></table></figure><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>content</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>attachments</code></td><td><code>array of Attachment</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"content\": \"string\",\n \"attachments\": [\n {\n \"attachmentId\": \"string\",\n \"ownerId\": \"string\",\n \"role\": \"image\",\n \"mime\": \"string\",\n \"title\": \"string\",\n \"blobId\": \"string\",\n \"dateModified\": \"2019-08-24T14:15:22Z\",\n \"utcDateModified\": \"2019-08-24T14:15:22Z\"\n }\n ]\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: Content updated</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">404: Note not found</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Get note timestamps</h3><p><code>GET /api/notes/{noteId}/metadata</code> · <code>getNoteMetadata</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Note timestamps</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>Timestamps</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>dateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>dateModified</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateModified</code></td><td><code>string (date-time)</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"dateCreated\": \"2019-08-24T14:15:22Z\",\n \"dateModified\": \"2019-08-24T14:15:22Z\",\n \"utcDateCreated\": \"2019-08-24T14:15:22Z\",\n \"utcDateModified\": \"2019-08-24T14:15:22Z\"\n}</code></pre></div></div></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">404: Note not found</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Change note title</h3><p><code>PUT /api/notes/{noteId}/title</code> · <code>updateNoteTitle</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr></tbody></table></figure><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>title</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"title\": \"string\"\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: Title updated</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">404: Note not found</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Change note type and MIME</h3><p><code>PUT /api/notes/{noteId}/type</code> · <code>updateNoteType</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr></tbody></table></figure><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code> <br><em>required</em></td><td><code>NoteType</code> <br>One of <code>text</code>, <code>code</code>, <code>render</code>, <code>file</code>, <code>image</code>, <code>search</code>, <code>relationMap</code>, <code>book</code>, <code>noteMap</code>, <code>mermaid</code>, <code>canvas</code>, <code>webView</code>, <code>launcher</code>, <code>doc</code>, <code>contentWidget</code>, <code>mindMap</code>, <code>geoMap</code>.</td></tr><tr><td><code>mime</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"type\": \"text\",\n \"mime\": \"string\"\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: Type updated</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">404: Note not found</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Protect or unprotect note</h3><p><code>PUT /api/notes/{noteId}/protect/{isProtected}</code> · <code>protectNote</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr><tr><td><code>isProtected</code> <br><em>required</em></td><td><code>boolean</code></td></tr></tbody></table></figure><p><strong>Query parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>subtree</code></td><td><code>boolean</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: Protection status updated</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">404: Note not found</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Undelete note</h3><p><code>PUT /api/notes/{noteId}/undelete</code> · <code>undeleteNote</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: Note undeleted</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">404: Note not found</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Create new note</h3><p><code>POST /api/notes/{parentNoteId}/children</code> · <code>createNote</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>parentNoteId</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Query parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>target</code></td><td><code>string</code> <br>One of <code>after</code>, <code>into</code>.</td></tr><tr><td><code>targetBranchId</code></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>CreateNoteRequest</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>title</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>content</code></td><td><code>string</code></td></tr><tr><td><code>type</code> <br><em>required</em></td><td><code>NoteType</code> <br>One of <code>text</code>, <code>code</code>, <code>render</code>, <code>file</code>, <code>image</code>, <code>search</code>, <code>relationMap</code>, <code>book</code>, <code>noteMap</code>, <code>mermaid</code>, <code>canvas</code>, <code>webView</code>, <code>launcher</code>, <code>doc</code>, <code>contentWidget</code>, <code>mindMap</code>, <code>geoMap</code>.</td></tr><tr><td><code>mime</code></td><td><code>string</code></td></tr><tr><td><code>isProtected</code></td><td><code>boolean</code></td></tr><tr><td><code>isExpanded</code></td><td><code>boolean</code></td></tr><tr><td><code>notePosition</code></td><td><code>integer</code></td></tr><tr><td><code>prefix</code></td><td><code>string</code></td></tr><tr><td><code>parentNoteId</code></td><td><code>string</code></td></tr><tr><td><code>templateNoteId</code></td><td><code>string</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"title\": \"string\",\n \"content\": \"string\",\n \"type\": \"text\",\n \"mime\": \"string\",\n \"isProtected\": true,\n \"isExpanded\": true,\n \"notePosition\": 0,\n \"prefix\": \"string\",\n \"parentNoteId\": \"string\",\n \"templateNoteId\": \"string\"\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">201: Note created</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>note</code></td><td><code>Note</code></td></tr><tr><td><code>branch</code></td><td><code>Branch</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"note\": {\n \"noteId\": \"ur11rSfHkzeV\",\n \"title\": \"string\",\n \"type\": \"text\",\n \"mime\": \"text/html\",\n \"isProtected\": true,\n \"blobId\": \"string\",\n \"dateCreated\": \"2019-08-24T14:15:22Z\",\n \"dateModified\": \"2019-08-24T14:15:22Z\",\n \"utcDateCreated\": \"2019-08-24T14:15:22Z\",\n \"utcDateModified\": \"2019-08-24T14:15:22Z\"\n },\n \"branch\": {\n \"branchId\": \"string\",\n \"noteId\": \"string\",\n \"parentNoteId\": \"string\",\n \"notePosition\": 0,\n \"prefix\": \"string\",\n \"isExpanded\": true\n }\n}</code></pre></div></div></div></section></div><h3>Duplicate note subtree</h3><p><code>POST /api/notes/{noteId}/duplicate/{parentNoteId}</code> · <code>duplicateNote</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr><tr><td><code>parentNoteId</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">201: Note duplicated</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>Note</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr><tr><td><code>title</code> <br><em>required</em></td><td><code>string</code> <br>Note title</td></tr><tr><td><code>type</code> <br><em>required</em></td><td><code>NoteType</code> <br>One of <code>text</code>, <code>code</code>, <code>render</code>, <code>file</code>, <code>image</code>, <code>search</code>, <code>relationMap</code>, <code>book</code>, <code>noteMap</code>, <code>mermaid</code>, <code>canvas</code>, <code>webView</code>, <code>launcher</code>, <code>doc</code>, <code>contentWidget</code>, <code>mindMap</code>, <code>geoMap</code>.</td></tr><tr><td><code>mime</code> <br><em>required</em></td><td><code>string</code> <br>MIME type</td></tr><tr><td><code>isProtected</code> <br><em>required</em></td><td><code>boolean</code> <br>Whether note is protected</td></tr><tr><td><code>blobId</code></td><td><code>string</code> <br>ID of content blob</td></tr><tr><td><code>dateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>dateModified</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateModified</code></td><td><code>string (date-time)</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"noteId\": \"ur11rSfHkzeV\",\n \"title\": \"string\",\n \"type\": \"text\",\n \"mime\": \"text/html\",\n \"isProtected\": true,\n \"blobId\": \"string\",\n \"dateCreated\": \"2019-08-24T14:15:22Z\",\n \"dateModified\": \"2019-08-24T14:15:22Z\",\n \"utcDateCreated\": \"2019-08-24T14:15:22Z\",\n \"utcDateModified\": \"2019-08-24T14:15:22Z\"\n}</code></pre></div></div></div></section></div><h3>Force save revision</h3><p><code>POST /api/notes/{noteId}/revision</code> · <code>saveRevision</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">201: Revision saved</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>Revision</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>revisionId</code></td><td><code>string</code></td></tr><tr><td><code>noteId</code></td><td><code>string</code></td></tr><tr><td><code>title</code></td><td><code>string</code></td></tr><tr><td><code>type</code></td><td><code>NoteType</code> <br>One of <code>text</code>, <code>code</code>, <code>render</code>, <code>file</code>, <code>image</code>, <code>search</code>, <code>relationMap</code>, <code>book</code>, <code>noteMap</code>, <code>mermaid</code>, <code>canvas</code>, <code>webView</code>, <code>launcher</code>, <code>doc</code>, <code>contentWidget</code>, <code>mindMap</code>, <code>geoMap</code>.</td></tr><tr><td><code>mime</code></td><td><code>string</code></td></tr><tr><td><code>dateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateCreated</code></td><td><code>string (date-time)</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"revisionId\": \"string\",\n \"noteId\": \"string\",\n \"title\": \"string\",\n \"type\": \"text\",\n \"mime\": \"string\",\n \"dateCreated\": \"2019-08-24T14:15:22Z\",\n \"utcDateCreated\": \"2019-08-24T14:15:22Z\"\n}</code></pre></div></div></div></section></div><h3>Sort child notes</h3><p><code>PUT /api/notes/{noteId}/sort-children</code> · <code>sortChildren</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr></tbody></table></figure><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>sortBy</code></td><td><code>string</code> <br>One of <code>title</code>, <code>dateCreated</code>, <code>dateModified</code>.</td></tr><tr><td><code>sortDirection</code></td><td><code>string</code> <br>One of <code>asc</code>, <code>desc</code>.</td></tr><tr><td><code>foldersFirst</code></td><td><code>boolean</code></td></tr><tr><td><code>sortNatural</code></td><td><code>boolean</code></td></tr><tr><td><code>sortLocale</code></td><td><code>string</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"sortBy\": \"title\",\n \"sortDirection\": \"asc\",\n \"foldersFirst\": true,\n \"sortNatural\": true,\n \"sortLocale\": \"string\"\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: Children sorted</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Convert note to attachment</h3><p><code>POST /api/notes/{noteId}/convert-to-attachment</code> · <code>convertToAttachment</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Note converted to attachment</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>Attachment</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>attachmentId</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>ownerId</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>role</code> <br><em>required</em></td><td><code>string</code> <br>One of <code>image</code>, <code>file</code>.</td></tr><tr><td><code>mime</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>title</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>blobId</code></td><td><code>string</code></td></tr><tr><td><code>dateModified</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateModified</code></td><td><code>string (date-time)</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"attachmentId\": \"string\",\n \"ownerId\": \"string\",\n \"role\": \"image\",\n \"mime\": \"string\",\n \"title\": \"string\",\n \"blobId\": \"string\",\n \"dateModified\": \"2019-08-24T14:15:22Z\",\n \"utcDateModified\": \"2019-08-24T14:15:22Z\"\n}</code></pre></div></div></div></section></div><h3>Upload file to note</h3><p><code>PUT /api/notes/{noteId}/file</code> · <code>uploadFileToNote</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr></tbody></table></figure><p><strong>Request body</strong> (required)</p><ul><li><code>multipart/form-data</code>: <code>object</code></li></ul><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>upload</code></td><td><code>string (binary)</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: File uploaded</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Open file note</h3><p><code>GET /api/notes/{noteId}/open</code> · <code>openFileNote</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: File content</p><div class=\"trilium-tab-panel\"><ul><li><code>application/octet-stream</code>: <code>string (binary)</code></li></ul></div></section></div><h3>Download file note</h3><p><code>GET /api/notes/download/{noteId}</code> · <code>downloadFileNote</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: File content</p><div class=\"trilium-tab-panel\"><ul><li><code>application/octet-stream</code>: <code>string (binary)</code></li></ul></div></section></div><h3>Download file note (alternative path)</h3><p><code>GET /api/notes/{noteId}/download</code> · <code>downloadFileNoteAlt</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: File content</p><div class=\"trilium-tab-panel\"><ul><li><code>application/octet-stream</code>: <code>string (binary)</code></li></ul></div></section></div><h3>Save note to temp directory</h3><p><code>POST /api/notes/{noteId}/save-to-tmp-dir</code> · <code>saveToTmpDir</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: File saved to temp directory</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>filePath</code></td><td><code>string</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"filePath\": \"string\"\n}</code></pre></div></div></div></section></div><h3>Update note from modified temp file</h3><p><code>POST /api/notes/{noteId}/upload-modified-file</code> · <code>uploadModifiedFile</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr></tbody></table></figure><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>filePath</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"filePath\": \"string\"\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: Note updated from file</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Get image from note</h3><p><code>GET /api/images/{noteId}/{filename}</code> · <code>getNoteImage</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr><tr><td><code>filename</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Image content</p><div class=\"trilium-tab-panel\"><ul><li><code>image/*</code>: <code>string (binary)</code></li></ul></div></section></div><h3>Update image note</h3><p><code>PUT /api/images/{noteId}</code> · <code>updateImageNote</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr></tbody></table></figure><p><strong>Request body</strong> (required)</p><ul><li><code>multipart/form-data</code>: <code>object</code></li></ul><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>upload</code></td><td><code>string (binary)</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: Image updated</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Execute bulk action</h3><p><code>POST /api/bulk-action/execute</code> · <code>executeBulkAction</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>action</code></td><td><code>string</code></td></tr><tr><td><code>noteIds</code></td><td><code>array of string</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"action\": \"string\",\n \"noteIds\": [\n \"string\"\n ]\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Bulk action results</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Get affected notes count</h3><p><code>POST /api/bulk-action/affected-notes</code> · <code>getAffectedNotesCount</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>action</code></td><td><code>string</code></td></tr><tr><td><code>noteIds</code></td><td><code>array of string</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"action\": \"string\",\n \"noteIds\": [\n \"string\"\n ]\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Affected notes count</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>count</code></td><td><code>integer</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"count\": 0\n}</code></pre></div></div></div></section></div><h3>Preview note deletion</h3><p><code>POST /api/delete-notes-preview</code> · <code>previewNoteDeletion</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>branchIdsToDelete</code></td><td><code>array of string</code></td></tr><tr><td><code>deleteAllClones</code></td><td><code>boolean</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"branchIdsToDelete\": [\n \"string\"\n ],\n \"deleteAllClones\": true\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Deletion preview</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>notesToDelete</code></td><td><code>array of string</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"notesToDelete\": [\n \"string\"\n ]\n}</code></pre></div></div></div></section></div><h3>Erase deleted notes</h3><p><code>POST /api/notes/erase-deleted-notes-now</code> · <code>eraseDeletedNotes</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: Deleted notes erased</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h2>Tree</h2><p>Note tree structure and branches</p><h3>Get tree structure</h3><p><code>GET /api/tree</code> · <code>getTree</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Query parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>subTreeNoteId</code></td><td><code>string</code> <br>Limit tree to this note and descendants</td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Tree structure</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>notes</code></td><td><code>array of Note</code></td></tr><tr><td><code>branches</code></td><td><code>array of Branch</code></td></tr><tr><td><code>attributes</code></td><td><code>array of Attribute</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"notes\": [\n {\n \"noteId\": \"ur11rSfHkzeV\",\n \"title\": \"string\",\n \"type\": \"text\",\n \"mime\": \"text/html\",\n \"isProtected\": true,\n \"blobId\": \"string\",\n \"dateCreated\": \"2019-08-24T14:15:22Z\",\n \"dateModified\": \"2019-08-24T14:15:22Z\",\n \"utcDateCreated\": \"2019-08-24T14:15:22Z\",\n \"utcDateModified\": \"2019-08-24T14:15:22Z\"\n }\n ],\n \"branches\": [\n {\n \"branchId\": \"string\",\n \"noteId\": \"string\",\n \"parentNoteId\": \"string\",\n \"notePosition\": 0,\n \"prefix\": \"string\",\n \"isExpanded\": true\n }\n ],\n \"attributes\": [\n {\n \"attributeId\": \"string\",\n \"noteId\": \"string\",\n \"type\": \"label\",\n \"name\": \"string\",\n \"value\": \"string\",\n \"position\": 0,\n \"isInheritable\": true\n }\n ]\n}</code></pre></div></div></div></section></div><h3>Load specific notes</h3><p><code>POST /api/tree/load</code> · <code>loadNotes</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>noteIds</code> <br><em>required</em></td><td><code>array of string</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"noteIds\": [\n \"string\"\n ]\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Loaded notes</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>notes</code></td><td><code>array of Note</code></td></tr><tr><td><code>branches</code></td><td><code>array of Branch</code></td></tr><tr><td><code>attributes</code></td><td><code>array of Attribute</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"notes\": [\n {\n \"noteId\": \"ur11rSfHkzeV\",\n \"title\": \"string\",\n \"type\": \"text\",\n \"mime\": \"text/html\",\n \"isProtected\": true,\n \"blobId\": \"string\",\n \"dateCreated\": \"2019-08-24T14:15:22Z\",\n \"dateModified\": \"2019-08-24T14:15:22Z\",\n \"utcDateCreated\": \"2019-08-24T14:15:22Z\",\n \"utcDateModified\": \"2019-08-24T14:15:22Z\"\n }\n ],\n \"branches\": [\n {\n \"branchId\": \"string\",\n \"noteId\": \"string\",\n \"parentNoteId\": \"string\",\n \"notePosition\": 0,\n \"prefix\": \"string\",\n \"isExpanded\": true\n }\n ],\n \"attributes\": [\n {\n \"attributeId\": \"string\",\n \"noteId\": \"string\",\n \"type\": \"label\",\n \"name\": \"string\",\n \"value\": \"string\",\n \"position\": 0,\n \"isInheritable\": true\n }\n ]\n}</code></pre></div></div></div></section></div><h3>Delete branch</h3><p><code>DELETE /api/branches/{branchId}</code> · <code>deleteBranch</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>branchId</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Query parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>taskId</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>eraseNotes</code></td><td><code>boolean</code></td></tr><tr><td><code>last</code> <br><em>required</em></td><td><code>boolean</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Branch deleted</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>noteDeleted</code></td><td><code>boolean</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"noteDeleted\": true\n}</code></pre></div></div></div></section></div><h3>Move branch to new parent</h3><p><code>PUT /api/branches/{branchId}/move-to/{parentBranchId}</code> · <code>moveBranchToParent</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>branchId</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>parentBranchId</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: Branch moved</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Move branch before another</h3><p><code>PUT /api/branches/{branchId}/move-before/{beforeBranchId}</code> · <code>moveBranchBefore</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>branchId</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>beforeBranchId</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: Branch moved</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Move branch after another</h3><p><code>PUT /api/branches/{branchId}/move-after/{afterBranchId}</code> · <code>moveBranchAfter</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>branchId</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>afterBranchId</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: Branch moved</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Set branch expanded state</h3><p><code>PUT /api/branches/{branchId}/expanded/{expanded}</code> · <code>setBranchExpanded</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>branchId</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>expanded</code> <br><em>required</em></td><td><code>boolean</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: Expanded state updated</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Set subtree expanded state</h3><p><code>PUT /api/branches/{branchId}/expanded-subtree/{expanded}</code> · <code>setSubtreeExpanded</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>branchId</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>expanded</code> <br><em>required</em></td><td><code>boolean</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: Subtree expanded state updated</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Set branch prefix</h3><p><code>PUT /api/branches/{branchId}/set-prefix</code> · <code>setBranchPrefix</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>branchId</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>prefix</code></td><td><code>string | null</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"prefix\": \"string\"\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: Prefix updated</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Clone note to branch</h3><p><code>PUT /api/notes/{noteId}/clone-to-branch/{parentBranchId}</code> · <code>cloneToBranch</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr><tr><td><code>parentBranchId</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Note cloned</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>Branch</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>branchId</code> <br><em>required</em></td><td><code>string</code> <br>Branch ID (parentNoteId_noteId)</td></tr><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>parentNoteId</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>notePosition</code> <br><em>required</em></td><td><code>integer</code></td></tr><tr><td><code>prefix</code></td><td><code>string | null</code></td></tr><tr><td><code>isExpanded</code></td><td><code>boolean</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"branchId\": \"string\",\n \"noteId\": \"string\",\n \"parentNoteId\": \"string\",\n \"notePosition\": 0,\n \"prefix\": \"string\",\n \"isExpanded\": true\n}</code></pre></div></div></div></section></div><h3>Clone note to parent note</h3><p><code>PUT /api/notes/{noteId}/clone-to-note/{parentNoteId}</code> · <code>cloneToNote</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr><tr><td><code>parentNoteId</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Note cloned</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>Branch</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>branchId</code> <br><em>required</em></td><td><code>string</code> <br>Branch ID (parentNoteId_noteId)</td></tr><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>parentNoteId</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>notePosition</code> <br><em>required</em></td><td><code>integer</code></td></tr><tr><td><code>prefix</code></td><td><code>string | null</code></td></tr><tr><td><code>isExpanded</code></td><td><code>boolean</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"branchId\": \"string\",\n \"noteId\": \"string\",\n \"parentNoteId\": \"string\",\n \"notePosition\": 0,\n \"prefix\": \"string\",\n \"isExpanded\": true\n}</code></pre></div></div></div></section></div><h3>Clone note after branch</h3><p><code>PUT /api/notes/{noteId}/clone-after/{afterBranchId}</code> · <code>cloneAfterBranch</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr><tr><td><code>afterBranchId</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Note cloned</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>Branch</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>branchId</code> <br><em>required</em></td><td><code>string</code> <br>Branch ID (parentNoteId_noteId)</td></tr><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>parentNoteId</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>notePosition</code> <br><em>required</em></td><td><code>integer</code></td></tr><tr><td><code>prefix</code></td><td><code>string | null</code></td></tr><tr><td><code>isExpanded</code></td><td><code>boolean</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"branchId\": \"string\",\n \"noteId\": \"string\",\n \"parentNoteId\": \"string\",\n \"notePosition\": 0,\n \"prefix\": \"string\",\n \"isExpanded\": true\n}</code></pre></div></div></div></section></div><h3>Toggle note presence in parent</h3><p><code>PUT /api/notes/{noteId}/toggle-in-parent/{parentNoteId}/{present}</code> · <code>toggleInParent</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr><tr><td><code>parentNoteId</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>present</code> <br><em>required</em></td><td><code>boolean</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: Presence toggled</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h2>Attributes</h2><p>Note attributes and metadata</p><h3>Get effective note attributes</h3><p><code>GET /api/notes/{noteId}/attributes</code> · <code>getNoteAttributes</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Note attributes</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>array of Attribute</code></li></ul><pre><code class=\"language-application-json\">[\n {\n \"attributeId\": \"string\",\n \"noteId\": \"string\",\n \"type\": \"label\",\n \"name\": \"string\",\n \"value\": \"string\",\n \"position\": 0,\n \"isInheritable\": true\n }\n]</code></pre></div></section></div><h3>Update all note attributes</h3><p><code>PUT /api/notes/{noteId}/attributes</code> · <code>updateNoteAttributes</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr></tbody></table></figure><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>array of Attribute</code></li></ul><pre><code class=\"language-application-json\">[\n {\n \"attributeId\": \"string\",\n \"noteId\": \"string\",\n \"type\": \"label\",\n \"name\": \"string\",\n \"value\": \"string\",\n \"position\": 0,\n \"isInheritable\": true\n }\n]</code></pre><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: Attributes updated</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Add note attribute</h3><p><code>POST /api/notes/{noteId}/attributes</code> · <code>addNoteAttribute</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr></tbody></table></figure><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>Attribute</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>attributeId</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>type</code> <br><em>required</em></td><td><code>string</code> <br>One of <code>label</code>, <code>relation</code>.</td></tr><tr><td><code>name</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>value</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>position</code></td><td><code>integer</code></td></tr><tr><td><code>isInheritable</code></td><td><code>boolean</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"attributeId\": \"string\",\n \"noteId\": \"string\",\n \"type\": \"label\",\n \"name\": \"string\",\n \"value\": \"string\",\n \"position\": 0,\n \"isInheritable\": true\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">201: Attribute added</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>Attribute</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>attributeId</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>type</code> <br><em>required</em></td><td><code>string</code> <br>One of <code>label</code>, <code>relation</code>.</td></tr><tr><td><code>name</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>value</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>position</code></td><td><code>integer</code></td></tr><tr><td><code>isInheritable</code></td><td><code>boolean</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"attributeId\": \"string\",\n \"noteId\": \"string\",\n \"type\": \"label\",\n \"name\": \"string\",\n \"value\": \"string\",\n \"position\": 0,\n \"isInheritable\": true\n}</code></pre></div></div></div></section></div><h3>Delete attribute</h3><p><code>DELETE /api/notes/{noteId}/attributes/{attributeId}</code> · <code>deleteAttribute</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr><tr><td><code>attributeId</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: Attribute deleted</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Update single attribute</h3><p><code>PUT /api/notes/{noteId}/attribute</code> · <code>updateAttribute</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr></tbody></table></figure><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>Attribute</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>attributeId</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>type</code> <br><em>required</em></td><td><code>string</code> <br>One of <code>label</code>, <code>relation</code>.</td></tr><tr><td><code>name</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>value</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>position</code></td><td><code>integer</code></td></tr><tr><td><code>isInheritable</code></td><td><code>boolean</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"attributeId\": \"string\",\n \"noteId\": \"string\",\n \"type\": \"label\",\n \"name\": \"string\",\n \"value\": \"string\",\n \"position\": 0,\n \"isInheritable\": true\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: Attribute updated</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Set attribute value</h3><p><code>PUT /api/notes/{noteId}/set-attribute</code> · <code>setAttribute</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr></tbody></table></figure><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code> <br><em>required</em></td><td><code>string</code> <br>One of <code>label</code>, <code>relation</code>.</td></tr><tr><td><code>name</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>value</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"type\": \"label\",\n \"name\": \"string\",\n \"value\": \"string\"\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: Attribute set</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Create relation</h3><p><code>PUT /api/notes/{noteId}/relations/{name}/to/{targetNoteId}</code> · <code>createRelation</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr><tr><td><code>name</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>targetNoteId</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: Relation created</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Delete relation</h3><p><code>DELETE /api/notes/{noteId}/relations/{name}/to/{targetNoteId}</code> · <code>deleteRelation</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr><tr><td><code>name</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>targetNoteId</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: Relation deleted</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Get attribute name suggestions</h3><p><code>GET /api/attribute-names</code> · <code>getAttributeNames</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Query parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code> <br><em>required</em></td><td><code>string</code> <br>One of <code>label</code>, <code>relation</code>.</td></tr><tr><td><code>query</code></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Attribute names</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>array of string</code></li></ul><pre><code class=\"language-application-json\">[\n \"string\"\n]</code></pre></div></section></div><h3>Get values for attribute</h3><p><code>GET /api/attribute-values/{attributeName}</code> · <code>getAttributeValues</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>attributeName</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Attribute values</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>array of string</code></li></ul><pre><code class=\"language-application-json\">[\n \"string\"\n]</code></pre></div></section></div><h2>Attachments</h2><p>File attachments</p><h3>Stream file with partial content support</h3><p><code>GET /api/attachments/{attachmentId}/open-partial</code> · <code>openPartialFileAttachment</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>attachmentId</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Header parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>Range</code></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">206: Partial content</p><div class=\"trilium-tab-panel\"><ul><li><code>application/octet-stream</code>: <code>string (binary)</code></li></ul></div></section></div><h3>Get note attachments</h3><p><code>GET /api/notes/{noteId}/attachments</code> · <code>getNoteAttachments</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Note attachments</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>array of Attachment</code></li></ul><pre><code class=\"language-application-json\">[\n {\n \"attachmentId\": \"string\",\n \"ownerId\": \"string\",\n \"role\": \"image\",\n \"mime\": \"string\",\n \"title\": \"string\",\n \"blobId\": \"string\",\n \"dateModified\": \"2019-08-24T14:15:22Z\",\n \"utcDateModified\": \"2019-08-24T14:15:22Z\"\n }\n]</code></pre></div></section></div><h3>Save attachment</h3><p><code>POST /api/notes/{noteId}/attachments</code> · <code>saveAttachment</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr></tbody></table></figure><p><strong>Query parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>matchBy</code></td><td><code>string</code> <br>One of <code>attachmentId</code>, <code>title</code>.</td></tr></tbody></table></figure><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>Attachment</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>attachmentId</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>ownerId</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>role</code> <br><em>required</em></td><td><code>string</code> <br>One of <code>image</code>, <code>file</code>.</td></tr><tr><td><code>mime</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>title</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>blobId</code></td><td><code>string</code></td></tr><tr><td><code>dateModified</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateModified</code></td><td><code>string (date-time)</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"attachmentId\": \"string\",\n \"ownerId\": \"string\",\n \"role\": \"image\",\n \"mime\": \"string\",\n \"title\": \"string\",\n \"blobId\": \"string\",\n \"dateModified\": \"2019-08-24T14:15:22Z\",\n \"utcDateModified\": \"2019-08-24T14:15:22Z\"\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">201: Attachment saved</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>Attachment</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>attachmentId</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>ownerId</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>role</code> <br><em>required</em></td><td><code>string</code> <br>One of <code>image</code>, <code>file</code>.</td></tr><tr><td><code>mime</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>title</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>blobId</code></td><td><code>string</code></td></tr><tr><td><code>dateModified</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateModified</code></td><td><code>string (date-time)</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"attachmentId\": \"string\",\n \"ownerId\": \"string\",\n \"role\": \"image\",\n \"mime\": \"string\",\n \"title\": \"string\",\n \"blobId\": \"string\",\n \"dateModified\": \"2019-08-24T14:15:22Z\",\n \"utcDateModified\": \"2019-08-24T14:15:22Z\"\n}</code></pre></div></div></div></section></div><h3>Upload attachment file</h3><p><code>POST /api/notes/{noteId}/attachments/upload</code> · <code>uploadAttachment</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr></tbody></table></figure><p><strong>Query parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>link</code></td><td><code>boolean</code> <br><code>true</code> answers with a link to the attachment instead of an image URL, and stores a picture as uploaded, without compressing it or shortening its name.</td></tr></tbody></table></figure><p><strong>Request body</strong> (required)</p><ul><li><code>multipart/form-data</code>: <code>object</code></li></ul><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>upload</code></td><td><code>string (binary)</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">201: Attachment uploaded</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>Attachment</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>attachmentId</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>ownerId</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>role</code> <br><em>required</em></td><td><code>string</code> <br>One of <code>image</code>, <code>file</code>.</td></tr><tr><td><code>mime</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>title</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>blobId</code></td><td><code>string</code></td></tr><tr><td><code>dateModified</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateModified</code></td><td><code>string (date-time)</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"attachmentId\": \"string\",\n \"ownerId\": \"string\",\n \"role\": \"image\",\n \"mime\": \"string\",\n \"title\": \"string\",\n \"blobId\": \"string\",\n \"dateModified\": \"2019-08-24T14:15:22Z\",\n \"utcDateModified\": \"2019-08-24T14:15:22Z\"\n}</code></pre></div></div></div></section></div><h3>Get attachment metadata</h3><p><code>GET /api/attachments/{attachmentId}</code> · <code>getAttachment</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>attachmentId</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Attachment metadata</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>Attachment</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>attachmentId</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>ownerId</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>role</code> <br><em>required</em></td><td><code>string</code> <br>One of <code>image</code>, <code>file</code>.</td></tr><tr><td><code>mime</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>title</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>blobId</code></td><td><code>string</code></td></tr><tr><td><code>dateModified</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateModified</code></td><td><code>string (date-time)</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"attachmentId\": \"string\",\n \"ownerId\": \"string\",\n \"role\": \"image\",\n \"mime\": \"string\",\n \"title\": \"string\",\n \"blobId\": \"string\",\n \"dateModified\": \"2019-08-24T14:15:22Z\",\n \"utcDateModified\": \"2019-08-24T14:15:22Z\"\n}</code></pre></div></div></div></section></div><h3>Delete attachment</h3><p><code>DELETE /api/attachments/{attachmentId}</code> · <code>deleteAttachment</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>attachmentId</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: Attachment deleted</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Get attachment content</h3><p><code>GET /api/attachments/{attachmentId}/blob</code> · <code>getAttachmentBlob</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>attachmentId</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Query parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>preview</code></td><td><code>boolean</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Attachment content</p><div class=\"trilium-tab-panel\"><ul><li><code>application/octet-stream</code>: <code>string (binary)</code></li></ul></div></section></div><h3>Rename attachment</h3><p><code>PUT /api/attachments/{attachmentId}/rename</code> · <code>renameAttachment</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>attachmentId</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>title</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"title\": \"string\"\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: Attachment renamed</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Convert attachment to note</h3><p><code>POST /api/attachments/{attachmentId}/convert-to-note</code> · <code>convertAttachmentToNote</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>attachmentId</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Attachment converted to note</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>Note</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr><tr><td><code>title</code> <br><em>required</em></td><td><code>string</code> <br>Note title</td></tr><tr><td><code>type</code> <br><em>required</em></td><td><code>NoteType</code> <br>One of <code>text</code>, <code>code</code>, <code>render</code>, <code>file</code>, <code>image</code>, <code>search</code>, <code>relationMap</code>, <code>book</code>, <code>noteMap</code>, <code>mermaid</code>, <code>canvas</code>, <code>webView</code>, <code>launcher</code>, <code>doc</code>, <code>contentWidget</code>, <code>mindMap</code>, <code>geoMap</code>.</td></tr><tr><td><code>mime</code> <br><em>required</em></td><td><code>string</code> <br>MIME type</td></tr><tr><td><code>isProtected</code> <br><em>required</em></td><td><code>boolean</code> <br>Whether note is protected</td></tr><tr><td><code>blobId</code></td><td><code>string</code> <br>ID of content blob</td></tr><tr><td><code>dateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>dateModified</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateModified</code></td><td><code>string (date-time)</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"noteId\": \"ur11rSfHkzeV\",\n \"title\": \"string\",\n \"type\": \"text\",\n \"mime\": \"text/html\",\n \"isProtected\": true,\n \"blobId\": \"string\",\n \"dateCreated\": \"2019-08-24T14:15:22Z\",\n \"dateModified\": \"2019-08-24T14:15:22Z\",\n \"utcDateCreated\": \"2019-08-24T14:15:22Z\",\n \"utcDateModified\": \"2019-08-24T14:15:22Z\"\n}</code></pre></div></div></div></section></div><h3>Update attachment file</h3><p><code>PUT /api/attachments/{attachmentId}/file</code> · <code>updateAttachmentFile</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>attachmentId</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Request body</strong> (required)</p><ul><li><code>multipart/form-data</code>: <code>object</code></li></ul><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>upload</code></td><td><code>string (binary)</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: Attachment file updated</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Open attachment</h3><p><code>GET /api/attachments/{attachmentId}/open</code> · <code>openAttachment</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>attachmentId</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Attachment content</p><div class=\"trilium-tab-panel\"><ul><li><code>application/octet-stream</code>: <code>string (binary)</code></li></ul></div></section></div><h3>Download attachment</h3><p><code>GET /api/attachments/download/{attachmentId}</code> · <code>downloadAttachment</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>attachmentId</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Attachment content</p><div class=\"trilium-tab-panel\"><ul><li><code>application/octet-stream</code>: <code>string (binary)</code></li></ul></div></section></div><h3>Download attachment (alternative path)</h3><p><code>GET /api/attachments/{attachmentId}/download</code> · <code>downloadAttachmentAlt</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>attachmentId</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Attachment content</p><div class=\"trilium-tab-panel\"><ul><li><code>application/octet-stream</code>: <code>string (binary)</code></li></ul></div></section></div><h3>Get all attachment information</h3><p><code>GET /api/attachments/{attachmentId}/all</code> · <code>getAllAttachmentInfo</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>attachmentId</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Complete attachment information</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>attachmentId</code></td><td><code>string</code></td></tr><tr><td><code>title</code></td><td><code>string</code></td></tr><tr><td><code>mime</code></td><td><code>string</code></td></tr><tr><td><code>isProtected</code></td><td><code>boolean</code></td></tr><tr><td><code>position</code></td><td><code>integer</code></td></tr><tr><td><code>contentLength</code></td><td><code>integer</code></td></tr><tr><td><code>ownerId</code></td><td><code>string</code></td></tr><tr><td><code>dateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>dateModified</code></td><td><code>string (date-time)</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"attachmentId\": \"string\",\n \"title\": \"string\",\n \"mime\": \"string\",\n \"isProtected\": true,\n \"position\": 0,\n \"contentLength\": 0,\n \"ownerId\": \"string\",\n \"dateCreated\": \"2019-08-24T14:15:22Z\",\n \"dateModified\": \"2019-08-24T14:15:22Z\"\n}</code></pre></div></div></div></section></div><h3>Save attachment to temporary directory</h3><p><code>POST /api/attachments/{attachmentId}/save-to-tmp-dir</code> · <code>saveAttachmentToTmpDir</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>attachmentId</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Attachment saved to temporary directory</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>tmpPath</code></td><td><code>string</code> <br>Path to temporary file</td></tr><tr><td><code>success</code></td><td><code>boolean</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"tmpPath\": \"string\",\n \"success\": true\n}</code></pre></div></div></div></section></div><h3>Upload modified attachment file</h3><p><code>POST /api/attachments/{attachmentId}/upload-modified-file</code> · <code>uploadModifiedAttachmentFile</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>attachmentId</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Request body</strong> (required)</p><ul><li><code>multipart/form-data</code>: <code>object</code></li></ul><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>upload</code></td><td><code>string (binary)</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Modified file uploaded</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>success</code></td><td><code>boolean</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"success\": true\n}</code></pre></div></div></div></section></div><h3>Get attached image</h3><p><code>GET /api/attachments/{attachmentId}/image/{filename}</code> · <code>getAttachmentImage</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>attachmentId</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>filename</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Image content</p><div class=\"trilium-tab-panel\"><ul><li><code>image/*</code>: <code>string (binary)</code></li></ul></div></section></div><h3>Erase unused attachments</h3><p><code>POST /api/notes/erase-unused-attachments-now</code> · <code>eraseUnusedAttachments</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: Unused attachments erased</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h2>Revisions</h2><p>Note revision history</p><h3>Get note revisions</h3><p><code>GET /api/notes/{noteId}/revisions</code> · <code>getNoteRevisions</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Note revisions</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>array of Revision</code></li></ul><pre><code class=\"language-application-json\">[\n {\n \"revisionId\": \"string\",\n \"noteId\": \"string\",\n \"title\": \"string\",\n \"type\": \"text\",\n \"mime\": \"string\",\n \"dateCreated\": \"2019-08-24T14:15:22Z\",\n \"utcDateCreated\": \"2019-08-24T14:15:22Z\"\n }\n]</code></pre></div></section></div><h3>Erase all note revisions</h3><p><code>DELETE /api/notes/{noteId}/revisions</code> · <code>eraseNoteRevisions</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: Revisions erased</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Get revision details</h3><p><code>GET /api/revisions/{revisionId}</code> · <code>getRevision</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>revisionId</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Revision details</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>Revision</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>revisionId</code></td><td><code>string</code></td></tr><tr><td><code>noteId</code></td><td><code>string</code></td></tr><tr><td><code>title</code></td><td><code>string</code></td></tr><tr><td><code>type</code></td><td><code>NoteType</code> <br>One of <code>text</code>, <code>code</code>, <code>render</code>, <code>file</code>, <code>image</code>, <code>search</code>, <code>relationMap</code>, <code>book</code>, <code>noteMap</code>, <code>mermaid</code>, <code>canvas</code>, <code>webView</code>, <code>launcher</code>, <code>doc</code>, <code>contentWidget</code>, <code>mindMap</code>, <code>geoMap</code>.</td></tr><tr><td><code>mime</code></td><td><code>string</code></td></tr><tr><td><code>dateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateCreated</code></td><td><code>string (date-time)</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"revisionId\": \"string\",\n \"noteId\": \"string\",\n \"title\": \"string\",\n \"type\": \"text\",\n \"mime\": \"string\",\n \"dateCreated\": \"2019-08-24T14:15:22Z\",\n \"utcDateCreated\": \"2019-08-24T14:15:22Z\"\n}</code></pre></div></div></div></section></div><h3>Erase revision</h3><p><code>DELETE /api/revisions/{revisionId}</code> · <code>eraseRevision</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>revisionId</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: Revision erased</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Get revision content</h3><p><code>GET /api/revisions/{revisionId}/blob</code> · <code>getRevisionBlob</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>revisionId</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Query parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>preview</code></td><td><code>boolean</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Revision content</p><div class=\"trilium-tab-panel\"><ul><li><code>text/html</code>: <code>string</code></li><li><code>text/plain</code>: <code>string</code></li><li><code>application/octet-stream</code>: <code>string (binary)</code></li></ul></div></section></div><h3>Restore revision</h3><p><code>POST /api/revisions/{revisionId}/restore</code> · <code>restoreRevision</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>revisionId</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Revision restored</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>Note</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr><tr><td><code>title</code> <br><em>required</em></td><td><code>string</code> <br>Note title</td></tr><tr><td><code>type</code> <br><em>required</em></td><td><code>NoteType</code> <br>One of <code>text</code>, <code>code</code>, <code>render</code>, <code>file</code>, <code>image</code>, <code>search</code>, <code>relationMap</code>, <code>book</code>, <code>noteMap</code>, <code>mermaid</code>, <code>canvas</code>, <code>webView</code>, <code>launcher</code>, <code>doc</code>, <code>contentWidget</code>, <code>mindMap</code>, <code>geoMap</code>.</td></tr><tr><td><code>mime</code> <br><em>required</em></td><td><code>string</code> <br>MIME type</td></tr><tr><td><code>isProtected</code> <br><em>required</em></td><td><code>boolean</code> <br>Whether note is protected</td></tr><tr><td><code>blobId</code></td><td><code>string</code> <br>ID of content blob</td></tr><tr><td><code>dateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>dateModified</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateModified</code></td><td><code>string (date-time)</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"noteId\": \"ur11rSfHkzeV\",\n \"title\": \"string\",\n \"type\": \"text\",\n \"mime\": \"text/html\",\n \"isProtected\": true,\n \"blobId\": \"string\",\n \"dateCreated\": \"2019-08-24T14:15:22Z\",\n \"dateModified\": \"2019-08-24T14:15:22Z\",\n \"utcDateCreated\": \"2019-08-24T14:15:22Z\",\n \"utcDateModified\": \"2019-08-24T14:15:22Z\"\n}</code></pre></div></div></div></section></div><h3>Download revision</h3><p><code>GET /api/revisions/{revisionId}/download</code> · <code>downloadRevision</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>revisionId</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Revision content</p><div class=\"trilium-tab-panel\"><ul><li><code>application/octet-stream</code>: <code>string (binary)</code></li></ul></div></section></div><h3>Cleanup old revisions</h3><p><code>POST /api/revisions/erase-all-excess-revisions</code> · <code>eraseExcessRevisions</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Request body</strong></p><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>snapshotsToKeep</code></td><td><code>integer</code> <br>Snapshots to keep per note, standing in for the revisionSnapshotNumberLimit option. -1 keeps every snapshot, 0 keeps none. Omitted, the option applies. A note carrying a valid #versioningLimit follows its own label instead.</td></tr><tr><td><code>keepNamedSnapshots</code></td><td><code>boolean</code> <br>Spare named snapshots (those with a description) from erasure and leave them out of the count, so the limit governs the automatic snapshots alone.</td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"snapshotsToKeep\": 0,\n \"keepNamedSnapshots\": true\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Excess revisions erased</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>erasedCount</code></td><td><code>integer</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"erasedCount\": 0\n}</code></pre></div></div></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">400: Invalid options</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Get notes edited on date</h3><p><code>GET /api/edited-notes/{date}</code> · <code>getEditedNotes</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>date</code> <br><em>required</em></td><td><code>string (date)</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Edited notes</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>array of Note</code></li></ul><pre><code class=\"language-application-json\">[\n {\n \"noteId\": \"ur11rSfHkzeV\",\n \"title\": \"string\",\n \"type\": \"text\",\n \"mime\": \"text/html\",\n \"isProtected\": true,\n \"blobId\": \"string\",\n \"dateCreated\": \"2019-08-24T14:15:22Z\",\n \"dateModified\": \"2019-08-24T14:15:22Z\",\n \"utcDateCreated\": \"2019-08-24T14:15:22Z\",\n \"utcDateModified\": \"2019-08-24T14:15:22Z\"\n }\n]</code></pre></div></section></div><h3>Get image from revision</h3><p><code>GET /api/revisions/{revisionId}/image/{filename}</code> · <code>getRevisionImage</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>revisionId</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>filename</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Image content</p><div class=\"trilium-tab-panel\"><ul><li><code>image/*</code>: <code>string (binary)</code></li></ul></div></section></div><h2>Search</h2><p>Search and discovery</p><h3>Full text search</h3><p><code>GET /api/search</code> · <code>search</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Query parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>searchString</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Search results</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>array of SearchResult</code></li></ul><pre><code class=\"language-application-json\">[\n {\n \"noteId\": \"string\",\n \"title\": \"string\",\n \"path\": \"string\",\n \"score\": 0,\n \"highlights\": [\n \"string\"\n ]\n }\n]</code></pre></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">400: Missing or empty search string</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Quick search with highlighting</h3><p><code>GET /api/quick-search</code> · <code>quickSearch</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Query parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>searchString</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Quick search results</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>array of SearchResult</code></li></ul><pre><code class=\"language-application-json\">[\n {\n \"noteId\": \"string\",\n \"title\": \"string\",\n \"path\": \"string\",\n \"score\": 0,\n \"highlights\": [\n \"string\"\n ]\n }\n]</code></pre></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">400: Missing or empty search string</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Execute search note</h3><p><code>GET /api/search-note/{noteId}</code> · <code>executeSearchNote</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Search results</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>array of SearchResult</code></li></ul><pre><code class=\"language-application-json\">[\n {\n \"noteId\": \"string\",\n \"title\": \"string\",\n \"path\": \"string\",\n \"score\": 0,\n \"highlights\": [\n \"string\"\n ]\n }\n]</code></pre></div></section></div><h3>Search and execute actions</h3><p><code>POST /api/search-and-execute-note/{noteId}</code> · <code>searchAndExecute</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Execution results</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Find related notes by attributes</h3><p><code>POST /api/search-related</code> · <code>searchRelated</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>Attribute</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>attributeId</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>type</code> <br><em>required</em></td><td><code>string</code> <br>One of <code>label</code>, <code>relation</code>.</td></tr><tr><td><code>name</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>value</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>position</code></td><td><code>integer</code></td></tr><tr><td><code>isInheritable</code></td><td><code>boolean</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"attributeId\": \"string\",\n \"noteId\": \"string\",\n \"type\": \"label\",\n \"name\": \"string\",\n \"value\": \"string\",\n \"position\": 0,\n \"isInheritable\": true\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Related notes</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>count</code> <br><em>required</em></td><td><code>integer</code> <br>Distinct notes matching, counted before the twenty-result cap.</td></tr><tr><td><code>results</code> <br><em>required</em></td><td><code>array of object</code> <br>At most twenty, name-and-value matches ahead of name-only ones.</td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"count\": 0,\n \"results\": [\n {\n \"notePathArray\": [\n \"string\"\n ],\n \"score\": 0\n }\n ]\n}</code></pre></div></div></div></section></div><h3>Search template notes</h3><p><code>GET /api/search-templates</code> · <code>searchTemplates</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Template notes</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>array of Note</code></li></ul><pre><code class=\"language-application-json\">[\n {\n \"noteId\": \"ur11rSfHkzeV\",\n \"title\": \"string\",\n \"type\": \"text\",\n \"mime\": \"text/html\",\n \"isProtected\": true,\n \"blobId\": \"string\",\n \"dateCreated\": \"2019-08-24T14:15:22Z\",\n \"dateModified\": \"2019-08-24T14:15:22Z\",\n \"utcDateCreated\": \"2019-08-24T14:15:22Z\",\n \"utcDateModified\": \"2019-08-24T14:15:22Z\"\n }\n]</code></pre></div></section></div><h3>Get autocomplete suggestions</h3><p><code>GET /api/autocomplete</code> · <code>autocomplete</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Query parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>query</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>fastSearch</code></td><td><code>boolean</code></td></tr><tr><td><code>activeNoteId</code></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Autocomplete suggestions</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>array of object</code></li></ul><pre><code class=\"language-application-json\">[\n {\n \"noteId\": \"string\",\n \"title\": \"string\",\n \"path\": \"string\"\n }\n]</code></pre></div></section></div><h3>Find similar notes</h3><p><code>GET /api/similar-notes/{noteId}</code> · <code>findSimilarNotes</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Similar notes</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>array of object</code></li></ul><pre><code class=\"language-application-json\">[\n {\n \"noteId\": \"string\",\n \"title\": \"string\",\n \"similarity\": 0\n }\n]</code></pre></div></section></div><h2>Import/Export</h2><p>Import and export operations</p><h3>Export branch</h3><p><code>GET /api/branches/{branchId}/export/{type}/{format}/{taskId}</code> · <code>exportBranch</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>branchId</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>type</code> <br><em>required</em></td><td><code>string</code> <br>One of <code>subtree</code>, <code>single</code>.</td></tr><tr><td><code>format</code> <br><em>required</em></td><td><code>string</code> <br>One of <code>html</code>, <code>markdown</code>, <code>opml</code>.</td></tr><tr><td><code>taskId</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Exported content</p><div class=\"trilium-tab-panel\"><ul><li><code>application/octet-stream</code>: <code>string (binary)</code></li></ul></div></section></div><h3>Import notes</h3><p><code>POST /api/notes/{parentNoteId}/notes-import</code> · <code>importNotes</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>parentNoteId</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Request body</strong> (required)</p><ul><li><code>multipart/form-data</code>: <code>object</code></li></ul><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>upload</code></td><td><code>string (binary)</code></td></tr><tr><td><code>safeImport</code></td><td><code>boolean</code></td></tr><tr><td><code>shrinkImages</code></td><td><code>boolean</code></td></tr><tr><td><code>textImportedAsText</code></td><td><code>boolean</code></td></tr><tr><td><code>codeImportedAsCode</code></td><td><code>boolean</code></td></tr><tr><td><code>explodeArchives</code></td><td><code>boolean</code></td></tr><tr><td><code>replaceUnderscoresWithSpaces</code></td><td><code>boolean</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Import results</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code></td><td><code>string</code></td></tr><tr><td><code>note</code></td><td><code>Note</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"noteId\": \"string\",\n \"note\": {\n \"noteId\": \"ur11rSfHkzeV\",\n \"title\": \"string\",\n \"type\": \"text\",\n \"mime\": \"text/html\",\n \"isProtected\": true,\n \"blobId\": \"string\",\n \"dateCreated\": \"2019-08-24T14:15:22Z\",\n \"dateModified\": \"2019-08-24T14:15:22Z\",\n \"utcDateCreated\": \"2019-08-24T14:15:22Z\",\n \"utcDateModified\": \"2019-08-24T14:15:22Z\"\n }\n}</code></pre></div></div></div></section></div><h3>Import attachments</h3><p><code>POST /api/notes/{parentNoteId}/attachments-import</code> · <code>importAttachments</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>parentNoteId</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Request body</strong> (required)</p><ul><li><code>multipart/form-data</code>: <code>object</code></li></ul><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>upload</code></td><td><code>array of string (binary)</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Import results</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h2>Sync</h2><p>Synchronization between instances</p><h3>Test sync connection</h3><p><code>POST /api/sync/test</code> · <code>testSync</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Sync test results</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Trigger sync now</h3><p><code>POST /api/sync/now</code> · <code>syncNow</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Sync started</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Get sync status</h3><p><code>GET /api/sync/check</code> · <code>checkSync</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Sync status</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>synced</code></td><td><code>boolean</code></td></tr><tr><td><code>lastSyncedPush</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>lastSyncedPull</code></td><td><code>string (date-time)</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"synced\": true,\n \"lastSyncedPush\": \"2019-08-24T14:15:22Z\",\n \"lastSyncedPull\": \"2019-08-24T14:15:22Z\"\n}</code></pre></div></div></div></section></div><h3>Get sync changes</h3><p><code>GET /api/sync/changed</code> · <code>getSyncChanges</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Query parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>instanceId</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>lastEntityChangeId</code> <br><em>required</em></td><td><code>integer</code></td></tr><tr><td><code>logMarkerId</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Sync changes</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>entityChanges</code></td><td><code>array of EntityChange</code></td></tr><tr><td><code>lastEntityChangeId</code></td><td><code>integer</code></td></tr><tr><td><code>outstandingPullCount</code></td><td><code>integer</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"entityChanges\": [\n {\n \"entityChange\": {\n \"entityName\": \"string\",\n \"changeId\": \"string\"\n },\n \"entity\": {}\n }\n ],\n \"lastEntityChangeId\": 0,\n \"outstandingPullCount\": 0\n}</code></pre></div></div></div></section></div><h3>Push sync changes</h3><p><code>PUT /api/sync/update</code> · <code>pushSyncChanges</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Query parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>logMarkerId</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Header parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>pageCount</code> <br><em>required</em></td><td><code>integer</code></td></tr><tr><td><code>pageIndex</code> <br><em>required</em></td><td><code>integer</code></td></tr><tr><td><code>requestId</code></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>instanceId</code></td><td><code>string</code></td></tr><tr><td><code>entities</code></td><td><code>array of EntityChange</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"instanceId\": \"string\",\n \"entities\": [\n {\n \"entityChange\": {\n \"entityName\": \"string\",\n \"changeId\": \"string\"\n },\n \"entity\": {}\n }\n ]\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Changes processed</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Mark sync as finished</h3><p><code>POST /api/sync/finished</code> · <code>finishSync</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: Sync finished</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Get sync statistics</h3><p><code>GET /api/sync/stats</code> · <code>getSyncStats</code></p><p><strong>Authorization</strong>: none</p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Sync statistics</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>initialized</code></td><td><code>boolean</code></td></tr><tr><td><code>stats</code></td><td><code>object</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"initialized\": true,\n \"stats\": {}\n}</code></pre></div></div></div></section></div><h3>Fill entity changes</h3><p><code>POST /api/sync/fill-entity-changes</code> · <code>fillEntityChanges</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: Entity changes filled</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Force full sync</h3><p><code>POST /api/sync/force-full-sync</code> · <code>forceFullSync</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: Full sync forced</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Check entity changes consistency</h3><p><code>POST /api/sync/check-entity-changes</code> · <code>checkEntityChanges</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Consistency check results</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Queue sector for sync</h3><p><code>POST /api/sync/queue-sector/{entityName}/{sector}</code> · <code>queueSyncSector</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>entityName</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>sector</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: Sector queued</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h2>Scripting</h2><p>Script execution and automation</p><h3>Execute script</h3><p><code>POST /api/script/exec</code> · <code>executeScript</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>script</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>params</code></td><td><code>array of string</code></td></tr><tr><td><code>startNoteId</code></td><td><code>string</code></td></tr><tr><td><code>currentNoteId</code></td><td><code>string</code></td></tr><tr><td><code>originEntityName</code></td><td><code>string</code></td></tr><tr><td><code>originEntityId</code></td><td><code>string</code></td></tr><tr><td><code>transactional</code></td><td><code>boolean</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"script\": \"string\",\n \"params\": [\n \"string\"\n ],\n \"startNoteId\": \"string\",\n \"currentNoteId\": \"string\",\n \"originEntityName\": \"string\",\n \"originEntityId\": \"string\",\n \"transactional\": true\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Script execution results</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><pre><code class=\"language-application-json\">{}</code></pre></div></section></div><h3>Run script note</h3><p><code>POST /api/script/run/{noteId}</code> · <code>runScriptNote</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Script execution results</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Get startup script bundles</h3><p><code>GET /api/script/startup</code> · <code>getStartupScripts</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Query parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>mobile</code></td><td><code>boolean</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Startup scripts</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>array of ScriptBundle</code></li></ul><pre><code class=\"language-application-json\">[\n {\n \"noteId\": \"string\",\n \"script\": \"string\",\n \"html\": \"string\",\n \"css\": \"string\"\n }\n]</code></pre></div></section></div><h3>Get widget script bundles</h3><p><code>GET /api/script/widgets</code> · <code>getWidgetScripts</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Widget scripts</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>array of ScriptBundle</code></li></ul><pre><code class=\"language-application-json\">[\n {\n \"noteId\": \"string\",\n \"script\": \"string\",\n \"html\": \"string\",\n \"css\": \"string\"\n }\n]</code></pre></div></section></div><h3>Get script bundle for note</h3><p><code>POST /api/script/bundle/{noteId}</code> · <code>getScriptBundle</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Script bundle</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>ScriptBundle</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code></td><td><code>string</code></td></tr><tr><td><code>script</code></td><td><code>string</code></td></tr><tr><td><code>html</code></td><td><code>string</code></td></tr><tr><td><code>css</code></td><td><code>string</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"noteId\": \"string\",\n \"script\": \"string\",\n \"html\": \"string\",\n \"css\": \"string\"\n}</code></pre></div></div></div></section></div><h3>Get relation script bundles</h3><p><code>GET /api/script/relation/{noteId}/{relationName}</code> · <code>getRelationScripts</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr><tr><td><code>relationName</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Relation scripts</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>array of ScriptBundle</code></li></ul><pre><code class=\"language-application-json\">[\n {\n \"noteId\": \"string\",\n \"script\": \"string\",\n \"html\": \"string\",\n \"css\": \"string\"\n }\n]</code></pre></div></section></div><h2>Configuration</h2><p>System options and settings</p><h3>Get application information</h3><p><code>GET /api/app-info</code> · <code>getAppInfo</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Application information</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>AppInfo</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>appVersion</code></td><td><code>string</code></td></tr><tr><td><code>dbVersion</code></td><td><code>integer</code></td></tr><tr><td><code>nodeVersion</code></td><td><code>string</code></td></tr><tr><td><code>syncVersion</code></td><td><code>integer</code></td></tr><tr><td><code>buildDate</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>buildRevision</code></td><td><code>string</code></td></tr><tr><td><code>dataDirectory</code></td><td><code>string</code></td></tr><tr><td><code>clipperProtocolVersion</code></td><td><code>string</code></td></tr><tr><td><code>utcDateTime</code></td><td><code>string (date-time)</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"appVersion\": \"0.91.6\",\n \"dbVersion\": 228,\n \"nodeVersion\": \"string\",\n \"syncVersion\": 34,\n \"buildDate\": \"2019-08-24T14:15:22Z\",\n \"buildRevision\": \"string\",\n \"dataDirectory\": \"string\",\n \"clipperProtocolVersion\": \"string\",\n \"utcDateTime\": \"2019-08-24T14:15:22Z\"\n}</code></pre></div></div></div></section></div><h3>Get setup status</h3><p><code>GET /api/setup/status</code> · <code>getSetupStatus</code></p><p><strong>Authorization</strong>: none</p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Setup status</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>isInitialized</code></td><td><code>boolean</code></td></tr><tr><td><code>schemaExists</code></td><td><code>boolean</code></td></tr><tr><td><code>syncVersion</code></td><td><code>integer</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"isInitialized\": true,\n \"schemaExists\": true,\n \"syncVersion\": 0\n}</code></pre></div></div></div></section></div><h3>Initialize new document</h3><p><code>POST /api/setup/new-document</code> · <code>initNewDocument</code></p><p><strong>Authorization</strong>: none</p><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>password</code> <br><em>required</em></td><td><code>string (password)</code></td></tr><tr><td><code>theme</code></td><td><code>string</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"password\": \"string\",\n \"theme\": \"string\"\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">201: Document initialized</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Setup sync from server</h3><p><code>POST /api/setup/sync-from-server</code> · <code>setupSyncFromServer</code></p><p><strong>Authorization</strong>: none</p><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>syncServerHost</code> <br><em>required</em></td><td><code>string (uri)</code></td></tr><tr><td><code>syncProxy</code></td><td><code>string</code></td></tr><tr><td><code>password</code> <br><em>required</em></td><td><code>string (password)</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"syncServerHost\": \"string\",\n \"syncProxy\": \"string\",\n \"password\": \"string\"\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Sync setup successful</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Get sync seed for setup</h3><p><code>GET /api/setup/sync-seed</code> · <code>getSyncSeed</code></p><p><strong>Authorization</strong>: none</p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Sync seed information</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>syncVersion</code></td><td><code>integer</code></td></tr><tr><td><code>schemaVersion</code></td><td><code>integer</code></td></tr><tr><td><code>documentSecret</code></td><td><code>string</code></td></tr><tr><td><code>maxSyncId</code></td><td><code>integer</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"syncVersion\": 0,\n \"schemaVersion\": 0,\n \"documentSecret\": \"string\",\n \"maxSyncId\": 0\n}</code></pre></div></div></div></section></div><h3>Get system options</h3><p><code>GET /api/options</code> · <code>getOptions</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: System options</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><pre><code class=\"language-application-json\">{}</code></pre></div></section></div><h3>Update multiple options</h3><p><code>PUT /api/options</code> · <code>updateOptions</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>object</code></li></ul><pre><code class=\"language-application-json\">{}</code></pre><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: Options updated</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Update single option</h3><p><code>PUT /api/options/{name}/{value}</code> · <code>updateOption</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>name</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>value</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: Option updated</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Get user-defined themes</h3><p><code>GET /api/options/user-themes</code> · <code>getUserThemes</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: User themes</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>array of object</code></li></ul><pre><code class=\"language-application-json\">[\n {\n \"name\": \"string\",\n \"label\": \"string\"\n }\n]</code></pre></div></section></div><h3>Get supported locales</h3><p><code>GET /api/options/locales</code> · <code>getLocales</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Supported locales</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>array of object</code></li></ul><pre><code class=\"language-application-json\">[\n {\n \"code\": \"string\",\n \"name\": \"string\"\n }\n]</code></pre></div></section></div><h2>Database</h2><p>Database operations</p><h3>Get database schema</h3><p><code>GET /api/sql/schema</code> · <code>getDatabaseSchema</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Database schema</p><div class=\"trilium-tab-panel\"><ul><li><code>text/plain</code>: <code>string</code></li></ul></div></section></div><h3>Execute SQL from note</h3><p><code>POST /api/sql/execute/{noteId}</code> · <code>executeSql</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: SQL execution results</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>array of object</code></li></ul><pre><code class=\"language-application-json\">[\n {}\n]</code></pre></div></section></div><h3>Create database backup</h3><p><code>POST /api/database/backup-database</code> · <code>backupDatabase</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: Backup created</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>List existing backups</h3><p><code>GET /api/database/backups</code> · <code>listBackups</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Backup list</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>backupFolderPath</code></td><td><code>string | null</code> <br>Directory where the backups are stored, or null if there is no user-accessible location.</td></tr><tr><td><code>backups</code></td><td><code>array of object</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"backupFolderPath\": \"string\",\n \"backups\": [\n {\n \"fileName\": \"string\",\n \"filePath\": \"string\",\n \"mtime\": \"2019-08-24T14:15:22Z\",\n \"fileSize\": 0\n }\n ]\n}</code></pre></div></div></div></section></div><h3>Vacuum database</h3><p><code>POST /api/database/vacuum-database</code> · <code>vacuumDatabase</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: Database vacuumed</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Anonymize database</h3><p><code>POST /api/database/anonymize/{type}</code> · <code>anonymizeDatabase</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code> <br><em>required</em></td><td><code>string</code> <br>One of <code>save-as-file</code>, <code>save-and-send</code>.</td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Anonymization results</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>List anonymized databases</h3><p><code>GET /api/database/anonymized-databases</code> · <code>listAnonymizedDatabases</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Anonymized database list</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>anonymizedFolderPath</code></td><td><code>string</code> <br>Directory where the anonymized databases are stored.</td></tr><tr><td><code>databases</code></td><td><code>array of object</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"anonymizedFolderPath\": \"string\",\n \"databases\": [\n {\n \"fileName\": \"string\",\n \"filePath\": \"string\",\n \"mtime\": \"2019-08-24T14:15:22Z\",\n \"fileSize\": 0\n }\n ]\n}</code></pre></div></div></div></section></div><h3>Download an anonymized database file</h3><p><code>GET /api/database/anonymized/download</code> · <code>downloadAnonymizedDatabase</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Query parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>filePath</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Anonymized database file</p><div class=\"trilium-tab-panel\"><ul><li><code>application/x-sqlite3</code>: <code>string (binary)</code></li></ul></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">400: Missing filePath</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">403: Path outside the anonymized database directory</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">404: File not found</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Fix consistency issues</h3><p><code>POST /api/database/find-and-fix-consistency-issues</code> · <code>fixConsistencyIssues</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Consistency check results</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Check database integrity</h3><p><code>GET /api/database/check-integrity</code> · <code>checkIntegrity</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Integrity check results</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>results</code></td><td><code>array of string</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"results\": [\n \"string\"\n ]\n}</code></pre></div></div></div></section></div><h2>LLM</h2><p>AI/LLM integration</p><h3>List all chat sessions</h3><p><code>GET /api/llm/chat</code> · <code>listChatSessions</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Chat sessions</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>array of ChatSession</code></li></ul><pre><code class=\"language-application-json\">[\n {\n \"sessionId\": \"string\",\n \"title\": \"string\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"string\",\n \"timestamp\": \"2019-08-24T14:15:22Z\"\n }\n ],\n \"createdAt\": \"2019-08-24T14:15:22Z\",\n \"lastActive\": \"2019-08-24T14:15:22Z\",\n \"messageCount\": 0\n }\n]</code></pre></div></section></div><h3>Create new chat session</h3><p><code>POST /api/llm/chat</code> · <code>createChatSession</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>title</code></td><td><code>string</code></td></tr><tr><td><code>systemPrompt</code></td><td><code>string</code></td></tr><tr><td><code>temperature</code></td><td><code>number</code></td></tr><tr><td><code>maxTokens</code></td><td><code>integer</code></td></tr><tr><td><code>model</code></td><td><code>string</code></td></tr><tr><td><code>provider</code></td><td><code>string</code> <br>One of <code>openai</code>, <code>anthropic</code>, <code>ollama</code>.</td></tr><tr><td><code>contextNoteId</code></td><td><code>string</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"title\": \"string\",\n \"systemPrompt\": \"string\",\n \"temperature\": 0,\n \"maxTokens\": 0,\n \"model\": \"string\",\n \"provider\": \"openai\",\n \"contextNoteId\": \"string\"\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">201: Chat session created</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>ChatSession</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>sessionId</code></td><td><code>string</code></td></tr><tr><td><code>title</code></td><td><code>string</code></td></tr><tr><td><code>messages</code></td><td><code>array of object</code></td></tr><tr><td><code>createdAt</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>lastActive</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>messageCount</code></td><td><code>integer</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"sessionId\": \"string\",\n \"title\": \"string\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"string\",\n \"timestamp\": \"2019-08-24T14:15:22Z\"\n }\n ],\n \"createdAt\": \"2019-08-24T14:15:22Z\",\n \"lastActive\": \"2019-08-24T14:15:22Z\",\n \"messageCount\": 0\n}</code></pre></div></div></div></section></div><h3>Get specific chat session</h3><p><code>GET /api/llm/chat/{sessionId}</code> · <code>getChatSession</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>sessionId</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Chat session details</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>ChatSession</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>sessionId</code></td><td><code>string</code></td></tr><tr><td><code>title</code></td><td><code>string</code></td></tr><tr><td><code>messages</code></td><td><code>array of object</code></td></tr><tr><td><code>createdAt</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>lastActive</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>messageCount</code></td><td><code>integer</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"sessionId\": \"string\",\n \"title\": \"string\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"string\",\n \"timestamp\": \"2019-08-24T14:15:22Z\"\n }\n ],\n \"createdAt\": \"2019-08-24T14:15:22Z\",\n \"lastActive\": \"2019-08-24T14:15:22Z\",\n \"messageCount\": 0\n}</code></pre></div></div></div></section></div><h3>Update chat session</h3><p><code>PATCH /api/llm/chat/{sessionId}</code> · <code>updateChatSession</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>sessionId</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>title</code></td><td><code>string</code></td></tr><tr><td><code>systemPrompt</code></td><td><code>string</code></td></tr><tr><td><code>temperature</code></td><td><code>number</code></td></tr><tr><td><code>maxTokens</code></td><td><code>integer</code></td></tr><tr><td><code>model</code></td><td><code>string</code></td></tr><tr><td><code>provider</code></td><td><code>string</code></td></tr><tr><td><code>contextNoteId</code></td><td><code>string</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"title\": \"string\",\n \"systemPrompt\": \"string\",\n \"temperature\": 0,\n \"maxTokens\": 0,\n \"model\": \"string\",\n \"provider\": \"string\",\n \"contextNoteId\": \"string\"\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Session updated</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>ChatSession</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>sessionId</code></td><td><code>string</code></td></tr><tr><td><code>title</code></td><td><code>string</code></td></tr><tr><td><code>messages</code></td><td><code>array of object</code></td></tr><tr><td><code>createdAt</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>lastActive</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>messageCount</code></td><td><code>integer</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"sessionId\": \"string\",\n \"title\": \"string\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"string\",\n \"timestamp\": \"2019-08-24T14:15:22Z\"\n }\n ],\n \"createdAt\": \"2019-08-24T14:15:22Z\",\n \"lastActive\": \"2019-08-24T14:15:22Z\",\n \"messageCount\": 0\n}</code></pre></div></div></div></section></div><h3>Delete chat session</h3><p><code>DELETE /api/llm/chat/{chatNoteId}</code> · <code>deleteChatSession</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>chatNoteId</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: Session deleted</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Send message to LLM</h3><p><code>POST /api/llm/chat/{chatNoteId}/messages</code> · <code>sendChatMessage</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>sessionId</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>message</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>options</code></td><td><code>object</code></td></tr><tr><td><code>includeContext</code></td><td><code>boolean</code></td></tr><tr><td><code>useNoteContext</code></td><td><code>boolean</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"message\": \"string\",\n \"options\": {\n \"temperature\": 0,\n \"maxTokens\": 0,\n \"model\": \"string\",\n \"provider\": \"string\"\n },\n \"includeContext\": true,\n \"useNoteContext\": true\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: LLM response</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>response</code></td><td><code>string</code></td></tr><tr><td><code>sources</code></td><td><code>array of object</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"response\": \"string\",\n \"sources\": [\n {\n \"noteId\": \"string\",\n \"title\": \"string\",\n \"similarity\": 0\n }\n ]\n}</code></pre></div></div></div></section></div><h3>Stream message to LLM</h3><p><code>POST /api/llm/chat/{chatNoteId}/messages/stream</code> · <code>streamChatMessage</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>sessionId</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>content</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>useAdvancedContext</code></td><td><code>boolean</code></td></tr><tr><td><code>showThinking</code></td><td><code>boolean</code></td></tr><tr><td><code>mentions</code></td><td><code>array of string</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"content\": \"string\",\n \"useAdvancedContext\": true,\n \"showThinking\": true,\n \"mentions\": [\n \"string\"\n ]\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Streaming started</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>List Ollama models</h3><p><code>GET /api/llm/providers/ollama/models</code> · <code>listOllamaModels</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Query parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>baseUrl</code></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Ollama models</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>success</code></td><td><code>boolean</code></td></tr><tr><td><code>models</code></td><td><code>array of object</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"success\": true,\n \"models\": [\n {}\n ]\n}</code></pre></div></div></div></section></div><h3>List OpenAI models</h3><p><code>GET /api/llm/providers/openai/models</code> · <code>listOpenAIModels</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: OpenAI models</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>success</code></td><td><code>boolean</code></td></tr><tr><td><code>chatModels</code></td><td><code>array of object</code></td></tr><tr><td><code>embeddingModels</code></td><td><code>array of object</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"success\": true,\n \"chatModels\": [\n {\n \"id\": \"string\",\n \"name\": \"string\",\n \"type\": \"string\"\n }\n ],\n \"embeddingModels\": [\n {\n \"id\": \"string\",\n \"name\": \"string\",\n \"type\": \"string\"\n }\n ]\n}</code></pre></div></div></div></section></div><h3>List Anthropic models</h3><p><code>GET /api/llm/providers/anthropic/models</code> · <code>listAnthropicModels</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Anthropic models</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>success</code></td><td><code>boolean</code></td></tr><tr><td><code>chatModels</code></td><td><code>array of object</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"success\": true,\n \"chatModels\": [\n {\n \"id\": \"string\",\n \"name\": \"string\",\n \"type\": \"string\"\n }\n ]\n}</code></pre></div></div></div></section></div><h2>Security</h2><p>Security features (2FA, tokens)</p><h3>Change password</h3><p><code>POST /api/password/change</code> · <code>changePassword</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>current_password</code></td><td><code>string (password)</code></td></tr><tr><td><code>new_password</code> <br><em>required</em></td><td><code>string (password)</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"current_password\": \"string\",\n \"new_password\": \"string\"\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: Password changed</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Reset password (destructive)</h3><p><code>POST /api/password/reset</code> · <code>resetPassword</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Query parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>really</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: Password reset</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Generate a TOTP secret</h3><p><code>GET /api/totp/generate</code> · <code>generateTotpSecret</code></p><p>Generates a fresh TOTP secret without persisting it. The caller must verify a code for this secret (see <code>/api/totp/verify</code>) and commit it (see <code>/api/totp/enable</code>) before it becomes active.</p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: TOTP secret generated</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>success</code></td><td><code>boolean</code></td></tr><tr><td><code>message</code></td><td><code>string</code> <br>The bare TOTP secret (for manual entry), or an error message on failure.</td></tr><tr><td><code>url</code></td><td><code>string</code> <br>The <code>otpauth://</code> URL the authenticator expects, rendered as a QR code by the client.</td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"success\": true,\n \"message\": \"string\",\n \"url\": \"string\"\n}</code></pre></div></div></div></section></div><h3>Verify a generated TOTP secret</h3><p><code>POST /api/totp/verify</code> · <code>verifyTotpSecret</code></p><p>Verifies a freshly generated secret against a code the user produced for it, without persisting anything. On success, issues (unpersisted) recovery codes to be shown as the next enrollment step.</p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>secret</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>token</code> <br><em>required</em></td><td><code>string</code> <br>A TOTP code the user generated for the supplied secret.</td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"secret\": \"string\",\n \"token\": \"string\"\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Verification result</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>success</code></td><td><code>boolean</code></td></tr><tr><td><code>recoveryCodes</code></td><td><code>array of string</code> <br>One-time recovery codes, present only when verification succeeds.</td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"success\": true,\n \"recoveryCodes\": [\n \"string\"\n ]\n}</code></pre></div></div></div></section></div><h3>Enable TOTP with a verified secret</h3><p><code>POST /api/totp/enable</code> · <code>enableTotp</code></p><p>Commits a verified secret together with its recovery codes, activating TOTP. This is the final enrollment step and the only point at which the secret and recovery codes are persisted.</p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>secret</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>recoveryCodes</code> <br><em>required</em></td><td><code>array of string</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"secret\": \"string\",\n \"recoveryCodes\": [\n \"string\"\n ]\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Result of enabling TOTP</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>success</code></td><td><code>boolean</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"success\": true\n}</code></pre></div></div></div></section></div><h3>Get TOTP status</h3><p><code>GET /api/totp/status</code> · <code>getTotpStatus</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: TOTP status</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>success</code></td><td><code>boolean</code></td></tr><tr><td><code>message</code></td><td><code>boolean</code> <br>Whether TOTP is the active second factor and a secret is set.</td></tr><tr><td><code>set</code></td><td><code>boolean</code> <br>Whether a TOTP secret is currently stored.</td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"success\": true,\n \"message\": true,\n \"set\": true\n}</code></pre></div></div></div></section></div><h3>Get the stored TOTP secret</h3><p><code>GET /api/totp/get</code> · <code>getTotpSecret</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: The stored TOTP secret, or <code>null</code> if none is set.</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>string | null</code></li></ul><pre><code class=\"language-application-json\">\"string\"</code></pre></div></section></div><h3>Reset (disable) TOTP</h3><p><code>POST /api/totp/reset</code> · <code>resetTotp</code></p><p>Clears the stored TOTP secret and its recovery codes, disabling TOTP.</p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Result of resetting TOTP</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>success</code></td><td><code>boolean</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"success\": true\n}</code></pre></div></div></div></section></div><h3>Check if TOTP recovery codes are set</h3><p><code>GET /api/totp_recovery/enabled</code> · <code>isTotpRecoveryEnabled</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: TOTP recovery status</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>success</code></td><td><code>boolean</code></td></tr><tr><td><code>keysExist</code></td><td><code>boolean</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"success\": true,\n \"keysExist\": true\n}</code></pre></div></div></div></section></div><h3>Regenerate TOTP recovery codes</h3><p><code>POST /api/totp_recovery/regenerate</code> · <code>regenerateTotpRecoveryCodes</code></p><p>Issues a fresh batch of recovery codes for the already-enrolled TOTP secret, replacing any existing ones, and returns them for one-time display. Refuses when no TOTP secret is set.</p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Generated recovery codes</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>success</code></td><td><code>boolean</code></td></tr><tr><td><code>recoveryCodes</code></td><td><code>array of string</code> <br>New recovery codes, present only when regeneration succeeds.</td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"success\": true,\n \"recoveryCodes\": [\n \"string\"\n ]\n}</code></pre></div></div></div></section></div><h3>Get used TOTP recovery codes</h3><p><code>GET /api/totp_recovery/used</code> · <code>getUsedTotpRecoveryCodes</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Used recovery codes status. Returns an empty array if no recovery codes are set, otherwise an object listing each code's status.</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>array of any | object</code></li></ul><pre><code class=\"language-application-json\">[\n null\n]</code></pre></div></section></div><h3>Verify a TOTP recovery code</h3><p><code>POST /api/totp_recovery/verify</code> · <code>verifyTotpRecoveryCode</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>recovery_code_guess</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"recovery_code_guess\": \"string\"\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Verification result</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>success</code></td><td><code>boolean</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"success\": true\n}</code></pre></div></div></div></section></div><h3>List ETAPI tokens</h3><p><code>GET /api/etapi-tokens</code> · <code>listEtapiTokens</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: ETAPI tokens</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>array of EtapiToken</code></li></ul><pre><code class=\"language-application-json\">[\n {\n \"etapiTokenId\": \"string\",\n \"name\": \"string\",\n \"token\": \"string\",\n \"dateCreated\": \"2019-08-24T14:15:22Z\",\n \"isDeleted\": true\n }\n]</code></pre></div></section></div><h3>Create ETAPI token</h3><p><code>POST /api/etapi-tokens</code> · <code>createEtapiToken</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>name</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"name\": \"string\"\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">201: Token created</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>EtapiToken</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>etapiTokenId</code></td><td><code>string</code></td></tr><tr><td><code>name</code></td><td><code>string</code></td></tr><tr><td><code>token</code></td><td><code>string</code></td></tr><tr><td><code>dateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>isDeleted</code></td><td><code>boolean</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"etapiTokenId\": \"string\",\n \"name\": \"string\",\n \"token\": \"string\",\n \"dateCreated\": \"2019-08-24T14:15:22Z\",\n \"isDeleted\": true\n}</code></pre></div></div></div></section></div><h3>Delete ETAPI token</h3><p><code>DELETE /api/etapi-tokens/{etapiTokenId}</code> · <code>deleteEtapiToken</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>etapiTokenId</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: Token deleted</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Update ETAPI token</h3><p><code>PATCH /api/etapi-tokens/{etapiTokenId}</code> · <code>updateEtapiToken</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>etapiTokenId</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>name</code></td><td><code>string</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"name\": \"string\"\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Token updated</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>EtapiToken</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>etapiTokenId</code></td><td><code>string</code></td></tr><tr><td><code>name</code></td><td><code>string</code></td></tr><tr><td><code>token</code></td><td><code>string</code></td></tr><tr><td><code>dateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>isDeleted</code></td><td><code>boolean</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"etapiTokenId\": \"string\",\n \"name\": \"string\",\n \"token\": \"string\",\n \"dateCreated\": \"2019-08-24T14:15:22Z\",\n \"isDeleted\": true\n}</code></pre></div></div></div></section></div><h2>Special Notes</h2><p>Special note types (calendar, inbox)</p><h3>Get/create inbox note</h3><p><code>GET /api/special-notes/inbox/{date}</code> · <code>getInboxNote</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>date</code> <br><em>required</em></td><td><code>string (date)</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Inbox note</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>Note</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr><tr><td><code>title</code> <br><em>required</em></td><td><code>string</code> <br>Note title</td></tr><tr><td><code>type</code> <br><em>required</em></td><td><code>NoteType</code> <br>One of <code>text</code>, <code>code</code>, <code>render</code>, <code>file</code>, <code>image</code>, <code>search</code>, <code>relationMap</code>, <code>book</code>, <code>noteMap</code>, <code>mermaid</code>, <code>canvas</code>, <code>webView</code>, <code>launcher</code>, <code>doc</code>, <code>contentWidget</code>, <code>mindMap</code>, <code>geoMap</code>.</td></tr><tr><td><code>mime</code> <br><em>required</em></td><td><code>string</code> <br>MIME type</td></tr><tr><td><code>isProtected</code> <br><em>required</em></td><td><code>boolean</code> <br>Whether note is protected</td></tr><tr><td><code>blobId</code></td><td><code>string</code> <br>ID of content blob</td></tr><tr><td><code>dateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>dateModified</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateModified</code></td><td><code>string (date-time)</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"noteId\": \"ur11rSfHkzeV\",\n \"title\": \"string\",\n \"type\": \"text\",\n \"mime\": \"text/html\",\n \"isProtected\": true,\n \"blobId\": \"string\",\n \"dateCreated\": \"2019-08-24T14:15:22Z\",\n \"dateModified\": \"2019-08-24T14:15:22Z\",\n \"utcDateCreated\": \"2019-08-24T14:15:22Z\",\n \"utcDateModified\": \"2019-08-24T14:15:22Z\"\n}</code></pre></div></div></div></section></div><h3>Resolve where an inbox capture would go</h3><p><code>GET /api/special-notes/inbox-target</code> · <code>getInboxTarget</code></p><p>Reports the destination <code>/api/special-notes/inbox/{date}</code> would use, without creating anything. Honours the hoisted note, read from the <code>trilium-hoisted-note-id</code> header.</p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: The resolved destination</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>kind</code> <br><em>required</em></td><td><code>string</code> <br>Which rule decided the destination. <code>dayNote</code> names no note, because the day note is created when the capture happens. One of <code>inbox</code>, <code>workspaceInbox</code>, <code>workspaceRoot</code>, <code>dayNote</code>, <code>root</code>.</td></tr><tr><td><code>noteId</code></td><td><code>string</code> <br>Absent for <code>dayNote</code>.</td></tr><tr><td><code>title</code></td><td><code>string</code> <br>Absent for <code>dayNote</code>.</td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"kind\": \"inbox\",\n \"noteId\": \"string\",\n \"title\": \"string\"\n}</code></pre></div></div></div></section></div><h3>Get/create day note</h3><p><code>GET /api/special-notes/days/{date}</code> · <code>getDayNote</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>date</code> <br><em>required</em></td><td><code>string (date)</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Day note</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>Note</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr><tr><td><code>title</code> <br><em>required</em></td><td><code>string</code> <br>Note title</td></tr><tr><td><code>type</code> <br><em>required</em></td><td><code>NoteType</code> <br>One of <code>text</code>, <code>code</code>, <code>render</code>, <code>file</code>, <code>image</code>, <code>search</code>, <code>relationMap</code>, <code>book</code>, <code>noteMap</code>, <code>mermaid</code>, <code>canvas</code>, <code>webView</code>, <code>launcher</code>, <code>doc</code>, <code>contentWidget</code>, <code>mindMap</code>, <code>geoMap</code>.</td></tr><tr><td><code>mime</code> <br><em>required</em></td><td><code>string</code> <br>MIME type</td></tr><tr><td><code>isProtected</code> <br><em>required</em></td><td><code>boolean</code> <br>Whether note is protected</td></tr><tr><td><code>blobId</code></td><td><code>string</code> <br>ID of content blob</td></tr><tr><td><code>dateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>dateModified</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateModified</code></td><td><code>string (date-time)</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"noteId\": \"ur11rSfHkzeV\",\n \"title\": \"string\",\n \"type\": \"text\",\n \"mime\": \"text/html\",\n \"isProtected\": true,\n \"blobId\": \"string\",\n \"dateCreated\": \"2019-08-24T14:15:22Z\",\n \"dateModified\": \"2019-08-24T14:15:22Z\",\n \"utcDateCreated\": \"2019-08-24T14:15:22Z\",\n \"utcDateModified\": \"2019-08-24T14:15:22Z\"\n}</code></pre></div></div></div></section></div><h3>Get/create week note</h3><p><code>GET /api/special-notes/weeks/{week}</code> · <code>getWeekNote</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>week</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Week note</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>Note</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr><tr><td><code>title</code> <br><em>required</em></td><td><code>string</code> <br>Note title</td></tr><tr><td><code>type</code> <br><em>required</em></td><td><code>NoteType</code> <br>One of <code>text</code>, <code>code</code>, <code>render</code>, <code>file</code>, <code>image</code>, <code>search</code>, <code>relationMap</code>, <code>book</code>, <code>noteMap</code>, <code>mermaid</code>, <code>canvas</code>, <code>webView</code>, <code>launcher</code>, <code>doc</code>, <code>contentWidget</code>, <code>mindMap</code>, <code>geoMap</code>.</td></tr><tr><td><code>mime</code> <br><em>required</em></td><td><code>string</code> <br>MIME type</td></tr><tr><td><code>isProtected</code> <br><em>required</em></td><td><code>boolean</code> <br>Whether note is protected</td></tr><tr><td><code>blobId</code></td><td><code>string</code> <br>ID of content blob</td></tr><tr><td><code>dateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>dateModified</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateModified</code></td><td><code>string (date-time)</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"noteId\": \"ur11rSfHkzeV\",\n \"title\": \"string\",\n \"type\": \"text\",\n \"mime\": \"text/html\",\n \"isProtected\": true,\n \"blobId\": \"string\",\n \"dateCreated\": \"2019-08-24T14:15:22Z\",\n \"dateModified\": \"2019-08-24T14:15:22Z\",\n \"utcDateCreated\": \"2019-08-24T14:15:22Z\",\n \"utcDateModified\": \"2019-08-24T14:15:22Z\"\n}</code></pre></div></div></div></section></div><h3>Get/create month note</h3><p><code>GET /api/special-notes/months/{month}</code> · <code>getMonthNote</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>month</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Month note</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>Note</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr><tr><td><code>title</code> <br><em>required</em></td><td><code>string</code> <br>Note title</td></tr><tr><td><code>type</code> <br><em>required</em></td><td><code>NoteType</code> <br>One of <code>text</code>, <code>code</code>, <code>render</code>, <code>file</code>, <code>image</code>, <code>search</code>, <code>relationMap</code>, <code>book</code>, <code>noteMap</code>, <code>mermaid</code>, <code>canvas</code>, <code>webView</code>, <code>launcher</code>, <code>doc</code>, <code>contentWidget</code>, <code>mindMap</code>, <code>geoMap</code>.</td></tr><tr><td><code>mime</code> <br><em>required</em></td><td><code>string</code> <br>MIME type</td></tr><tr><td><code>isProtected</code> <br><em>required</em></td><td><code>boolean</code> <br>Whether note is protected</td></tr><tr><td><code>blobId</code></td><td><code>string</code> <br>ID of content blob</td></tr><tr><td><code>dateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>dateModified</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateModified</code></td><td><code>string (date-time)</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"noteId\": \"ur11rSfHkzeV\",\n \"title\": \"string\",\n \"type\": \"text\",\n \"mime\": \"text/html\",\n \"isProtected\": true,\n \"blobId\": \"string\",\n \"dateCreated\": \"2019-08-24T14:15:22Z\",\n \"dateModified\": \"2019-08-24T14:15:22Z\",\n \"utcDateCreated\": \"2019-08-24T14:15:22Z\",\n \"utcDateModified\": \"2019-08-24T14:15:22Z\"\n}</code></pre></div></div></div></section></div><h3>Get/create year note</h3><p><code>GET /api/special-notes/years/{year}</code> · <code>getYearNote</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>year</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Year note</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>Note</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr><tr><td><code>title</code> <br><em>required</em></td><td><code>string</code> <br>Note title</td></tr><tr><td><code>type</code> <br><em>required</em></td><td><code>NoteType</code> <br>One of <code>text</code>, <code>code</code>, <code>render</code>, <code>file</code>, <code>image</code>, <code>search</code>, <code>relationMap</code>, <code>book</code>, <code>noteMap</code>, <code>mermaid</code>, <code>canvas</code>, <code>webView</code>, <code>launcher</code>, <code>doc</code>, <code>contentWidget</code>, <code>mindMap</code>, <code>geoMap</code>.</td></tr><tr><td><code>mime</code> <br><em>required</em></td><td><code>string</code> <br>MIME type</td></tr><tr><td><code>isProtected</code> <br><em>required</em></td><td><code>boolean</code> <br>Whether note is protected</td></tr><tr><td><code>blobId</code></td><td><code>string</code> <br>ID of content blob</td></tr><tr><td><code>dateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>dateModified</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateModified</code></td><td><code>string (date-time)</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"noteId\": \"ur11rSfHkzeV\",\n \"title\": \"string\",\n \"type\": \"text\",\n \"mime\": \"text/html\",\n \"isProtected\": true,\n \"blobId\": \"string\",\n \"dateCreated\": \"2019-08-24T14:15:22Z\",\n \"dateModified\": \"2019-08-24T14:15:22Z\",\n \"utcDateCreated\": \"2019-08-24T14:15:22Z\",\n \"utcDateModified\": \"2019-08-24T14:15:22Z\"\n}</code></pre></div></div></div></section></div><h3>Create SQL console note</h3><p><code>POST /api/special-notes/sql-console</code> · <code>createSqlConsole</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">201: SQL console created</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>Note</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr><tr><td><code>title</code> <br><em>required</em></td><td><code>string</code> <br>Note title</td></tr><tr><td><code>type</code> <br><em>required</em></td><td><code>NoteType</code> <br>One of <code>text</code>, <code>code</code>, <code>render</code>, <code>file</code>, <code>image</code>, <code>search</code>, <code>relationMap</code>, <code>book</code>, <code>noteMap</code>, <code>mermaid</code>, <code>canvas</code>, <code>webView</code>, <code>launcher</code>, <code>doc</code>, <code>contentWidget</code>, <code>mindMap</code>, <code>geoMap</code>.</td></tr><tr><td><code>mime</code> <br><em>required</em></td><td><code>string</code> <br>MIME type</td></tr><tr><td><code>isProtected</code> <br><em>required</em></td><td><code>boolean</code> <br>Whether note is protected</td></tr><tr><td><code>blobId</code></td><td><code>string</code> <br>ID of content blob</td></tr><tr><td><code>dateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>dateModified</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateModified</code></td><td><code>string (date-time)</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"noteId\": \"ur11rSfHkzeV\",\n \"title\": \"string\",\n \"type\": \"text\",\n \"mime\": \"text/html\",\n \"isProtected\": true,\n \"blobId\": \"string\",\n \"dateCreated\": \"2019-08-24T14:15:22Z\",\n \"dateModified\": \"2019-08-24T14:15:22Z\",\n \"utcDateCreated\": \"2019-08-24T14:15:22Z\",\n \"utcDateModified\": \"2019-08-24T14:15:22Z\"\n}</code></pre></div></div></div></section></div><h3>Create search note</h3><p><code>POST /api/special-notes/search-note</code> · <code>createSearchNote</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">201: Search note created</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>Note</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr><tr><td><code>title</code> <br><em>required</em></td><td><code>string</code> <br>Note title</td></tr><tr><td><code>type</code> <br><em>required</em></td><td><code>NoteType</code> <br>One of <code>text</code>, <code>code</code>, <code>render</code>, <code>file</code>, <code>image</code>, <code>search</code>, <code>relationMap</code>, <code>book</code>, <code>noteMap</code>, <code>mermaid</code>, <code>canvas</code>, <code>webView</code>, <code>launcher</code>, <code>doc</code>, <code>contentWidget</code>, <code>mindMap</code>, <code>geoMap</code>.</td></tr><tr><td><code>mime</code> <br><em>required</em></td><td><code>string</code> <br>MIME type</td></tr><tr><td><code>isProtected</code> <br><em>required</em></td><td><code>boolean</code> <br>Whether note is protected</td></tr><tr><td><code>blobId</code></td><td><code>string</code> <br>ID of content blob</td></tr><tr><td><code>dateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>dateModified</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateModified</code></td><td><code>string (date-time)</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"noteId\": \"ur11rSfHkzeV\",\n \"title\": \"string\",\n \"type\": \"text\",\n \"mime\": \"text/html\",\n \"isProtected\": true,\n \"blobId\": \"string\",\n \"dateCreated\": \"2019-08-24T14:15:22Z\",\n \"dateModified\": \"2019-08-24T14:15:22Z\",\n \"utcDateCreated\": \"2019-08-24T14:15:22Z\",\n \"utcDateModified\": \"2019-08-24T14:15:22Z\"\n}</code></pre></div></div></div></section></div><h3>Create launcher</h3><p><code>POST /api/special-notes/launchers/{parentNoteId}/{launcherType}</code> · <code>createLauncher</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>parentNoteId</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>launcherType</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">201: Launcher created</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>Note</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr><tr><td><code>title</code> <br><em>required</em></td><td><code>string</code> <br>Note title</td></tr><tr><td><code>type</code> <br><em>required</em></td><td><code>NoteType</code> <br>One of <code>text</code>, <code>code</code>, <code>render</code>, <code>file</code>, <code>image</code>, <code>search</code>, <code>relationMap</code>, <code>book</code>, <code>noteMap</code>, <code>mermaid</code>, <code>canvas</code>, <code>webView</code>, <code>launcher</code>, <code>doc</code>, <code>contentWidget</code>, <code>mindMap</code>, <code>geoMap</code>.</td></tr><tr><td><code>mime</code> <br><em>required</em></td><td><code>string</code> <br>MIME type</td></tr><tr><td><code>isProtected</code> <br><em>required</em></td><td><code>boolean</code> <br>Whether note is protected</td></tr><tr><td><code>blobId</code></td><td><code>string</code> <br>ID of content blob</td></tr><tr><td><code>dateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>dateModified</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateModified</code></td><td><code>string (date-time)</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"noteId\": \"ur11rSfHkzeV\",\n \"title\": \"string\",\n \"type\": \"text\",\n \"mime\": \"text/html\",\n \"isProtected\": true,\n \"blobId\": \"string\",\n \"dateCreated\": \"2019-08-24T14:15:22Z\",\n \"dateModified\": \"2019-08-24T14:15:22Z\",\n \"utcDateCreated\": \"2019-08-24T14:15:22Z\",\n \"utcDateModified\": \"2019-08-24T14:15:22Z\"\n}</code></pre></div></div></div></section></div><h3>Get notes for specific month</h3><p><code>GET /api/special-notes/notes-for-month/{month}</code> · <code>getNotesForMonth</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>month</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Notes for the month</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>array of Note</code></li></ul><pre><code class=\"language-application-json\">[\n {\n \"noteId\": \"ur11rSfHkzeV\",\n \"title\": \"string\",\n \"type\": \"text\",\n \"mime\": \"text/html\",\n \"isProtected\": true,\n \"blobId\": \"string\",\n \"dateCreated\": \"2019-08-24T14:15:22Z\",\n \"dateModified\": \"2019-08-24T14:15:22Z\",\n \"utcDateCreated\": \"2019-08-24T14:15:22Z\",\n \"utcDateModified\": \"2019-08-24T14:15:22Z\"\n }\n]</code></pre></div></section></div><h3>Get quarter note</h3><p><code>GET /api/special-notes/quarters/{quarter}</code> · <code>getQuarter</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>quarter</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Quarter note</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>Note</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr><tr><td><code>title</code> <br><em>required</em></td><td><code>string</code> <br>Note title</td></tr><tr><td><code>type</code> <br><em>required</em></td><td><code>NoteType</code> <br>One of <code>text</code>, <code>code</code>, <code>render</code>, <code>file</code>, <code>image</code>, <code>search</code>, <code>relationMap</code>, <code>book</code>, <code>noteMap</code>, <code>mermaid</code>, <code>canvas</code>, <code>webView</code>, <code>launcher</code>, <code>doc</code>, <code>contentWidget</code>, <code>mindMap</code>, <code>geoMap</code>.</td></tr><tr><td><code>mime</code> <br><em>required</em></td><td><code>string</code> <br>MIME type</td></tr><tr><td><code>isProtected</code> <br><em>required</em></td><td><code>boolean</code> <br>Whether note is protected</td></tr><tr><td><code>blobId</code></td><td><code>string</code> <br>ID of content blob</td></tr><tr><td><code>dateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>dateModified</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateModified</code></td><td><code>string (date-time)</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"noteId\": \"ur11rSfHkzeV\",\n \"title\": \"string\",\n \"type\": \"text\",\n \"mime\": \"text/html\",\n \"isProtected\": true,\n \"blobId\": \"string\",\n \"dateCreated\": \"2019-08-24T14:15:22Z\",\n \"dateModified\": \"2019-08-24T14:15:22Z\",\n \"utcDateCreated\": \"2019-08-24T14:15:22Z\",\n \"utcDateModified\": \"2019-08-24T14:15:22Z\"\n}</code></pre></div></div></div></section></div><h3>Get first day of week for date</h3><p><code>GET /api/special-notes/week-first-day/{date}</code> · <code>getWeekFirstDay</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>date</code> <br><em>required</em></td><td><code>string (date)</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: First day of week</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>date</code></td><td><code>string (date)</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"date\": \"2019-08-24\"\n}</code></pre></div></div></div></section></div><h3>Reset launcher note</h3><p><code>POST /api/special-notes/launchers/{noteId}/reset</code> · <code>resetLauncher</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Launcher reset</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>Note</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr><tr><td><code>title</code> <br><em>required</em></td><td><code>string</code> <br>Note title</td></tr><tr><td><code>type</code> <br><em>required</em></td><td><code>NoteType</code> <br>One of <code>text</code>, <code>code</code>, <code>render</code>, <code>file</code>, <code>image</code>, <code>search</code>, <code>relationMap</code>, <code>book</code>, <code>noteMap</code>, <code>mermaid</code>, <code>canvas</code>, <code>webView</code>, <code>launcher</code>, <code>doc</code>, <code>contentWidget</code>, <code>mindMap</code>, <code>geoMap</code>.</td></tr><tr><td><code>mime</code> <br><em>required</em></td><td><code>string</code> <br>MIME type</td></tr><tr><td><code>isProtected</code> <br><em>required</em></td><td><code>boolean</code> <br>Whether note is protected</td></tr><tr><td><code>blobId</code></td><td><code>string</code> <br>ID of content blob</td></tr><tr><td><code>dateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>dateModified</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateModified</code></td><td><code>string (date-time)</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"noteId\": \"ur11rSfHkzeV\",\n \"title\": \"string\",\n \"type\": \"text\",\n \"mime\": \"text/html\",\n \"isProtected\": true,\n \"blobId\": \"string\",\n \"dateCreated\": \"2019-08-24T14:15:22Z\",\n \"dateModified\": \"2019-08-24T14:15:22Z\",\n \"utcDateCreated\": \"2019-08-24T14:15:22Z\",\n \"utcDateModified\": \"2019-08-24T14:15:22Z\"\n}</code></pre></div></div></div></section></div><h3>Save search note</h3><p><code>POST /api/special-notes/save-search-note</code> · <code>saveSearchNote</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>query</code></td><td><code>string</code></td></tr><tr><td><code>title</code></td><td><code>string</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"query\": \"string\",\n \"title\": \"string\"\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">201: Search note saved</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>Note</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr><tr><td><code>title</code> <br><em>required</em></td><td><code>string</code> <br>Note title</td></tr><tr><td><code>type</code> <br><em>required</em></td><td><code>NoteType</code> <br>One of <code>text</code>, <code>code</code>, <code>render</code>, <code>file</code>, <code>image</code>, <code>search</code>, <code>relationMap</code>, <code>book</code>, <code>noteMap</code>, <code>mermaid</code>, <code>canvas</code>, <code>webView</code>, <code>launcher</code>, <code>doc</code>, <code>contentWidget</code>, <code>mindMap</code>, <code>geoMap</code>.</td></tr><tr><td><code>mime</code> <br><em>required</em></td><td><code>string</code> <br>MIME type</td></tr><tr><td><code>isProtected</code> <br><em>required</em></td><td><code>boolean</code> <br>Whether note is protected</td></tr><tr><td><code>blobId</code></td><td><code>string</code> <br>ID of content blob</td></tr><tr><td><code>dateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>dateModified</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateModified</code></td><td><code>string (date-time)</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"noteId\": \"ur11rSfHkzeV\",\n \"title\": \"string\",\n \"type\": \"text\",\n \"mime\": \"text/html\",\n \"isProtected\": true,\n \"blobId\": \"string\",\n \"dateCreated\": \"2019-08-24T14:15:22Z\",\n \"dateModified\": \"2019-08-24T14:15:22Z\",\n \"utcDateCreated\": \"2019-08-24T14:15:22Z\",\n \"utcDateModified\": \"2019-08-24T14:15:22Z\"\n}</code></pre></div></div></div></section></div><h3>Save SQL console note</h3><p><code>POST /api/special-notes/save-sql-console</code> · <code>saveSqlConsole</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>sql</code></td><td><code>string</code></td></tr><tr><td><code>title</code></td><td><code>string</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"sql\": \"string\",\n \"title\": \"string\"\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">201: SQL console saved</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>Note</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr><tr><td><code>title</code> <br><em>required</em></td><td><code>string</code> <br>Note title</td></tr><tr><td><code>type</code> <br><em>required</em></td><td><code>NoteType</code> <br>One of <code>text</code>, <code>code</code>, <code>render</code>, <code>file</code>, <code>image</code>, <code>search</code>, <code>relationMap</code>, <code>book</code>, <code>noteMap</code>, <code>mermaid</code>, <code>canvas</code>, <code>webView</code>, <code>launcher</code>, <code>doc</code>, <code>contentWidget</code>, <code>mindMap</code>, <code>geoMap</code>.</td></tr><tr><td><code>mime</code> <br><em>required</em></td><td><code>string</code> <br>MIME type</td></tr><tr><td><code>isProtected</code> <br><em>required</em></td><td><code>boolean</code> <br>Whether note is protected</td></tr><tr><td><code>blobId</code></td><td><code>string</code> <br>ID of content blob</td></tr><tr><td><code>dateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>dateModified</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateModified</code></td><td><code>string (date-time)</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"noteId\": \"ur11rSfHkzeV\",\n \"title\": \"string\",\n \"type\": \"text\",\n \"mime\": \"text/html\",\n \"isProtected\": true,\n \"blobId\": \"string\",\n \"dateCreated\": \"2019-08-24T14:15:22Z\",\n \"dateModified\": \"2019-08-24T14:15:22Z\",\n \"utcDateCreated\": \"2019-08-24T14:15:22Z\",\n \"utcDateModified\": \"2019-08-24T14:15:22Z\"\n}</code></pre></div></div></div></section></div><h3>Update API script launcher</h3><p><code>PUT /api/special-notes/api-script-launcher</code> · <code>updateApiScriptLauncher</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>code</code></td><td><code>string</code> <br>Script code</td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"code\": \"string\"\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: API script launcher updated</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>Note</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr><tr><td><code>title</code> <br><em>required</em></td><td><code>string</code> <br>Note title</td></tr><tr><td><code>type</code> <br><em>required</em></td><td><code>NoteType</code> <br>One of <code>text</code>, <code>code</code>, <code>render</code>, <code>file</code>, <code>image</code>, <code>search</code>, <code>relationMap</code>, <code>book</code>, <code>noteMap</code>, <code>mermaid</code>, <code>canvas</code>, <code>webView</code>, <code>launcher</code>, <code>doc</code>, <code>contentWidget</code>, <code>mindMap</code>, <code>geoMap</code>.</td></tr><tr><td><code>mime</code> <br><em>required</em></td><td><code>string</code> <br>MIME type</td></tr><tr><td><code>isProtected</code> <br><em>required</em></td><td><code>boolean</code> <br>Whether note is protected</td></tr><tr><td><code>blobId</code></td><td><code>string</code> <br>ID of content blob</td></tr><tr><td><code>dateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>dateModified</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateModified</code></td><td><code>string (date-time)</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"noteId\": \"ur11rSfHkzeV\",\n \"title\": \"string\",\n \"type\": \"text\",\n \"mime\": \"text/html\",\n \"isProtected\": true,\n \"blobId\": \"string\",\n \"dateCreated\": \"2019-08-24T14:15:22Z\",\n \"dateModified\": \"2019-08-24T14:15:22Z\",\n \"utcDateCreated\": \"2019-08-24T14:15:22Z\",\n \"utcDateModified\": \"2019-08-24T14:15:22Z\"\n}</code></pre></div></div></div></section></div><h2>Visualization</h2><p>Maps and visualizations</p><h3>Get tree map</h3><p><code>POST /api/note-map/{noteId}/tree</code> · <code>getTreeMap</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Tree map data</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><pre><code class=\"language-application-json\">{}</code></pre></div></section></div><h3>Get link map</h3><p><code>POST /api/note-map/{noteId}/link</code> · <code>getLinkMap</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Link map data</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><pre><code class=\"language-application-json\">{}</code></pre></div></section></div><h3>Get backlinks</h3><p><code>GET /api/note-map/{noteId}/backlinks</code> · <code>getBacklinks</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Backlinks</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>array of object</code></li></ul><pre><code class=\"language-application-json\">[\n {\n \"noteId\": \"string\",\n \"title\": \"string\"\n }\n]</code></pre></div></section></div><h3>Get backlink count for note</h3><p><code>GET /api/note-map/{noteId}/backlink-count</code> · <code>getBacklinkCount</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Backlink count</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>count</code></td><td><code>integer</code> <br>Number of backlinks to this note</td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"count\": 0\n}</code></pre></div></div></div></section></div><h3>Get relation map data</h3><p><code>POST /api/relation-map</code> · <code>getRelationMap</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code></td><td><code>string</code></td></tr><tr><td><code>maxDepth</code></td><td><code>integer</code></td></tr><tr><td><code>excludeArchived</code></td><td><code>boolean</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"noteId\": \"string\",\n \"maxDepth\": 0,\n \"excludeArchived\": true\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Relation map data</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><pre><code class=\"language-application-json\">{}</code></pre></div></section></div><h2>External</h2><p>External integrations (clipper, sender)</p><h3>Clipper handshake</h3><p><code>GET /api/clipper/handshake</code> · <code>clipperHandshake</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Handshake successful</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>protocolVersion</code></td><td><code>string</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"protocolVersion\": \"string\"\n}</code></pre></div></div></div></section></div><h3>Add web clipping</h3><p><code>POST /api/clipper/clippings</code> · <code>addClipping</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>title</code></td><td><code>string</code></td></tr><tr><td><code>content</code></td><td><code>string</code></td></tr><tr><td><code>url</code></td><td><code>string</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"title\": \"string\",\n \"content\": \"string\",\n \"url\": \"string\"\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">201: Clipping created</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>Note</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr><tr><td><code>title</code> <br><em>required</em></td><td><code>string</code> <br>Note title</td></tr><tr><td><code>type</code> <br><em>required</em></td><td><code>NoteType</code> <br>One of <code>text</code>, <code>code</code>, <code>render</code>, <code>file</code>, <code>image</code>, <code>search</code>, <code>relationMap</code>, <code>book</code>, <code>noteMap</code>, <code>mermaid</code>, <code>canvas</code>, <code>webView</code>, <code>launcher</code>, <code>doc</code>, <code>contentWidget</code>, <code>mindMap</code>, <code>geoMap</code>.</td></tr><tr><td><code>mime</code> <br><em>required</em></td><td><code>string</code> <br>MIME type</td></tr><tr><td><code>isProtected</code> <br><em>required</em></td><td><code>boolean</code> <br>Whether note is protected</td></tr><tr><td><code>blobId</code></td><td><code>string</code> <br>ID of content blob</td></tr><tr><td><code>dateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>dateModified</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateModified</code></td><td><code>string (date-time)</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"noteId\": \"ur11rSfHkzeV\",\n \"title\": \"string\",\n \"type\": \"text\",\n \"mime\": \"text/html\",\n \"isProtected\": true,\n \"blobId\": \"string\",\n \"dateCreated\": \"2019-08-24T14:15:22Z\",\n \"dateModified\": \"2019-08-24T14:15:22Z\",\n \"utcDateCreated\": \"2019-08-24T14:15:22Z\",\n \"utcDateModified\": \"2019-08-24T14:15:22Z\"\n}</code></pre></div></div></div></section></div><h3>Create clipper note</h3><p><code>POST /api/clipper/notes</code> · <code>createClipperNote</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>title</code></td><td><code>string</code></td></tr><tr><td><code>content</code></td><td><code>string</code></td></tr><tr><td><code>parentNoteId</code></td><td><code>string</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"title\": \"string\",\n \"content\": \"string\",\n \"parentNoteId\": \"string\"\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">201: Note created</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>Note</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr><tr><td><code>title</code> <br><em>required</em></td><td><code>string</code> <br>Note title</td></tr><tr><td><code>type</code> <br><em>required</em></td><td><code>NoteType</code> <br>One of <code>text</code>, <code>code</code>, <code>render</code>, <code>file</code>, <code>image</code>, <code>search</code>, <code>relationMap</code>, <code>book</code>, <code>noteMap</code>, <code>mermaid</code>, <code>canvas</code>, <code>webView</code>, <code>launcher</code>, <code>doc</code>, <code>contentWidget</code>, <code>mindMap</code>, <code>geoMap</code>.</td></tr><tr><td><code>mime</code> <br><em>required</em></td><td><code>string</code> <br>MIME type</td></tr><tr><td><code>isProtected</code> <br><em>required</em></td><td><code>boolean</code> <br>Whether note is protected</td></tr><tr><td><code>blobId</code></td><td><code>string</code> <br>ID of content blob</td></tr><tr><td><code>dateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>dateModified</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateModified</code></td><td><code>string (date-time)</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"noteId\": \"ur11rSfHkzeV\",\n \"title\": \"string\",\n \"type\": \"text\",\n \"mime\": \"text/html\",\n \"isProtected\": true,\n \"blobId\": \"string\",\n \"dateCreated\": \"2019-08-24T14:15:22Z\",\n \"dateModified\": \"2019-08-24T14:15:22Z\",\n \"utcDateCreated\": \"2019-08-24T14:15:22Z\",\n \"utcDateModified\": \"2019-08-24T14:15:22Z\"\n}</code></pre></div></div></div></section></div><h3>Open note in clipper</h3><p><code>POST /api/clipper/open/{noteId}</code> · <code>openNoteInClipper</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Note opened in clipper</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>success</code></td><td><code>boolean</code></td></tr><tr><td><code>url</code></td><td><code>string</code> <br>URL to open in clipper</td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"success\": true,\n \"url\": \"string\"\n}</code></pre></div></div></div></section></div><h3>Sender login</h3><p><code>POST /api/sender/login</code> · <code>senderLogin</code></p><p><strong>Authorization</strong>: none</p><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>username</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>password</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"username\": \"string\",\n \"password\": \"string\"\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Login successful</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>token</code></td><td><code>string</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"token\": \"string\"\n}</code></pre></div></div></div></section></div><h3>Upload image from sender</h3><p><code>POST /api/sender/image</code> · <code>uploadSenderImage</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Request body</strong> (required)</p><ul><li><code>multipart/form-data</code>: <code>object</code></li></ul><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>upload</code></td><td><code>string (binary)</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">201: Image uploaded</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>Note</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr><tr><td><code>title</code> <br><em>required</em></td><td><code>string</code> <br>Note title</td></tr><tr><td><code>type</code> <br><em>required</em></td><td><code>NoteType</code> <br>One of <code>text</code>, <code>code</code>, <code>render</code>, <code>file</code>, <code>image</code>, <code>search</code>, <code>relationMap</code>, <code>book</code>, <code>noteMap</code>, <code>mermaid</code>, <code>canvas</code>, <code>webView</code>, <code>launcher</code>, <code>doc</code>, <code>contentWidget</code>, <code>mindMap</code>, <code>geoMap</code>.</td></tr><tr><td><code>mime</code> <br><em>required</em></td><td><code>string</code> <br>MIME type</td></tr><tr><td><code>isProtected</code> <br><em>required</em></td><td><code>boolean</code> <br>Whether note is protected</td></tr><tr><td><code>blobId</code></td><td><code>string</code> <br>ID of content blob</td></tr><tr><td><code>dateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>dateModified</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateModified</code></td><td><code>string (date-time)</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"noteId\": \"ur11rSfHkzeV\",\n \"title\": \"string\",\n \"type\": \"text\",\n \"mime\": \"text/html\",\n \"isProtected\": true,\n \"blobId\": \"string\",\n \"dateCreated\": \"2019-08-24T14:15:22Z\",\n \"dateModified\": \"2019-08-24T14:15:22Z\",\n \"utcDateCreated\": \"2019-08-24T14:15:22Z\",\n \"utcDateModified\": \"2019-08-24T14:15:22Z\"\n}</code></pre></div></div></div></section></div><h3>Save note from sender</h3><p><code>POST /api/sender/note</code> · <code>saveSenderNote</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>title</code></td><td><code>string</code></td></tr><tr><td><code>content</code></td><td><code>string</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"title\": \"string\",\n \"content\": \"string\"\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">201: Note saved</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>Note</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr><tr><td><code>title</code> <br><em>required</em></td><td><code>string</code> <br>Note title</td></tr><tr><td><code>type</code> <br><em>required</em></td><td><code>NoteType</code> <br>One of <code>text</code>, <code>code</code>, <code>render</code>, <code>file</code>, <code>image</code>, <code>search</code>, <code>relationMap</code>, <code>book</code>, <code>noteMap</code>, <code>mermaid</code>, <code>canvas</code>, <code>webView</code>, <code>launcher</code>, <code>doc</code>, <code>contentWidget</code>, <code>mindMap</code>, <code>geoMap</code>.</td></tr><tr><td><code>mime</code> <br><em>required</em></td><td><code>string</code> <br>MIME type</td></tr><tr><td><code>isProtected</code> <br><em>required</em></td><td><code>boolean</code> <br>Whether note is protected</td></tr><tr><td><code>blobId</code></td><td><code>string</code> <br>ID of content blob</td></tr><tr><td><code>dateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>dateModified</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateModified</code></td><td><code>string (date-time)</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"noteId\": \"ur11rSfHkzeV\",\n \"title\": \"string\",\n \"type\": \"text\",\n \"mime\": \"text/html\",\n \"isProtected\": true,\n \"blobId\": \"string\",\n \"dateCreated\": \"2019-08-24T14:15:22Z\",\n \"dateModified\": \"2019-08-24T14:15:22Z\",\n \"utcDateCreated\": \"2019-08-24T14:15:22Z\",\n \"utcDateModified\": \"2019-08-24T14:15:22Z\"\n}</code></pre></div></div></div></section></div><h2>Utilities</h2><p>Miscellaneous utilities</p><h3>Get system metrics</h3><p><code>GET /api/metrics</code> · <code>getMetrics</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Query parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>format</code></td><td><code>string</code> <br>One of <code>prometheus</code>, <code>json</code>.</td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: System metrics</p><div class=\"trilium-tab-panel\"><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\"><code>application/json</code>: <code>object</code></p><div class=\"trilium-tab-panel\"><pre><code class=\"language-application-json\">{}</code></pre></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\"><code>text/plain</code>: <code>string</code></p><div class=\"trilium-tab-panel\"><p> </p></div></section></div></div></section></div><h3>Run system diagnostics</h3><p><code>GET /api/system-checks</code> · <code>runSystemChecks</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: System check results</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>array of object</code></li></ul><pre><code class=\"language-application-json\">[\n {\n \"name\": \"string\",\n \"status\": \"pass\",\n \"message\": \"string\"\n }\n]</code></pre></div></section></div><h3>Health check endpoint</h3><p><code>GET /api/health-check</code> · <code>healthCheck</code></p><p><strong>Authorization</strong>: none</p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Service is healthy</p><div class=\"trilium-tab-panel\"><ul><li><code>text/plain</code>: <code>string</code></li></ul></div></section></div><h3>Get backend log</h3><p><code>GET /api/backend-log</code> · <code>getBackendLog</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Backend log entries</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>array of object</code></li></ul><pre><code class=\"language-application-json\">[\n {\n \"timestamp\": \"2019-08-24T14:15:22Z\",\n \"level\": \"string\",\n \"message\": \"string\"\n }\n]</code></pre></div></section></div><h3>Get note size</h3><p><code>GET /api/stats/note-size/{noteId}</code> · <code>getNoteSize</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Note size</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>size</code></td><td><code>integer</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"size\": 0\n}</code></pre></div></div></div></section></div><h3>Get subtree size</h3><p><code>GET /api/stats/subtree-size/{noteId}</code> · <code>getSubtreeSize</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Subtree size</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>size</code></td><td><code>integer</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"size\": 0\n}</code></pre></div></div></div></section></div><h3>Get keyboard actions</h3><p><code>GET /api/keyboard-actions</code> · <code>getKeyboardActions</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Keyboard actions</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>array of object</code></li></ul><pre><code class=\"language-application-json\">[\n {\n \"actionName\": \"string\",\n \"shortcut\": \"string\",\n \"description\": \"string\"\n }\n]</code></pre></div></section></div><h3>Get keyboard shortcuts for notes</h3><p><code>GET /api/keyboard-shortcuts-for-notes</code> · <code>getKeyboardShortcutsForNotes</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Keyboard shortcuts for notes</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>array of object</code></li></ul><pre><code class=\"language-application-json\">[\n {\n \"noteId\": \"string\",\n \"shortcut\": \"string\",\n \"title\": \"string\"\n }\n]</code></pre></div></section></div><h3>Get font CSS</h3><p><code>GET /api/fonts</code> · <code>getFonts</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Font CSS</p><div class=\"trilium-tab-panel\"><ul><li><code>text/css</code>: <code>string</code></li></ul></div></section></div><h3>Add recent note</h3><p><code>POST /api/recent-notes</code> · <code>addRecentNote</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"noteId\": \"string\"\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: Note added to recent</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Get recent changes</h3><p><code>GET /api/recent-changes/{ancestorNoteId}</code> · <code>getRecentChanges</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Path parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>ancestorNoteId</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Recent changes</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>array of object</code></li></ul><pre><code class=\"language-application-json\">[\n {\n \"noteId\": \"string\",\n \"title\": \"string\",\n \"dateModified\": \"2019-08-24T14:15:22Z\"\n }\n]</code></pre></div></section></div><h3>Get icon usage statistics</h3><p><code>GET /api/other/icon-usage</code> · <code>getIconUsage</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Icon usage stats</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json</code>: <code>object</code></li></ul><pre><code class=\"language-application-json\">{}</code></pre></div></section></div><h3>Render markdown to HTML</h3><p><code>POST /api/other/render-markdown</code> · <code>renderMarkdown</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>markdownContent</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"markdownContent\": \"string\"\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: Rendered HTML</p><div class=\"trilium-tab-panel\"><ul><li><code>text/html</code>: <code>string</code></li></ul></div></section></div><h3>Renders given HTML to Markdown</h3><p><code>POST /api/other/to-markdown</code> · <code>toMarkdown</code></p><p><strong>Authorization</strong>: <code>sessionAuth</code> or <code>tokenAuth</code></p><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>htmlContent</code> <br><em>required</em></td><td><code>string</code></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"htmlContent\": \"string\"\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: The input text rendered as Markdown</p><div class=\"trilium-tab-panel\"><ul><li><code>text/plain</code>: <code>string</code></li></ul></div></section></div><h2>Schemas</h2><h3><code>Note</code></h3><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code> <br>12-character note ID</td></tr><tr><td><code>title</code> <br><em>required</em></td><td><code>string</code> <br>Note title</td></tr><tr><td><code>type</code> <br><em>required</em></td><td><code>NoteType</code> <br>One of <code>text</code>, <code>code</code>, <code>render</code>, <code>file</code>, <code>image</code>, <code>search</code>, <code>relationMap</code>, <code>book</code>, <code>noteMap</code>, <code>mermaid</code>, <code>canvas</code>, <code>webView</code>, <code>launcher</code>, <code>doc</code>, <code>contentWidget</code>, <code>mindMap</code>, <code>geoMap</code>.</td></tr><tr><td><code>mime</code> <br><em>required</em></td><td><code>string</code> <br>MIME type</td></tr><tr><td><code>isProtected</code> <br><em>required</em></td><td><code>boolean</code> <br>Whether note is protected</td></tr><tr><td><code>blobId</code></td><td><code>string</code> <br>ID of content blob</td></tr><tr><td><code>dateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>dateModified</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateModified</code></td><td><code>string (date-time)</code></td></tr></tbody></table></figure><h3><code>NoteType</code></h3><p>Type: <code>string</code></p><h3><code>Branch</code></h3><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>branchId</code> <br><em>required</em></td><td><code>string</code> <br>Branch ID (parentNoteId_noteId)</td></tr><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>parentNoteId</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>notePosition</code> <br><em>required</em></td><td><code>integer</code></td></tr><tr><td><code>prefix</code></td><td><code>string | null</code></td></tr><tr><td><code>isExpanded</code></td><td><code>boolean</code></td></tr></tbody></table></figure><h3><code>Attribute</code></h3><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>attributeId</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>noteId</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>type</code> <br><em>required</em></td><td><code>string</code> <br>One of <code>label</code>, <code>relation</code>.</td></tr><tr><td><code>name</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>value</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>position</code></td><td><code>integer</code></td></tr><tr><td><code>isInheritable</code></td><td><code>boolean</code></td></tr></tbody></table></figure><h3><code>Attachment</code></h3><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>attachmentId</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>ownerId</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>role</code> <br><em>required</em></td><td><code>string</code> <br>One of <code>image</code>, <code>file</code>.</td></tr><tr><td><code>mime</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>title</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>blobId</code></td><td><code>string</code></td></tr><tr><td><code>dateModified</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateModified</code></td><td><code>string (date-time)</code></td></tr></tbody></table></figure><h3><code>Revision</code></h3><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>revisionId</code></td><td><code>string</code></td></tr><tr><td><code>noteId</code></td><td><code>string</code></td></tr><tr><td><code>title</code></td><td><code>string</code></td></tr><tr><td><code>type</code></td><td><code>NoteType</code> <br>One of <code>text</code>, <code>code</code>, <code>render</code>, <code>file</code>, <code>image</code>, <code>search</code>, <code>relationMap</code>, <code>book</code>, <code>noteMap</code>, <code>mermaid</code>, <code>canvas</code>, <code>webView</code>, <code>launcher</code>, <code>doc</code>, <code>contentWidget</code>, <code>mindMap</code>, <code>geoMap</code>.</td></tr><tr><td><code>mime</code></td><td><code>string</code></td></tr><tr><td><code>dateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateCreated</code></td><td><code>string (date-time)</code></td></tr></tbody></table></figure><h3><code>SearchResult</code></h3><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code></td><td><code>string</code></td></tr><tr><td><code>title</code></td><td><code>string</code></td></tr><tr><td><code>path</code></td><td><code>string</code></td></tr><tr><td><code>score</code></td><td><code>number</code></td></tr><tr><td><code>highlights</code></td><td><code>array of string</code></td></tr></tbody></table></figure><h3><code>EntityChange</code></h3><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>entityChange</code></td><td><code>object</code></td></tr><tr><td><code>entity</code></td><td><code>object</code></td></tr></tbody></table></figure><h3><code>Timestamps</code></h3><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>dateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>dateModified</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>utcDateModified</code></td><td><code>string (date-time)</code></td></tr></tbody></table></figure><h3><code>CreateNoteRequest</code></h3><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>title</code> <br><em>required</em></td><td><code>string</code></td></tr><tr><td><code>content</code></td><td><code>string</code></td></tr><tr><td><code>type</code> <br><em>required</em></td><td><code>NoteType</code> <br>One of <code>text</code>, <code>code</code>, <code>render</code>, <code>file</code>, <code>image</code>, <code>search</code>, <code>relationMap</code>, <code>book</code>, <code>noteMap</code>, <code>mermaid</code>, <code>canvas</code>, <code>webView</code>, <code>launcher</code>, <code>doc</code>, <code>contentWidget</code>, <code>mindMap</code>, <code>geoMap</code>.</td></tr><tr><td><code>mime</code></td><td><code>string</code></td></tr><tr><td><code>isProtected</code></td><td><code>boolean</code></td></tr><tr><td><code>isExpanded</code></td><td><code>boolean</code></td></tr><tr><td><code>notePosition</code></td><td><code>integer</code></td></tr><tr><td><code>prefix</code></td><td><code>string</code></td></tr><tr><td><code>parentNoteId</code></td><td><code>string</code></td></tr><tr><td><code>templateNoteId</code></td><td><code>string</code></td></tr></tbody></table></figure><h3><code>ScriptBundle</code></h3><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code></td><td><code>string</code></td></tr><tr><td><code>script</code></td><td><code>string</code></td></tr><tr><td><code>html</code></td><td><code>string</code></td></tr><tr><td><code>css</code></td><td><code>string</code></td></tr></tbody></table></figure><h3><code>AppInfo</code></h3><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>appVersion</code></td><td><code>string</code></td></tr><tr><td><code>dbVersion</code></td><td><code>integer</code></td></tr><tr><td><code>nodeVersion</code></td><td><code>string</code></td></tr><tr><td><code>syncVersion</code></td><td><code>integer</code></td></tr><tr><td><code>buildDate</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>buildRevision</code></td><td><code>string</code></td></tr><tr><td><code>dataDirectory</code></td><td><code>string</code></td></tr><tr><td><code>clipperProtocolVersion</code></td><td><code>string</code></td></tr><tr><td><code>utcDateTime</code></td><td><code>string (date-time)</code></td></tr></tbody></table></figure><h3><code>ChatSession</code></h3><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>sessionId</code></td><td><code>string</code></td></tr><tr><td><code>title</code></td><td><code>string</code></td></tr><tr><td><code>messages</code></td><td><code>array of object</code></td></tr><tr><td><code>createdAt</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>lastActive</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>messageCount</code></td><td><code>integer</code></td></tr></tbody></table></figure><h3><code>EtapiToken</code></h3><figure class=\"table\"><table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>etapiTokenId</code></td><td><code>string</code></td></tr><tr><td><code>name</code></td><td><code>string</code></td></tr><tr><td><code>token</code></td><td><code>string</code></td></tr><tr><td><code>dateCreated</code></td><td><code>string (date-time)</code></td></tr><tr><td><code>isDeleted</code></td><td><code>boolean</code></td></tr></tbody></table></figure>","_help_2mUhVmZK8RF3": "<figure class=\"image image-style-align-right\"><img style=\"aspect-ratio:263/445;\" src=\"{{helpAssets}}/User%20Guide/Advanced%20Usage/Hidden%20Notes_image.png\" width=\"263\" height=\"445\"></figure><p>For easy extensibility, a lot of features in Trilium make use of actual notes to store information as opposed to having them stored in a separate location in the database. This allows some functions such as <a class=\"reference-link\" href=\"#root/_help_zEY4DaJG4YT5\">Attributes</a>, <a class=\"reference-link\" href=\"#root/_help_Cq5X6iKQop6R\">Relations</a> or even <a class=\"reference-link\" href=\"#root/_help_eIg8jdvaoNNd\">Search</a> and <a class=\"reference-link\" href=\"#root/_help_QEAPj01N5f7w\">Links</a> to be able to operate on them.</p><p>As the name suggests, these notes are hidden to the user by default to prevent cluttering the note tree and to prevent them from being accidentally deleted.</p><p>The hidden notes are stored in the user's <a class=\"reference-link\" href=\"#root/_help_wX4HbRucYSDD\">Database</a> just like normal notes, but they have a unique <a class=\"reference-link\" href=\"#root/_help_m1lbrzyKDaRB\">Note ID</a> which allows them to be distinguished from the normal ones.</p><h2>Accessing the hidden note tree</h2><p>From the <a class=\"reference-link\" href=\"#root/_help_x3i7MxGccDuM\">Global menu</a>, select <em>Advanced</em> → <em>Show hidden subtree</em>.</p><h2>Contents of the hidden note tree</h2><p>Here is a brief summary of all the notes within the hidden tree:</p><figure class=\"table\"><table class=\"ck-table-resized\"><colgroup><col style=\"width:19.93%;\"><col style=\"width:80.07%;\"></colgroup><thead><tr><th>Note</th><th>Description</th></tr></thead><tbody><tr><td><a class=\"reference-link\" href=\"#root/_hidden/_globalNoteMap\">Note Map</a></td><td><p>This note is actually opened when the <a class=\"reference-link\" href=\"#root/_help_bdUJEHsAPYQR\">Note Map</a> feature that is accessed from the <a class=\"reference-link\" href=\"#root/_help_xYmIYSP6wE3F\">Launch Bar</a>.</p><p>It is possible to create any child notes in it without any additional meaning. For example, it can be used to store a list of note maps which can be linked to from other notes or <a href=\"#root/_help_u3YFHC9tQlpm\">bookmarked</a>.</p></td></tr><tr><td><a class=\"reference-link\" href=\"#root/_hidden/_sqlConsole\">SQL Console History</a></td><td><p>When SQL queries or commands are executed in the <a class=\"reference-link\" href=\"#root/_help_YKWqdJhzi2VY\">SQL Console</a>, they are stored here, grouped by month. Only the query is stored and not the results.</p><p>This section can be accessed without going to the hidden tree by simply going to the <a class=\"reference-link\" href=\"#root/_help_x3i7MxGccDuM\">Global menu</a> and selecting Advanced → Open SQL console history.</p><p>Notes can be added as children of this tree, but it's generally not recommended to do so to not interfere with the normal history process.</p></td></tr><tr><td><a class=\"reference-link\" href=\"#root/_hidden/_search\">Search History</a></td><td><p>Whenever a search is executed from the full <a class=\"reference-link\" href=\"#root/_help_eIg8jdvaoNNd\">Search</a>, the query will be stored here, grouped by month. Only the search parameters are stored and not the results themselves.</p><p>This section can be accessed without going to the hidden tree by simply going to the <a class=\"reference-link\" href=\"#root/_help_x3i7MxGccDuM\">Global menu</a> and selecting Advanced → Open search history.</p><p>Notes can be added as children of this tree, but it's generally not recommended to do so to not interfere with the normal history process.</p></td></tr><tr><td><a class=\"reference-link\" href=\"#root/_hidden/_bulkAction\">Bulk Action</a></td><td><p>This section is used for <a class=\"reference-link\" href=\"#root/_help_ivYnonVFBxbQ\">Bulk Actions</a>. The last configuration for bulk actions will be stored as part of this note, each action in its own <code>action</code> label.</p><p>Notes can be added as children of this tree, but there won't be any benefit in doing so.</p></td></tr><tr><td><a class=\"reference-link\" href=\"#root/_hidden/_backendLog\">Backend Log</a></td><td><p>This note corresponds to the backend log feature (see <a class=\"reference-link\" href=\"#root/_help_qzNzp9LYQyPT\">Error logs</a>).</p><p>This item can be accessed without going to the hidden try by going to the <a class=\"reference-link\" href=\"#root/_help_x3i7MxGccDuM\">Global menu</a> and selecting Advanced → Show backend log.</p></td></tr><tr><td><a class=\"reference-link\" href=\"#root/_hidden/_userHidden\">User Hidden</a></td><td>This section can be used by <a href=\"#root/_help_CdNpE2pqjmI6\">scripts</a> to create their own notes that should not be directly visible to the user. The note can be identified by scripts by its unique ID: <code>_userHidden</code></td></tr><tr><td><a class=\"reference-link\" href=\"#root/_hidden/_lbTplRoot\">Launch Bar Templates</a></td><td><p>This section contains the templates for the creation of launchers in the <a class=\"reference-link\" href=\"#root/_help_xYmIYSP6wE3F\">Launch Bar</a>. It is not possible to create child notes here.</p><p>Theoretically some of the notes here can be customized, but there's not much benefit to be had in doing so.</p></td></tr><tr><td><a class=\"reference-link\" href=\"#root/_hidden/_share\">Shared Notes</a></td><td><p>This tree lists all of the notes that are <a href=\"#root/_help_R9pX4DGra2Vt\">shared</a> publicly. It can be useful to track down which notes are shared regardless of their position in the note tree.</p><p>This section can be accessed without going to the hidden tree simply by going to the <a class=\"reference-link\" href=\"#root/_help_x3i7MxGccDuM\">Global menu</a> and selecting <em>Show shared notes subtree</em>.</p><p>Sub-notes cannot be created here.</p></td></tr><tr><td><a class=\"reference-link\" href=\"#root/_hidden/_lbRoot\">Launch Bar</a></td><td><p>The tree contains both available and displayed items of the <a class=\"reference-link\" href=\"#root/_help_xYmIYSP6wE3F\">Launch Bar</a>.</p><p>This section can be accessed without going to the hidden tree by:</p><ul><li>Going to the <a class=\"reference-link\" href=\"#root/_help_x3i7MxGccDuM\">Global menu</a> and selecting <em>Configure launch bar…</em>.</li><li>Right-clicking an empty space on the <a class=\"reference-link\" href=\"#root/_help_xYmIYSP6wE3F\">Launch Bar</a> and selecting <em>Configure launch bar…</em>.</li></ul><p>Sub-notes cannot be created here.</p></td></tr><tr><td><a class=\"reference-link\" href=\"#root/_hidden/_options\">Options</a></td><td><p>This section stores the list of <a class=\"reference-link\" href=\"#root/_help_4TIF1oA4VQRO\">Options</a>.</p><p>This section can be accessed without going to the hidden tree by:</p><ul><li>Going to the <a class=\"reference-link\" href=\"#root/_help_x3i7MxGccDuM\">Global menu</a> and selecting <em>Options</em>.</li><li>Pressing the dedicated Options icon in the <a class=\"reference-link\" href=\"#root/_help_xYmIYSP6wE3F\">Launch Bar</a>.</li></ul></td></tr><tr><td><a class=\"reference-link\" href=\"#root/_hidden/_lbMobileRoot\">Mobile Launch Bar</a></td><td><p>This is very similar to the <em>Launch Bar</em>, but is dedicated for the mobile UI only.</p><p>Accessing it outside the <em>Launch Bar</em> is the same as the Launch Bar, but needs to be done so from the mobile interface.</p></td></tr><tr><td><a class=\"reference-link\" href=\"#root/_hidden/_help\">User Guide</a></td><td>This is where the User Guide appears in the note tree. Its notes are not stored in the database: Trilium builds them from files that ship with the application each time it starts, so they cannot be edited, moved or cloned, and they are not synchronized.</td></tr></tbody></table></figure>","_help_uYF7pmepw27K": "<p>The Trilium Metrics API provides comprehensive monitoring data about your Trilium instance, designed for external monitoring systems like Prometheus.</p><h2>Endpoint</h2><ul><li><strong>URL</strong>: <code>/etapi/metrics</code></li><li><strong>Method</strong>: <code>GET</code></li><li><strong>Authentication</strong>: ETAPI token required</li><li><strong>Default Format</strong>: Prometheus text format</li></ul><h2>Authentication</h2><p>You need an ETAPI token to access the metrics endpoint. Get one by:</p><pre><code class=\"language-text-x-trilium-auto\"># Get an ETAPI token\ncurl -X POST http://localhost:8080/etapi/auth/login \\\n -H \"Content-Type: application/json\" \\\n -d '{\"password\": \"your_password\"}'\n</code></pre><h2>Usage</h2><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">Prometheus Format (Default)</p><div class=\"trilium-tab-panel\"><pre><code class=\"language-text-x-trilium-auto\">curl -H \"Authorization: YOUR_ETAPI_TOKEN\" \\\n http://localhost:8080/etapi/metrics\n</code></pre><p>Returns metrics in Prometheus text format:</p><pre><code class=\"language-text-x-trilium-auto\"># HELP trilium_info Trilium instance information\n# TYPE trilium_info gauge\ntrilium_info{version=\"0.91.6\",db_version=\"231\",node_version=\"v18.17.0\"} 1 1701432000\n\n# HELP trilium_notes_total Total number of notes including deleted\n# TYPE trilium_notes_total gauge\ntrilium_notes_total 1234 1701432000</code></pre></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">JSON Format</p><div class=\"trilium-tab-panel\"><pre><code class=\"language-text-x-trilium-auto\">curl -H \"Authorization: YOUR_ETAPI_TOKEN\" \\\n \"http://localhost:8080/etapi/metrics?format=json\"\n</code></pre><p>Returns detailed metrics in JSON format for debugging or custom integrations.</p></div></section></div><h2>Available Metrics</h2><h3>Instance Information</h3><ul><li><code>trilium_info</code> - Version and build information with labels</li></ul><h3>Database Metrics</h3><ul><li><code>trilium_notes_total</code> - Total notes (including deleted)</li><li><code>trilium_notes_deleted</code> - Number of deleted notes</li><li><code>trilium_notes_active</code> - Number of active notes</li><li><code>trilium_notes_protected</code> - Number of protected notes</li><li><code>trilium_attachments_total</code> - Total attachments</li><li><code>trilium_attachments_active</code> - Active attachments</li><li><code>trilium_revisions_total</code> - Total note revisions</li><li><code>trilium_branches_total</code> - Active branches</li><li><code>trilium_attributes_total</code> - Active attributes</li><li><code>trilium_blobs_total</code> - Total blob records</li><li><code>trilium_etapi_tokens_total</code> - Active ETAPI tokens</li><li><code>trilium_embeddings_total</code> - Note embeddings (if available)</li></ul><h3>Categorized Metrics</h3><ul><li><code>trilium_notes_by_type{type=\"text|code|image|file\"}</code> - Notes by type</li><li><code>trilium_attachments_by_type{mime_type=\"...\"}</code> - Attachments by MIME type</li></ul><h3>Statistics</h3><ul><li><code>trilium_database_size_bytes</code> - Database size in bytes</li><li><code>trilium_oldest_note_timestamp</code> - Timestamp of oldest note</li><li><code>trilium_newest_note_timestamp</code> - Timestamp of newest note</li><li><code>trilium_last_modified_timestamp</code> - Last modification timestamp</li></ul><h2>Prometheus Configuration</h2><p>Add to your <code>prometheus.yml</code>:</p><pre><code class=\"language-text-x-trilium-auto\">scrape_configs:\n - job_name: 'trilium'\n static_configs:\n - targets: ['localhost:8080']\n metrics_path: '/etapi/metrics'\n bearer_token: 'YOUR_ETAPI_TOKEN'\n scrape_interval: 30s\n</code></pre><h2>Error Responses</h2><ul><li><code>400</code> - Invalid format parameter</li><li><code>401</code> - Missing or invalid ETAPI token</li><li><code>500</code> - Internal server error</li></ul><h2>Grafana Dashboard</h2><figure class=\"image\"><img style=\"aspect-ratio:2594/1568;\" src=\"{{helpAssets}}/User%20Guide/Advanced%20Usage/1_Metrics_image.png\" width=\"2594\" height=\"1568\"></figure><p>You can also use the Grafana Dashboard that has been created for TriliumNext - just take the JSON from <a class=\"reference-link\" href=\"#root/_help_bOP3TB56fL1V\">grafana-dashboard.json</a> and then import the dashboard, following these screenshots:</p><figure class=\"image\"><img style=\"aspect-ratio:1881/282;\" src=\"{{helpAssets}}/User%20Guide/Advanced%20Usage/2_Metrics_image.png\" width=\"1881\" height=\"282\"></figure><p>Then paste the JSON, and hit load:</p><figure class=\"image\"><img style=\"aspect-ratio:1055/830;\" src=\"{{helpAssets}}/User%20Guide/Advanced%20Usage/Metrics_image.png\" width=\"1055\" height=\"830\"></figure>","_help_bOP3TB56fL1V": "{\n \"annotations\": {\n \"list\": [\n {\n \"builtIn\": 1,\n \"datasource\": {\n \"type\": \"grafana\",\n \"uid\": \"-- Grafana --\"\n },\n \"enable\": true,\n \"hide\": true,\n \"iconColor\": \"rgba(0, 211, 255, 1)\",\n \"name\": \"Annotations & Alerts\",\n \"type\": \"dashboard\"\n }\n ]\n },\n \"editable\": true,\n \"fiscalYearStartMonth\": 0,\n \"graphTooltip\": 1,\n \"id\": 549,\n \"links\": [],\n \"panels\": [\n {\n \"collapsed\": false,\n \"gridPos\": {\n \"h\": 1,\n \"w\": 24,\n \"x\": 0,\n \"y\": 0\n },\n \"id\": 100,\n \"panels\": [],\n \"title\": \"🏠 Trilium Overview\",\n \"type\": \"row\"\n },\n {\n \"datasource\": {\n \"uid\": \"${datasource}\"\n },\n \"description\": \"Current Trilium version and build information\",\n \"fieldConfig\": {\n \"defaults\": {\n \"color\": {\n \"mode\": \"thresholds\"\n },\n \"custom\": {\n \"align\": \"auto\",\n \"cellOptions\": {\n \"type\": \"auto\"\n },\n \"filterable\": false,\n \"inspect\": false\n },\n \"mappings\": [],\n \"thresholds\": {\n \"mode\": \"absolute\",\n \"steps\": [\n {\n \"color\": \"green\"\n }\n ]\n }\n },\n \"overrides\": []\n },\n \"gridPos\": {\n \"h\": 6,\n \"w\": 12,\n \"x\": 0,\n \"y\": 1\n },\n \"id\": 101,\n \"options\": {\n \"cellHeight\": \"sm\",\n \"footer\": {\n \"countRows\": false,\n \"fields\": \"\",\n \"reducer\": [\n \"sum\"\n ],\n \"show\": false\n },\n \"showHeader\": true\n },\n \"pluginVersion\": \"12.0.1\",\n \"targets\": [\n {\n \"datasource\": {\n \"uid\": \"${datasource}\"\n },\n \"expr\": \"trilium_info{job=~'$job',instance=~'$instance'}\",\n \"format\": \"table\",\n \"instant\": true,\n \"refId\": \"A\"\n }\n ],\n \"title\": \"📋 Instance Information\",\n \"transformations\": [\n {\n \"id\": \"organize\",\n \"options\": {\n \"excludeByName\": {\n \"Time\": true,\n \"Value\": true,\n \"__name__\": true,\n \"instance\": true,\n \"job\": true\n },\n \"indexByName\": {},\n \"renameByName\": {\n \"build_date\": \"Build Date\",\n \"build_revision\": \"Git Revision\",\n \"db_version\": \"DB Version\",\n \"node_version\": \"Node.js\",\n \"sync_version\": \"Sync Version\",\n \"version\": \"Version\"\n }\n }\n }\n ],\n \"type\": \"table\"\n },\n {\n \"datasource\": {\n \"uid\": \"${datasource}\"\n },\n \"description\": \"Database file size in human-readable format\",\n \"fieldConfig\": {\n \"defaults\": {\n \"color\": {\n \"mode\": \"thresholds\"\n },\n \"mappings\": [],\n \"thresholds\": {\n \"mode\": \"absolute\",\n \"steps\": [\n {\n \"color\": \"green\"\n },\n {\n \"color\": \"yellow\",\n \"value\": 500000000\n },\n {\n \"color\": \"red\",\n \"value\": 1000000000\n }\n ]\n },\n \"unit\": \"decbytes\"\n },\n \"overrides\": []\n },\n \"gridPos\": {\n \"h\": 6,\n \"w\": 6,\n \"x\": 12,\n \"y\": 1\n },\n \"id\": 102,\n \"options\": {\n \"colorMode\": \"background\",\n \"graphMode\": \"area\",\n \"justifyMode\": \"center\",\n \"orientation\": \"auto\",\n \"percentChangeColorMode\": \"standard\",\n \"reduceOptions\": {\n \"calcs\": [\n \"lastNotNull\"\n ],\n \"fields\": \"\",\n \"values\": false\n },\n \"showPercentChange\": false,\n \"textMode\": \"auto\",\n \"wideLayout\": true\n },\n \"pluginVersion\": \"12.0.1\",\n \"targets\": [\n {\n \"datasource\": {\n \"uid\": \"${datasource}\"\n },\n \"expr\": \"trilium_database_size_bytes{job=~'$job',instance=~'$instance'}\",\n \"refId\": \"A\"\n }\n ],\n \"title\": \"💾 Database Size\",\n \"type\": \"stat\"\n },\n {\n \"datasource\": {\n \"uid\": \"${datasource}\"\n },\n \"description\": \"Total active notes in your Trilium instance\",\n \"fieldConfig\": {\n \"defaults\": {\n \"color\": {\n \"mode\": \"thresholds\"\n },\n \"mappings\": [],\n \"thresholds\": {\n \"mode\": \"absolute\",\n \"steps\": [\n {\n \"color\": \"green\"\n },\n {\n \"color\": \"yellow\",\n \"value\": 1000\n },\n {\n \"color\": \"red\",\n \"value\": 5000\n }\n ]\n },\n \"unit\": \"short\"\n },\n \"overrides\": []\n },\n \"gridPos\": {\n \"h\": 6,\n \"w\": 6,\n \"x\": 18,\n \"y\": 1\n },\n \"id\": 103,\n \"options\": {\n \"colorMode\": \"background\",\n \"graphMode\": \"area\",\n \"justifyMode\": \"center\",\n \"orientation\": \"auto\",\n \"percentChangeColorMode\": \"standard\",\n \"reduceOptions\": {\n \"calcs\": [\n \"lastNotNull\"\n ],\n \"fields\": \"\",\n \"values\": false\n },\n \"showPercentChange\": false,\n \"textMode\": \"auto\",\n \"wideLayout\": true\n },\n \"pluginVersion\": \"12.0.1\",\n \"targets\": [\n {\n \"datasource\": {\n \"uid\": \"${datasource}\"\n },\n \"expr\": \"trilium_notes_active{job=~'$job',instance=~'$instance'}\",\n \"refId\": \"A\"\n }\n ],\n \"title\": \"📝 Active Notes\",\n \"type\": \"stat\"\n },\n {\n \"collapsed\": false,\n \"gridPos\": {\n \"h\": 1,\n \"w\": 24,\n \"x\": 0,\n \"y\": 7\n },\n \"id\": 200,\n \"panels\": [],\n \"title\": \"📊 Key Metrics\",\n \"type\": \"row\"\n },\n {\n \"datasource\": {\n \"uid\": \"${datasource}\"\n },\n \"description\": \"Total notes including deleted ones\",\n \"fieldConfig\": {\n \"defaults\": {\n \"color\": {\n \"mode\": \"palette-classic\"\n },\n \"custom\": {\n \"hideFrom\": {\n \"legend\": false,\n \"tooltip\": false,\n \"viz\": false\n }\n },\n \"mappings\": [],\n \"unit\": \"short\"\n },\n \"overrides\": []\n },\n \"gridPos\": {\n \"h\": 8,\n \"w\": 6,\n \"x\": 0,\n \"y\": 8\n },\n \"id\": 201,\n \"options\": {\n \"legend\": {\n \"displayMode\": \"list\",\n \"placement\": \"bottom\",\n \"showLegend\": true,\n \"values\": []\n },\n \"pieType\": \"pie\",\n \"reduceOptions\": {\n \"calcs\": [\n \"lastNotNull\"\n ],\n \"fields\": \"\",\n \"values\": false\n },\n \"tooltip\": {\n \"hideZeros\": false,\n \"mode\": \"single\",\n \"sort\": \"none\"\n }\n },\n \"pluginVersion\": \"12.0.1\",\n \"targets\": [\n {\n \"datasource\": {\n \"uid\": \"${datasource}\"\n },\n \"expr\": \"trilium_notes_active{job=~'$job',instance=~'$instance'}\",\n \"legendFormat\": \"Active Notes\",\n \"refId\": \"A\"\n },\n {\n \"datasource\": {\n \"uid\": \"${datasource}\"\n },\n \"expr\": \"trilium_notes_deleted{job=~'$job',instance=~'$instance'}\",\n \"legendFormat\": \"Deleted Notes\",\n \"refId\": \"B\"\n },\n {\n \"datasource\": {\n \"uid\": \"${datasource}\"\n },\n \"expr\": \"trilium_notes_protected{job=~'$job',instance=~'$instance'}\",\n \"legendFormat\": \"Protected Notes\",\n \"refId\": \"C\"\n }\n ],\n \"title\": \"📝 Notes Distribution\",\n \"type\": \"piechart\"\n },\n {\n \"datasource\": {\n \"uid\": \"${datasource}\"\n },\n \"description\": \"Breakdown of attachments by MIME type\",\n \"fieldConfig\": {\n \"defaults\": {\n \"color\": {\n \"mode\": \"palette-classic\"\n },\n \"custom\": {\n \"hideFrom\": {\n \"legend\": false,\n \"tooltip\": false,\n \"viz\": false\n }\n },\n \"mappings\": [],\n \"unit\": \"short\"\n },\n \"overrides\": []\n },\n \"gridPos\": {\n \"h\": 8,\n \"w\": 6,\n \"x\": 6,\n \"y\": 8\n },\n \"id\": 202,\n \"options\": {\n \"legend\": {\n \"displayMode\": \"list\",\n \"placement\": \"bottom\",\n \"showLegend\": true,\n \"values\": []\n },\n \"pieType\": \"donut\",\n \"reduceOptions\": {\n \"calcs\": [\n \"lastNotNull\"\n ],\n \"fields\": \"\",\n \"values\": false\n },\n \"tooltip\": {\n \"hideZeros\": false,\n \"mode\": \"single\",\n \"sort\": \"none\"\n }\n },\n \"pluginVersion\": \"12.0.1\",\n \"targets\": [\n {\n \"datasource\": {\n \"uid\": \"${datasource}\"\n },\n \"expr\": \"trilium_attachments_by_type{job=~'$job',instance=~'$instance'}\",\n \"legendFormat\": \"{{mime_type}}\",\n \"refId\": \"A\"\n }\n ],\n \"title\": \"🖼️ Attachments by Type\",\n \"type\": \"piechart\"\n },\n {\n \"datasource\": {\n \"uid\": \"${datasource}\"\n },\n \"description\": \"Distribution of notes by their content type\",\n \"fieldConfig\": {\n \"defaults\": {\n \"color\": {\n \"mode\": \"palette-classic\"\n },\n \"custom\": {\n \"hideFrom\": {\n \"legend\": false,\n \"tooltip\": false,\n \"viz\": false\n }\n },\n \"mappings\": [],\n \"unit\": \"short\"\n },\n \"overrides\": []\n },\n \"gridPos\": {\n \"h\": 8,\n \"w\": 12,\n \"x\": 12,\n \"y\": 8\n },\n \"id\": 203,\n \"options\": {\n \"legend\": {\n \"displayMode\": \"table\",\n \"placement\": \"right\",\n \"showLegend\": true,\n \"values\": [\n \"value\",\n \"percent\"\n ]\n },\n \"pieType\": \"donut\",\n \"reduceOptions\": {\n \"calcs\": [\n \"lastNotNull\"\n ],\n \"fields\": \"\",\n \"values\": false\n },\n \"tooltip\": {\n \"hideZeros\": false,\n \"mode\": \"single\",\n \"sort\": \"none\"\n }\n },\n \"pluginVersion\": \"12.0.1\",\n \"targets\": [\n {\n \"datasource\": {\n \"uid\": \"${datasource}\"\n },\n \"expr\": \"trilium_notes_by_type{job=~'$job',instance=~'$instance'}\",\n \"legendFormat\": \"{{type}}\",\n \"refId\": \"A\"\n }\n ],\n \"title\": \"📄 Notes by Content Type\",\n \"type\": \"piechart\"\n },\n {\n \"collapsed\": false,\n \"gridPos\": {\n \"h\": 1,\n \"w\": 24,\n \"x\": 0,\n \"y\": 16\n },\n \"id\": 300,\n \"panels\": [],\n \"title\": \"📈 Trends & Time Series\",\n \"type\": \"row\"\n },\n {\n \"datasource\": {\n \"uid\": \"${datasource}\"\n },\n \"description\": \"Growth of notes over time\",\n \"fieldConfig\": {\n \"defaults\": {\n \"color\": {\n \"mode\": \"palette-classic\"\n },\n \"custom\": {\n \"axisBorderShow\": false,\n \"axisCenteredZero\": false,\n \"axisColorMode\": \"text\",\n \"axisLabel\": \"\",\n \"axisPlacement\": \"auto\",\n \"barAlignment\": 0,\n \"barWidthFactor\": 0.6,\n \"drawStyle\": \"line\",\n \"fillOpacity\": 20,\n \"gradientMode\": \"hue\",\n \"hideFrom\": {\n \"legend\": false,\n \"tooltip\": false,\n \"viz\": false\n },\n \"insertNulls\": false,\n \"lineInterpolation\": \"smooth\",\n \"lineWidth\": 3,\n \"pointSize\": 8,\n \"scaleDistribution\": {\n \"type\": \"linear\"\n },\n \"showPoints\": \"auto\",\n \"spanNulls\": false,\n \"stacking\": {\n \"group\": \"A\",\n \"mode\": \"none\"\n },\n \"thresholdsStyle\": {\n \"mode\": \"off\"\n }\n },\n \"mappings\": [],\n \"thresholds\": {\n \"mode\": \"absolute\",\n \"steps\": [\n {\n \"color\": \"green\"\n }\n ]\n },\n \"unit\": \"short\"\n },\n \"overrides\": [\n {\n \"matcher\": {\n \"id\": \"byName\",\n \"options\": \"Active Notes\"\n },\n \"properties\": [\n {\n \"id\": \"color\",\n \"value\": {\n \"fixedColor\": \"blue\",\n \"mode\": \"fixed\"\n }\n }\n ]\n },\n {\n \"matcher\": {\n \"id\": \"byName\",\n \"options\": \"Total Notes\"\n },\n \"properties\": [\n {\n \"id\": \"color\",\n \"value\": {\n \"fixedColor\": \"green\",\n \"mode\": \"fixed\"\n }\n }\n ]\n }\n ]\n },\n \"gridPos\": {\n \"h\": 8,\n \"w\": 12,\n \"x\": 0,\n \"y\": 17\n },\n \"id\": 301,\n \"options\": {\n \"legend\": {\n \"calcs\": [\n \"last\",\n \"max\"\n ],\n \"displayMode\": \"table\",\n \"placement\": \"bottom\",\n \"showLegend\": true\n },\n \"tooltip\": {\n \"hideZeros\": false,\n \"mode\": \"multi\",\n \"sort\": \"desc\"\n }\n },\n \"pluginVersion\": \"12.0.1\",\n \"targets\": [\n {\n \"datasource\": {\n \"uid\": \"${datasource}\"\n },\n \"expr\": \"trilium_notes_active{job=~'$job',instance=~'$instance'}\",\n \"legendFormat\": \"Active Notes\",\n \"refId\": \"A\"\n },\n {\n \"datasource\": {\n \"uid\": \"${datasource}\"\n },\n \"expr\": \"trilium_notes_total{job=~'$job',instance=~'$instance'}\",\n \"legendFormat\": \"Total Notes\",\n \"refId\": \"B\"\n }\n ],\n \"title\": \"📈 Notes Growth Over Time\",\n \"type\": \"timeseries\"\n },\n {\n \"datasource\": {\n \"uid\": \"${datasource}\"\n },\n \"description\": \"Attachment storage trends\",\n \"fieldConfig\": {\n \"defaults\": {\n \"color\": {\n \"mode\": \"palette-classic\"\n },\n \"custom\": {\n \"axisBorderShow\": false,\n \"axisCenteredZero\": false,\n \"axisColorMode\": \"text\",\n \"axisLabel\": \"\",\n \"axisPlacement\": \"auto\",\n \"barAlignment\": 0,\n \"barWidthFactor\": 0.6,\n \"drawStyle\": \"line\",\n \"fillOpacity\": 20,\n \"gradientMode\": \"hue\",\n \"hideFrom\": {\n \"legend\": false,\n \"tooltip\": false,\n \"viz\": false\n },\n \"insertNulls\": false,\n \"lineInterpolation\": \"smooth\",\n \"lineWidth\": 3,\n \"pointSize\": 8,\n \"scaleDistribution\": {\n \"type\": \"linear\"\n },\n \"showPoints\": \"auto\",\n \"spanNulls\": false,\n \"stacking\": {\n \"group\": \"A\",\n \"mode\": \"none\"\n },\n \"thresholdsStyle\": {\n \"mode\": \"off\"\n }\n },\n \"mappings\": [],\n \"thresholds\": {\n \"mode\": \"absolute\",\n \"steps\": [\n {\n \"color\": \"green\"\n }\n ]\n },\n \"unit\": \"short\"\n },\n \"overrides\": [\n {\n \"matcher\": {\n \"id\": \"byName\",\n \"options\": \"Active Attachments\"\n },\n \"properties\": [\n {\n \"id\": \"color\",\n \"value\": {\n \"fixedColor\": \"purple\",\n \"mode\": \"fixed\"\n }\n }\n ]\n },\n {\n \"matcher\": {\n \"id\": \"byName\",\n \"options\": \"Total Attachments\"\n },\n \"properties\": [\n {\n \"id\": \"color\",\n \"value\": {\n \"fixedColor\": \"orange\",\n \"mode\": \"fixed\"\n }\n }\n ]\n }\n ]\n },\n \"gridPos\": {\n \"h\": 8,\n \"w\": 12,\n \"x\": 12,\n \"y\": 17\n },\n \"id\": 302,\n \"options\": {\n \"legend\": {\n \"calcs\": [\n \"last\",\n \"max\"\n ],\n \"displayMode\": \"table\",\n \"placement\": \"bottom\",\n \"showLegend\": true\n },\n \"tooltip\": {\n \"hideZeros\": false,\n \"mode\": \"multi\",\n \"sort\": \"desc\"\n }\n },\n \"pluginVersion\": \"12.0.1\",\n \"targets\": [\n {\n \"datasource\": {\n \"uid\": \"${datasource}\"\n },\n \"expr\": \"trilium_attachments_active{job=~'$job',instance=~'$instance'}\",\n \"legendFormat\": \"Active Attachments\",\n \"refId\": \"A\"\n },\n {\n \"datasource\": {\n \"uid\": \"${datasource}\"\n },\n \"expr\": \"trilium_attachments_total{job=~'$job',instance=~'$instance'}\",\n \"legendFormat\": \"Total Attachments\",\n \"refId\": \"B\"\n }\n ],\n \"title\": \"📎 Attachments Growth Over Time\",\n \"type\": \"timeseries\"\n },\n {\n \"collapsed\": false,\n \"gridPos\": {\n \"h\": 1,\n \"w\": 24,\n \"x\": 0,\n \"y\": 25\n },\n \"id\": 400,\n \"panels\": [],\n \"title\": \"🔧 Advanced Metrics\",\n \"type\": \"row\"\n },\n {\n \"datasource\": {\n \"uid\": \"${datasource}\"\n },\n \"description\": \"Number of branches connecting notes\",\n \"fieldConfig\": {\n \"defaults\": {\n \"color\": {\n \"mode\": \"thresholds\"\n },\n \"mappings\": [],\n \"thresholds\": {\n \"mode\": \"absolute\",\n \"steps\": [\n {\n \"color\": \"green\"\n }\n ]\n },\n \"unit\": \"short\"\n },\n \"overrides\": []\n },\n \"gridPos\": {\n \"h\": 4,\n \"w\": 6,\n \"x\": 0,\n \"y\": 26\n },\n \"id\": 401,\n \"options\": {\n \"colorMode\": \"value\",\n \"graphMode\": \"none\",\n \"justifyMode\": \"center\",\n \"orientation\": \"auto\",\n \"percentChangeColorMode\": \"standard\",\n \"reduceOptions\": {\n \"calcs\": [\n \"lastNotNull\"\n ],\n \"fields\": \"\",\n \"values\": false\n },\n \"showPercentChange\": false,\n \"textMode\": \"auto\",\n \"wideLayout\": true\n },\n \"pluginVersion\": \"12.0.1\",\n \"targets\": [\n {\n \"datasource\": {\n \"uid\": \"${datasource}\"\n },\n \"expr\": \"trilium_branches_total{job=~'$job',instance=~'$instance'}\",\n \"refId\": \"A\"\n }\n ],\n \"title\": \"🌳 Total Branches\",\n \"type\": \"stat\"\n },\n {\n \"datasource\": {\n \"uid\": \"${datasource}\"\n },\n \"description\": \"Number of note attributes\",\n \"fieldConfig\": {\n \"defaults\": {\n \"color\": {\n \"mode\": \"thresholds\"\n },\n \"mappings\": [],\n \"thresholds\": {\n \"mode\": \"absolute\",\n \"steps\": [\n {\n \"color\": \"green\"\n }\n ]\n },\n \"unit\": \"short\"\n },\n \"overrides\": []\n },\n \"gridPos\": {\n \"h\": 4,\n \"w\": 6,\n \"x\": 6,\n \"y\": 26\n },\n \"id\": 402,\n \"options\": {\n \"colorMode\": \"value\",\n \"graphMode\": \"none\",\n \"justifyMode\": \"center\",\n \"orientation\": \"auto\",\n \"percentChangeColorMode\": \"standard\",\n \"reduceOptions\": {\n \"calcs\": [\n \"lastNotNull\"\n ],\n \"fields\": \"\",\n \"values\": false\n },\n \"showPercentChange\": false,\n \"textMode\": \"auto\",\n \"wideLayout\": true\n },\n \"pluginVersion\": \"12.0.1\",\n \"targets\": [\n {\n \"datasource\": {\n \"uid\": \"${datasource}\"\n },\n \"expr\": \"trilium_attributes_total{job=~'$job',instance=~'$instance'}\",\n \"refId\": \"A\"\n }\n ],\n \"title\": \"🏷️ Attributes\",\n \"type\": \"stat\"\n },\n {\n \"datasource\": {\n \"uid\": \"${datasource}\"\n },\n \"description\": \"Number of note revisions\",\n \"fieldConfig\": {\n \"defaults\": {\n \"color\": {\n \"mode\": \"thresholds\"\n },\n \"mappings\": [],\n \"thresholds\": {\n \"mode\": \"absolute\",\n \"steps\": [\n {\n \"color\": \"green\"\n }\n ]\n },\n \"unit\": \"short\"\n },\n \"overrides\": []\n },\n \"gridPos\": {\n \"h\": 4,\n \"w\": 6,\n \"x\": 12,\n \"y\": 26\n },\n \"id\": 403,\n \"options\": {\n \"colorMode\": \"value\",\n \"graphMode\": \"none\",\n \"justifyMode\": \"center\",\n \"orientation\": \"auto\",\n \"percentChangeColorMode\": \"standard\",\n \"reduceOptions\": {\n \"calcs\": [\n \"lastNotNull\"\n ],\n \"fields\": \"\",\n \"values\": false\n },\n \"showPercentChange\": false,\n \"textMode\": \"auto\",\n \"wideLayout\": true\n },\n \"pluginVersion\": \"12.0.1\",\n \"targets\": [\n {\n \"datasource\": {\n \"uid\": \"${datasource}\"\n },\n \"expr\": \"trilium_revisions_total{job=~'$job',instance=~'$instance'}\",\n \"refId\": \"A\"\n }\n ],\n \"title\": \"🔄 Revisions\",\n \"type\": \"stat\"\n },\n {\n \"datasource\": {\n \"uid\": \"${datasource}\"\n },\n \"description\": \"Number of ETAPI tokens\",\n \"fieldConfig\": {\n \"defaults\": {\n \"color\": {\n \"mode\": \"thresholds\"\n },\n \"mappings\": [],\n \"thresholds\": {\n \"mode\": \"absolute\",\n \"steps\": [\n {\n \"color\": \"green\"\n }\n ]\n },\n \"unit\": \"short\"\n },\n \"overrides\": []\n },\n \"gridPos\": {\n \"h\": 4,\n \"w\": 6,\n \"x\": 18,\n \"y\": 26\n },\n \"id\": 404,\n \"options\": {\n \"colorMode\": \"value\",\n \"graphMode\": \"none\",\n \"justifyMode\": \"center\",\n \"orientation\": \"auto\",\n \"percentChangeColorMode\": \"standard\",\n \"reduceOptions\": {\n \"calcs\": [\n \"lastNotNull\"\n ],\n \"fields\": \"\",\n \"values\": false\n },\n \"showPercentChange\": false,\n \"textMode\": \"auto\",\n \"wideLayout\": true\n },\n \"pluginVersion\": \"12.0.1\",\n \"targets\": [\n {\n \"datasource\": {\n \"uid\": \"${datasource}\"\n },\n \"expr\": \"trilium_etapi_tokens_total{job=~'$job',instance=~'$instance'}\",\n \"refId\": \"A\"\n }\n ],\n \"title\": \"🔑 API Tokens\",\n \"type\": \"stat\"\n },\n {\n \"datasource\": {\n \"uid\": \"${datasource}\"\n },\n \"description\": \"Various storage and system metrics\",\n \"fieldConfig\": {\n \"defaults\": {\n \"color\": {\n \"mode\": \"palette-classic\"\n },\n \"custom\": {\n \"axisBorderShow\": false,\n \"axisCenteredZero\": false,\n \"axisColorMode\": \"text\",\n \"axisLabel\": \"\",\n \"axisPlacement\": \"auto\",\n \"barAlignment\": 0,\n \"barWidthFactor\": 0.6,\n \"drawStyle\": \"line\",\n \"fillOpacity\": 10,\n \"gradientMode\": \"none\",\n \"hideFrom\": {\n \"legend\": false,\n \"tooltip\": false,\n \"viz\": false\n },\n \"insertNulls\": false,\n \"lineInterpolation\": \"linear\",\n \"lineWidth\": 2,\n \"pointSize\": 5,\n \"scaleDistribution\": {\n \"type\": \"linear\"\n },\n \"showPoints\": \"auto\",\n \"spanNulls\": false,\n \"stacking\": {\n \"group\": \"A\",\n \"mode\": \"none\"\n },\n \"thresholdsStyle\": {\n \"mode\": \"off\"\n }\n },\n \"mappings\": [],\n \"thresholds\": {\n \"mode\": \"absolute\",\n \"steps\": [\n {\n \"color\": \"green\"\n }\n ]\n },\n \"unit\": \"short\"\n },\n \"overrides\": [\n {\n \"matcher\": {\n \"id\": \"byName\",\n \"options\": \"Recent Notes\"\n },\n \"properties\": [\n {\n \"id\": \"color\",\n \"value\": {\n \"fixedColor\": \"yellow\",\n \"mode\": \"fixed\"\n }\n }\n ]\n }\n ]\n },\n \"gridPos\": {\n \"h\": 8,\n \"w\": 12,\n \"x\": 0,\n \"y\": 30\n },\n \"id\": 405,\n \"options\": {\n \"legend\": {\n \"calcs\": [\n \"last\"\n ],\n \"displayMode\": \"table\",\n \"placement\": \"bottom\",\n \"showLegend\": true\n },\n \"tooltip\": {\n \"hideZeros\": false,\n \"mode\": \"multi\",\n \"sort\": \"desc\"\n }\n },\n \"pluginVersion\": \"12.0.1\",\n \"targets\": [\n {\n \"datasource\": {\n \"uid\": \"${datasource}\"\n },\n \"expr\": \"trilium_blobs_total{job=~'$job',instance=~'$instance'}\",\n \"legendFormat\": \"Blob Records\",\n \"refId\": \"A\"\n },\n {\n \"datasource\": {\n \"uid\": \"${datasource}\"\n },\n \"expr\": \"trilium_recent_notes_total{job=~'$job',instance=~'$instance'}\",\n \"legendFormat\": \"Recent Notes\",\n \"refId\": \"B\"\n },\n {\n \"datasource\": {\n \"uid\": \"${datasource}\"\n },\n \"expr\": \"trilium_embeddings_total{job=~'$job',instance=~'$instance'}\",\n \"legendFormat\": \"Embeddings\",\n \"refId\": \"C\"\n },\n {\n \"datasource\": {\n \"uid\": \"${datasource}\"\n },\n \"expr\": \"trilium_embedding_providers_total{job=~'$job',instance=~'$instance'}\",\n \"legendFormat\": \"Embedding Providers\",\n \"refId\": \"D\"\n }\n ],\n \"title\": \"📊 Storage & System Metrics\",\n \"type\": \"timeseries\"\n },\n {\n \"datasource\": {\n \"uid\": \"${datasource}\"\n },\n \"description\": \"Timeline showing when content was created and last modified\",\n \"fieldConfig\": {\n \"defaults\": {\n \"color\": {\n \"mode\": \"palette-classic\"\n },\n \"custom\": {\n \"axisBorderShow\": false,\n \"axisCenteredZero\": false,\n \"axisColorMode\": \"text\",\n \"axisLabel\": \"\",\n \"axisPlacement\": \"auto\",\n \"barAlignment\": 0,\n \"barWidthFactor\": 0.6,\n \"drawStyle\": \"points\",\n \"fillOpacity\": 0,\n \"gradientMode\": \"none\",\n \"hideFrom\": {\n \"legend\": false,\n \"tooltip\": false,\n \"viz\": false\n },\n \"insertNulls\": false,\n \"lineInterpolation\": \"linear\",\n \"lineWidth\": 1,\n \"pointSize\": 8,\n \"scaleDistribution\": {\n \"type\": \"linear\"\n },\n \"showPoints\": \"always\",\n \"spanNulls\": false,\n \"stacking\": {\n \"group\": \"A\",\n \"mode\": \"none\"\n },\n \"thresholdsStyle\": {\n \"mode\": \"off\"\n }\n },\n \"mappings\": [],\n \"thresholds\": {\n \"mode\": \"absolute\",\n \"steps\": [\n {\n \"color\": \"green\"\n }\n ]\n },\n \"unit\": \"dateTimeAsIso\"\n },\n \"overrides\": []\n },\n \"gridPos\": {\n \"h\": 8,\n \"w\": 12,\n \"x\": 12,\n \"y\": 30\n },\n \"id\": 406,\n \"options\": {\n \"legend\": {\n \"calcs\": [],\n \"displayMode\": \"list\",\n \"placement\": \"bottom\",\n \"showLegend\": true\n },\n \"tooltip\": {\n \"hideZeros\": false,\n \"mode\": \"single\",\n \"sort\": \"none\"\n }\n },\n \"pluginVersion\": \"12.0.1\",\n \"targets\": [\n {\n \"datasource\": {\n \"uid\": \"${datasource}\"\n },\n \"expr\": \"trilium_oldest_note_timestamp{job=~'$job',instance=~'$instance'} * 1000\",\n \"legendFormat\": \"Oldest Note\",\n \"refId\": \"A\"\n },\n {\n \"datasource\": {\n \"uid\": \"${datasource}\"\n },\n \"expr\": \"trilium_newest_note_timestamp{job=~'$job',instance=~'$instance'} * 1000\",\n \"legendFormat\": \"Newest Note\",\n \"refId\": \"B\"\n },\n {\n \"datasource\": {\n \"uid\": \"${datasource}\"\n },\n \"expr\": \"trilium_last_modified_timestamp{job=~'$job',instance=~'$instance'} * 1000\",\n \"legendFormat\": \"Last Modified\",\n \"refId\": \"C\"\n }\n ],\n \"title\": \"⏰ Content Timeline\",\n \"type\": \"timeseries\"\n }\n ],\n \"preload\": false,\n \"refresh\": \"1m\",\n \"schemaVersion\": 41,\n \"tags\": [\n \"trilium\",\n \"notes\",\n \"monitoring\",\n \"enhanced\"\n ],\n \"templating\": {\n \"list\": [\n {\n \"current\": {\n \"text\": \"myprom\",\n \"value\": \"PA04845DA3A4B088E\"\n },\n \"includeAll\": false,\n \"label\": \"Datasource\",\n \"name\": \"datasource\",\n \"options\": [],\n \"query\": \"prometheus\",\n \"refresh\": 1,\n \"regex\": \"//\",\n \"type\": \"datasource\"\n },\n {\n \"allValue\": \".*\",\n \"current\": {\n \"text\": \"All\",\n \"value\": \"$__all\"\n },\n \"datasource\": {\n \"UID\": \"\",\n \"type\": \"\"\n },\n \"includeAll\": true,\n \"label\": \"Job\",\n \"multi\": true,\n \"name\": \"job\",\n \"options\": [],\n \"query\": \"query_result(up)\",\n \"refresh\": 1,\n \"regex\": \"/job=\\\"([^\\\"]+)\\\"/\",\n \"sort\": 1,\n \"type\": \"query\"\n },\n {\n \"allValue\": \".*\",\n \"current\": {\n \"text\": [\n \"All\"\n ],\n \"value\": [\n \"$__all\"\n ]\n },\n \"datasource\": {\n \"type\": \"prometheus\",\n \"uid\": \"${datasource}\"\n },\n \"includeAll\": true,\n \"label\": \"Instance\",\n \"multi\": true,\n \"name\": \"instance\",\n \"options\": [],\n \"query\": \"trilium_database_size_bytes\",\n \"refresh\": 1,\n \"regex\": \"/instance=\\\"([^\\\"]+)\\\"/\",\n \"sort\": 1,\n \"type\": \"query\"\n }\n ]\n },\n \"time\": {\n \"from\": \"now-1h\",\n \"to\": \"now\"\n },\n \"timepicker\": {},\n \"timezone\": \"browser\",\n \"title\": \"TriliumNext Dashboard\",\n \"uid\": \"06993f9b-a477-4723-bf18-47743393b382\",\n \"version\": 5\n}",diff --git a/apps/server/src/assets/help/help_meta.json b/apps/server/src/assets/help/help_meta.jsonindex 459b5774e7..6b10dbbf4b 100644--- a/apps/server/src/assets/help/help_meta.json+++ b/apps/server/src/assets/help/help_meta.json@@ -290,7 +290,7 @@]},{"id":"_help_m1lbrzyKDaRB","title":"Note ID","type":"text","attributes":[{"type":"label","name":"docUrl","value":"https://docs.triliumnotes.org/user-guide/advanced-usage/note-id"},{"type":"label","name":"iconClass","value":"bx bx-fingerprint"}]},{"id":"_help_0vTSyvhPTAOz","title":"Internal API","type":"book","attributes":[{"type":"label","name":"docUrl","value":"https://docs.triliumnotes.org/user-guide/advanced-usage/internal-api"},{"type":"label","name":"iconClass","value":"bx bxs-component"}],"children":[- {"id":"_help_z8O2VG4ZZJD7","title":"API Reference","type":"webView","attributes":[{"type":"label","name":"webViewSrc","value":"https://docs.triliumnotes.org/rest-api/internal/"},{"type":"label","name":"docUrl","value":"https://docs.triliumnotes.org/user-guide/advanced-usage/internal-api/api-reference"},{"type":"label","name":"iconClass","value":"bx bx-file"}]}+ {"id":"_help_z8O2VG4ZZJD7","title":"API Reference","type":"text","attributes":[{"type":"label","name":"docUrl","value":"https://docs.triliumnotes.org/user-guide/advanced-usage/internal-api/api-reference"},{"type":"label","name":"iconClass","value":"bx bx-book-content"}]}]},{"id":"_help_2mUhVmZK8RF3","title":"Hidden Notes","type":"text","attributes":[{"type":"label","name":"docUrl","value":"https://docs.triliumnotes.org/user-guide/advanced-usage/hidden-notes"},{"type":"label","name":"iconClass","value":"bx bx-hide"}]},{"id":"_help_uYF7pmepw27K","title":"Metrics","type":"text","attributes":[{"type":"label","name":"docUrl","value":"https://docs.triliumnotes.org/user-guide/advanced-usage/metrics"},{"type":"label","name":"iconClass","value":"bx bxs-data"}],"children":[diff --git a/docs/User Guide/!!!meta.json b/docs/User Guide/!!!meta.jsonindex fbb35944d1..44bac1d302 100644--- a/docs/User Guide/!!!meta.json+++ b/docs/User Guide/!!!meta.json@@ -10392,13 +10392,13 @@"notePosition": 10,"prefix": null,"isExpanded": false,- "type": "webView",- "mime": "",+ "type": "text",+ "mime": "text/html","attributes": [{"type": "label",- "name": "webViewSrc",- "value": "/rest-api/internal/",+ "name": "iconClass",+ "value": "bx bx-book-content","isInheritable": false,"position": 10},@@ -10410,7 +10410,8 @@"position": 20}],- "dataFileName": "API Reference.dat",+ "format": "markdown",+ "dataFileName": "API Reference.md","attachments": []}]diff --git a/docs/User Guide/User Guide/Advanced Usage/Internal API/API Reference.dat b/docs/User Guide/User Guide/Advanced Usage/Internal API/API Reference.datdeleted file mode 100644index e69de29bb2..0000000000diff --git a/docs/User Guide/User Guide/Advanced Usage/Internal API/API Reference.md b/docs/User Guide/User Guide/Advanced Usage/Internal API/API Reference.mdnew file mode 100644index 0000000000..ff487420b1--- /dev/null+++ b/docs/User Guide/User Guide/Advanced Usage/Internal API/API Reference.md@@ -0,0 +1,7749 @@+# API Reference+This is the internal API used by the Trilium Notes client application.++**Important:** This API is primarily intended for internal use by the Trilium client. For external integrations, please use the [ETAPI (External Trilium API)](https://github.com/TriliumNext/Trilium/blob/main/docs/User%20Guide/User%20Guide/Advanced%20Usage/ETAPI%20\(REST%20API\).md#etapi-rest-api) instead.++## Signing in++Most endpoints require session-based authentication. You can authenticate using:++* **Password login**: POST to `/api/login` with password+* **Token authentication**: Generate a token via `/api/login/token`+* **Sync authentication**: Use document secret for sync operations++## Rate Limiting++Authentication endpoints are rate-limited to prevent brute force attacks.++## CSRF Protection++State-changing operations require CSRF tokens when using session authentication.++## Authentication++### `sessionAuth`++API key in the `trilium.sid` cookie.++Session cookie obtained from login++### `tokenAuth`++API key in the `Authorization` header.++API token in format "Bearer {token}"++## Sessions++Login, logout, and session management++### Login with password++`POST /api/login` · `login`++**Authorization**: none++**Request body** (required)++* `application/x-www-form-urlencoded`: `object`++| Property | Description |+| --- | --- |+| `password` <br>_required_ | `string (password)` |+| `totpToken` | `string` <br>TOTP token if 2FA is enabled |++**Responses**++=== "200: Login successful"++ No content.++=== "401: Invalid credentials or TOTP token"++ No content.++### Generate API token++`POST /api/login/token` · `generateToken`++**Authorization**: none++**Request body** (required)++* `application/json`: `object`++<div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+<div class="trilium-multicolumn-column">++| Property | Description |+| --- | --- |+| `password` <br>_required_ | `string (password)` |+| `tokenName` | `string` <br>Optional name for the token |++</div>+<div class="trilium-multicolumn-column">++```json+{+ "password": "string",+ "tokenName": "string"+}+```++</div>+</div>++**Responses**++=== "201: Token created"++ * `application/json`: `object`++ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+ <div class="trilium-multicolumn-column">++ | Property | Description |+ | --- | --- |+ | `authToken` | `string` <br>API authentication token |++ </div>+ <div class="trilium-multicolumn-column">++ ```json+ {+ "authToken": "string"+ }+ ```++ </div>+ </div>++### Sync login using document secret++`POST /api/login/sync` · `loginSync`++**Authorization**: none++**Request body** (required)++* `application/json`: `object`++<div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+<div class="trilium-multicolumn-column">++| Property | Description |+| --- | --- |+| `timestamp` <br>_required_ | `string (date-time)` |+| `hash` <br>_required_ | `string` <br>HMAC hash of document secret and timestamp |+| `syncVersion` <br>_required_ | `integer` |++</div>+<div class="trilium-multicolumn-column">++```json+{+ "timestamp": "2019-08-24T14:15:22Z",+ "hash": "string",+ "syncVersion": 0+}+```++</div>+</div>++**Responses**++=== "200: Login successful"++ * `application/json`: `object`++ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+ <div class="trilium-multicolumn-column">++ | Property | Description |+ | --- | --- |+ | `instanceId` | `string` |+ | `maxEntityChangeId` | `string` |++ </div>+ <div class="trilium-multicolumn-column">++ ```json+ {+ "instanceId": "string",+ "maxEntityChangeId": "string"+ }+ ```++ </div>+ </div>++### Enter protected session++`POST /api/login/protected` · `enterProtectedSession`++**Authorization**: `sessionAuth` or `tokenAuth`++**Request body** (required)++* `application/json`: `object`++<div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+<div class="trilium-multicolumn-column">++| Property | Description |+| --- | --- |+| `password` <br>_required_ | `string (password)` |++</div>+<div class="trilium-multicolumn-column">++```json+{+ "password": "string"+}+```++</div>+</div>++**Responses**++=== "200: Protected session entered"++ No content.++=== "401: Invalid password"++ No content.++### Exit protected session++`POST /api/logout/protected` · `exitProtectedSession`++**Authorization**: `sessionAuth` or `tokenAuth`++**Responses**++=== "204: Protected session exited"++ No content.++### Keep protected session alive++`POST /api/login/protected/touch` · `touchProtectedSession`++**Authorization**: `sessionAuth` or `tokenAuth`++**Responses**++=== "204: Session refreshed"++ No content.++### Get OAuth status++`GET /api/oauth/status` · `getOAuthStatus`++**Authorization**: `sessionAuth` or `tokenAuth`++**Responses**++=== "200: OAuth status"++ * `application/json`: `object`++ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+ <div class="trilium-multicolumn-column">++ | Property | Description |+ | --- | --- |+ | `enabled` | `boolean` |+ | `configured` | `boolean` |+ | `providers` | `array of string` |++ </div>+ <div class="trilium-multicolumn-column">++ ```json+ {+ "enabled": true,+ "configured": true,+ "providers": [+ "string"+ ]+ }+ ```++ </div>+ </div>++### Validate OAuth configuration++`GET /api/oauth/validate` · `validateOAuth`++**Authorization**: `sessionAuth` or `tokenAuth`++**Responses**++=== "200: OAuth validation result"++ * `application/json`: `object`++ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+ <div class="trilium-multicolumn-column">++ | Property | Description |+ | --- | --- |+ | `valid` | `boolean` |+ | `errors` | `array of string` |++ </div>+ <div class="trilium-multicolumn-column">++ ```json+ {+ "valid": true,+ "errors": [+ "string"+ ]+ }+ ```++ </div>+ </div>++## Notes++Core note operations++### Get note metadata++`GET /api/notes/{noteId}` · `getNote`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `noteId` <br>_required_ | `string` <br>12-character note ID |++**Responses**++=== "200: Note metadata"++ * `application/json`: `Note`++ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+ <div class="trilium-multicolumn-column">++ | Property | Description |+ | --- | --- |+ | `noteId` <br>_required_ | `string` <br>12-character note ID |+ | `title` <br>_required_ | `string` <br>Note title |+ | `type` <br>_required_ | `NoteType` <br>One of `text`, `code`, `render`, `file`, `image`, `search`, `relationMap`, `book`, `noteMap`, `mermaid`, `canvas`, `webView`, `launcher`, `doc`, `contentWidget`, `mindMap`, `geoMap`. |+ | `mime` <br>_required_ | `string` <br>MIME type |+ | `isProtected` <br>_required_ | `boolean` <br>Whether note is protected |+ | `blobId` | `string` <br>ID of content blob |+ | `dateCreated` | `string (date-time)` |+ | `dateModified` | `string (date-time)` |+ | `utcDateCreated` | `string (date-time)` |+ | `utcDateModified` | `string (date-time)` |++ </div>+ <div class="trilium-multicolumn-column">++ ```json+ {+ "noteId": "ur11rSfHkzeV",+ "title": "string",+ "type": "text",+ "mime": "text/html",+ "isProtected": true,+ "blobId": "string",+ "dateCreated": "2019-08-24T14:15:22Z",+ "dateModified": "2019-08-24T14:15:22Z",+ "utcDateCreated": "2019-08-24T14:15:22Z",+ "utcDateModified": "2019-08-24T14:15:22Z"+ }+ ```++ </div>+ </div>++=== "404: Note not found"++ No content.++### Delete note++`DELETE /api/notes/{noteId}` · `deleteNote`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `noteId` <br>_required_ | `string` <br>12-character note ID |++**Query parameters**++| Name | Description |+| --- | --- |+| `taskId` <br>_required_ | `string` |+| `eraseNotes` | `boolean` |+| `last` <br>_required_ | `boolean` |++**Responses**++=== "204: Note deleted"++ No content.++=== "404: Note not found"++ No content.++### Get note content++`GET /api/notes/{noteId}/blob` · `getNoteContent`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `noteId` <br>_required_ | `string` <br>12-character note ID |++**Responses**++=== "200: Note content"++ === "`text/html`: `string`"++ === "`text/plain`: `string`"++ === "`application/json`: `object`"++ ```json+ {}+ ```++ === "`application/octet-stream`: `string (binary)`"++=== "404: Note not found"++ No content.++### Update note content++`PUT /api/notes/{noteId}/data` · `updateNoteContent`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `noteId` <br>_required_ | `string` <br>12-character note ID |++**Request body** (required)++* `application/json`: `object`++<div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+<div class="trilium-multicolumn-column">++| Property | Description |+| --- | --- |+| `content` <br>_required_ | `string` |+| `attachments` | `array of Attachment` |++</div>+<div class="trilium-multicolumn-column">++```json+{+ "content": "string",+ "attachments": [+ {+ "attachmentId": "string",+ "ownerId": "string",+ "role": "image",+ "mime": "string",+ "title": "string",+ "blobId": "string",+ "dateModified": "2019-08-24T14:15:22Z",+ "utcDateModified": "2019-08-24T14:15:22Z"+ }+ ]+}+```++</div>+</div>++**Responses**++=== "204: Content updated"++ No content.++=== "404: Note not found"++ No content.++### Get note timestamps++`GET /api/notes/{noteId}/metadata` · `getNoteMetadata`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `noteId` <br>_required_ | `string` <br>12-character note ID |++**Responses**++=== "200: Note timestamps"++ * `application/json`: `Timestamps`++ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+ <div class="trilium-multicolumn-column">++ | Property | Description |+ | --- | --- |+ | `dateCreated` | `string (date-time)` |+ | `dateModified` | `string (date-time)` |+ | `utcDateCreated` | `string (date-time)` |+ | `utcDateModified` | `string (date-time)` |++ </div>+ <div class="trilium-multicolumn-column">++ ```json+ {+ "dateCreated": "2019-08-24T14:15:22Z",+ "dateModified": "2019-08-24T14:15:22Z",+ "utcDateCreated": "2019-08-24T14:15:22Z",+ "utcDateModified": "2019-08-24T14:15:22Z"+ }+ ```++ </div>+ </div>++=== "404: Note not found"++ No content.++### Change note title++`PUT /api/notes/{noteId}/title` · `updateNoteTitle`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `noteId` <br>_required_ | `string` <br>12-character note ID |++**Request body** (required)++* `application/json`: `object`++<div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+<div class="trilium-multicolumn-column">++| Property | Description |+| --- | --- |+| `title` <br>_required_ | `string` |++</div>+<div class="trilium-multicolumn-column">++```json+{+ "title": "string"+}+```++</div>+</div>++**Responses**++=== "204: Title updated"++ No content.++=== "404: Note not found"++ No content.++### Change note type and MIME++`PUT /api/notes/{noteId}/type` · `updateNoteType`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `noteId` <br>_required_ | `string` <br>12-character note ID |++**Request body** (required)++* `application/json`: `object`++<div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+<div class="trilium-multicolumn-column">++| Property | Description |+| --- | --- |+| `type` <br>_required_ | `NoteType` <br>One of `text`, `code`, `render`, `file`, `image`, `search`, `relationMap`, `book`, `noteMap`, `mermaid`, `canvas`, `webView`, `launcher`, `doc`, `contentWidget`, `mindMap`, `geoMap`. |+| `mime` <br>_required_ | `string` |++</div>+<div class="trilium-multicolumn-column">++```json+{+ "type": "text",+ "mime": "string"+}+```++</div>+</div>++**Responses**++=== "204: Type updated"++ No content.++=== "404: Note not found"++ No content.++### Protect or unprotect note++`PUT /api/notes/{noteId}/protect/{isProtected}` · `protectNote`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `noteId` <br>_required_ | `string` <br>12-character note ID |+| `isProtected` <br>_required_ | `boolean` |++**Query parameters**++| Name | Description |+| --- | --- |+| `subtree` | `boolean` |++**Responses**++=== "204: Protection status updated"++ No content.++=== "404: Note not found"++ No content.++### Undelete note++`PUT /api/notes/{noteId}/undelete` · `undeleteNote`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `noteId` <br>_required_ | `string` <br>12-character note ID |++**Responses**++=== "204: Note undeleted"++ No content.++=== "404: Note not found"++ No content.++### Create new note++`POST /api/notes/{parentNoteId}/children` · `createNote`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `parentNoteId` <br>_required_ | `string` |++**Query parameters**++| Name | Description |+| --- | --- |+| `target` | `string` <br>One of `after`, `into`. |+| `targetBranchId` | `string` |++**Request body** (required)++* `application/json`: `CreateNoteRequest`++<div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+<div class="trilium-multicolumn-column">++| Property | Description |+| --- | --- |+| `title` <br>_required_ | `string` |+| `content` | `string` |+| `type` <br>_required_ | `NoteType` <br>One of `text`, `code`, `render`, `file`, `image`, `search`, `relationMap`, `book`, `noteMap`, `mermaid`, `canvas`, `webView`, `launcher`, `doc`, `contentWidget`, `mindMap`, `geoMap`. |+| `mime` | `string` |+| `isProtected` | `boolean` |+| `isExpanded` | `boolean` |+| `notePosition` | `integer` |+| `prefix` | `string` |+| `parentNoteId` | `string` |+| `templateNoteId` | `string` |++</div>+<div class="trilium-multicolumn-column">++```json+{+ "title": "string",+ "content": "string",+ "type": "text",+ "mime": "string",+ "isProtected": true,+ "isExpanded": true,+ "notePosition": 0,+ "prefix": "string",+ "parentNoteId": "string",+ "templateNoteId": "string"+}+```++</div>+</div>++**Responses**++=== "201: Note created"++ * `application/json`: `object`++ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+ <div class="trilium-multicolumn-column">++ | Property | Description |+ | --- | --- |+ | `note` | `Note` |+ | `branch` | `Branch` |++ </div>+ <div class="trilium-multicolumn-column">++ ```json+ {+ "note": {+ "noteId": "ur11rSfHkzeV",+ "title": "string",+ "type": "text",+ "mime": "text/html",+ "isProtected": true,+ "blobId": "string",+ "dateCreated": "2019-08-24T14:15:22Z",+ "dateModified": "2019-08-24T14:15:22Z",+ "utcDateCreated": "2019-08-24T14:15:22Z",+ "utcDateModified": "2019-08-24T14:15:22Z"+ },+ "branch": {+ "branchId": "string",+ "noteId": "string",+ "parentNoteId": "string",+ "notePosition": 0,+ "prefix": "string",+ "isExpanded": true+ }+ }+ ```++ </div>+ </div>++### Duplicate note subtree++`POST /api/notes/{noteId}/duplicate/{parentNoteId}` · `duplicateNote`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `noteId` <br>_required_ | `string` <br>12-character note ID |+| `parentNoteId` <br>_required_ | `string` |++**Responses**++=== "201: Note duplicated"++ * `application/json`: `Note`++ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+ <div class="trilium-multicolumn-column">++ | Property | Description |+ | --- | --- |+ | `noteId` <br>_required_ | `string` <br>12-character note ID |+ | `title` <br>_required_ | `string` <br>Note title |+ | `type` <br>_required_ | `NoteType` <br>One of `text`, `code`, `render`, `file`, `image`, `search`, `relationMap`, `book`, `noteMap`, `mermaid`, `canvas`, `webView`, `launcher`, `doc`, `contentWidget`, `mindMap`, `geoMap`. |+ | `mime` <br>_required_ | `string` <br>MIME type |+ | `isProtected` <br>_required_ | `boolean` <br>Whether note is protected |+ | `blobId` | `string` <br>ID of content blob |+ | `dateCreated` | `string (date-time)` |+ | `dateModified` | `string (date-time)` |+ | `utcDateCreated` | `string (date-time)` |+ | `utcDateModified` | `string (date-time)` |++ </div>+ <div class="trilium-multicolumn-column">++ ```json+ {+ "noteId": "ur11rSfHkzeV",+ "title": "string",+ "type": "text",+ "mime": "text/html",+ "isProtected": true,+ "blobId": "string",+ "dateCreated": "2019-08-24T14:15:22Z",+ "dateModified": "2019-08-24T14:15:22Z",+ "utcDateCreated": "2019-08-24T14:15:22Z",+ "utcDateModified": "2019-08-24T14:15:22Z"+ }+ ```++ </div>+ </div>++### Force save revision++`POST /api/notes/{noteId}/revision` · `saveRevision`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `noteId` <br>_required_ | `string` <br>12-character note ID |++**Responses**++=== "201: Revision saved"++ * `application/json`: `Revision`++ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+ <div class="trilium-multicolumn-column">++ | Property | Description |+ | --- | --- |+ | `revisionId` | `string` |+ | `noteId` | `string` |+ | `title` | `string` |+ | `type` | `NoteType` <br>One of `text`, `code`, `render`, `file`, `image`, `search`, `relationMap`, `book`, `noteMap`, `mermaid`, `canvas`, `webView`, `launcher`, `doc`, `contentWidget`, `mindMap`, `geoMap`. |+ | `mime` | `string` |+ | `dateCreated` | `string (date-time)` |+ | `utcDateCreated` | `string (date-time)` |++ </div>+ <div class="trilium-multicolumn-column">++ ```json+ {+ "revisionId": "string",+ "noteId": "string",+ "title": "string",+ "type": "text",+ "mime": "string",+ "dateCreated": "2019-08-24T14:15:22Z",+ "utcDateCreated": "2019-08-24T14:15:22Z"+ }+ ```++ </div>+ </div>++### Sort child notes++`PUT /api/notes/{noteId}/sort-children` · `sortChildren`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `noteId` <br>_required_ | `string` <br>12-character note ID |++**Request body** (required)++* `application/json`: `object`++<div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+<div class="trilium-multicolumn-column">++| Property | Description |+| --- | --- |+| `sortBy` | `string` <br>One of `title`, `dateCreated`, `dateModified`. |+| `sortDirection` | `string` <br>One of `asc`, `desc`. |+| `foldersFirst` | `boolean` |+| `sortNatural` | `boolean` |+| `sortLocale` | `string` |++</div>+<div class="trilium-multicolumn-column">++```json+{+ "sortBy": "title",+ "sortDirection": "asc",+ "foldersFirst": true,+ "sortNatural": true,+ "sortLocale": "string"+}+```++</div>+</div>++**Responses**++=== "204: Children sorted"++ No content.++### Convert note to attachment++`POST /api/notes/{noteId}/convert-to-attachment` · `convertToAttachment`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `noteId` <br>_required_ | `string` <br>12-character note ID |++**Responses**++=== "200: Note converted to attachment"++ * `application/json`: `Attachment`++ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+ <div class="trilium-multicolumn-column">++ | Property | Description |+ | --- | --- |+ | `attachmentId` <br>_required_ | `string` |+ | `ownerId` <br>_required_ | `string` |+ | `role` <br>_required_ | `string` <br>One of `image`, `file`. |+ | `mime` <br>_required_ | `string` |+ | `title` <br>_required_ | `string` |+ | `blobId` | `string` |+ | `dateModified` | `string (date-time)` |+ | `utcDateModified` | `string (date-time)` |++ </div>+ <div class="trilium-multicolumn-column">++ ```json+ {+ "attachmentId": "string",+ "ownerId": "string",+ "role": "image",+ "mime": "string",+ "title": "string",+ "blobId": "string",+ "dateModified": "2019-08-24T14:15:22Z",+ "utcDateModified": "2019-08-24T14:15:22Z"+ }+ ```++ </div>+ </div>++### Upload file to note++`PUT /api/notes/{noteId}/file` · `uploadFileToNote`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `noteId` <br>_required_ | `string` <br>12-character note ID |++**Request body** (required)++* `multipart/form-data`: `object`++| Property | Description |+| --- | --- |+| `upload` | `string (binary)` |++**Responses**++=== "204: File uploaded"++ No content.++### Open file note++`GET /api/notes/{noteId}/open` · `openFileNote`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `noteId` <br>_required_ | `string` <br>12-character note ID |++**Responses**++=== "200: File content"++ * `application/octet-stream`: `string (binary)`++### Download file note++`GET /api/notes/download/{noteId}` · `downloadFileNote`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `noteId` <br>_required_ | `string` <br>12-character note ID |++**Responses**++=== "200: File content"++ * `application/octet-stream`: `string (binary)`++### Download file note (alternative path)++`GET /api/notes/{noteId}/download` · `downloadFileNoteAlt`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `noteId` <br>_required_ | `string` <br>12-character note ID |++**Responses**++=== "200: File content"++ * `application/octet-stream`: `string (binary)`++### Save note to temp directory++`POST /api/notes/{noteId}/save-to-tmp-dir` · `saveToTmpDir`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `noteId` <br>_required_ | `string` <br>12-character note ID |++**Responses**++=== "200: File saved to temp directory"++ * `application/json`: `object`++ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+ <div class="trilium-multicolumn-column">++ | Property | Description |+ | --- | --- |+ | `filePath` | `string` |++ </div>+ <div class="trilium-multicolumn-column">++ ```json+ {+ "filePath": "string"+ }+ ```++ </div>+ </div>++### Update note from modified temp file++`POST /api/notes/{noteId}/upload-modified-file` · `uploadModifiedFile`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `noteId` <br>_required_ | `string` <br>12-character note ID |++**Request body** (required)++* `application/json`: `object`++<div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+<div class="trilium-multicolumn-column">++| Property | Description |+| --- | --- |+| `filePath` <br>_required_ | `string` |++</div>+<div class="trilium-multicolumn-column">++```json+{+ "filePath": "string"+}+```++</div>+</div>++**Responses**++=== "204: Note updated from file"++ No content.++### Get image from note++`GET /api/images/{noteId}/{filename}` · `getNoteImage`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `noteId` <br>_required_ | `string` <br>12-character note ID |+| `filename` <br>_required_ | `string` |++**Responses**++=== "200: Image content"++ * `image/*`: `string (binary)`++### Update image note++`PUT /api/images/{noteId}` · `updateImageNote`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `noteId` <br>_required_ | `string` <br>12-character note ID |++**Request body** (required)++* `multipart/form-data`: `object`++| Property | Description |+| --- | --- |+| `upload` | `string (binary)` |++**Responses**++=== "204: Image updated"++ No content.++### Execute bulk action++`POST /api/bulk-action/execute` · `executeBulkAction`++**Authorization**: `sessionAuth` or `tokenAuth`++**Request body** (required)++* `application/json`: `object`++<div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+<div class="trilium-multicolumn-column">++| Property | Description |+| --- | --- |+| `action` | `string` |+| `noteIds` | `array of string` |++</div>+<div class="trilium-multicolumn-column">++```json+{+ "action": "string",+ "noteIds": [+ "string"+ ]+}+```++</div>+</div>++**Responses**++=== "200: Bulk action results"++ No content.++### Get affected notes count++`POST /api/bulk-action/affected-notes` · `getAffectedNotesCount`++**Authorization**: `sessionAuth` or `tokenAuth`++**Request body** (required)++* `application/json`: `object`++<div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+<div class="trilium-multicolumn-column">++| Property | Description |+| --- | --- |+| `action` | `string` |+| `noteIds` | `array of string` |++</div>+<div class="trilium-multicolumn-column">++```json+{+ "action": "string",+ "noteIds": [+ "string"+ ]+}+```++</div>+</div>++**Responses**++=== "200: Affected notes count"++ * `application/json`: `object`++ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+ <div class="trilium-multicolumn-column">++ | Property | Description |+ | --- | --- |+ | `count` | `integer` |++ </div>+ <div class="trilium-multicolumn-column">++ ```json+ {+ "count": 0+ }+ ```++ </div>+ </div>++### Preview note deletion++`POST /api/delete-notes-preview` · `previewNoteDeletion`++**Authorization**: `sessionAuth` or `tokenAuth`++**Request body** (required)++* `application/json`: `object`++<div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+<div class="trilium-multicolumn-column">++| Property | Description |+| --- | --- |+| `branchIdsToDelete` | `array of string` |+| `deleteAllClones` | `boolean` |++</div>+<div class="trilium-multicolumn-column">++```json+{+ "branchIdsToDelete": [+ "string"+ ],+ "deleteAllClones": true+}+```++</div>+</div>++**Responses**++=== "200: Deletion preview"++ * `application/json`: `object`++ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+ <div class="trilium-multicolumn-column">++ | Property | Description |+ | --- | --- |+ | `notesToDelete` | `array of string` |++ </div>+ <div class="trilium-multicolumn-column">++ ```json+ {+ "notesToDelete": [+ "string"+ ]+ }+ ```++ </div>+ </div>++### Erase deleted notes++`POST /api/notes/erase-deleted-notes-now` · `eraseDeletedNotes`++**Authorization**: `sessionAuth` or `tokenAuth`++**Responses**++=== "204: Deleted notes erased"++ No content.++## Tree++Note tree structure and branches++### Get tree structure++`GET /api/tree` · `getTree`++**Authorization**: `sessionAuth` or `tokenAuth`++**Query parameters**++| Name | Description |+| --- | --- |+| `subTreeNoteId` | `string` <br>Limit tree to this note and descendants |++**Responses**++=== "200: Tree structure"++ * `application/json`: `object`++ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+ <div class="trilium-multicolumn-column">++ | Property | Description |+ | --- | --- |+ | `notes` | `array of Note` |+ | `branches` | `array of Branch` |+ | `attributes` | `array of Attribute` |++ </div>+ <div class="trilium-multicolumn-column">++ ```json+ {+ "notes": [+ {+ "noteId": "ur11rSfHkzeV",+ "title": "string",+ "type": "text",+ "mime": "text/html",+ "isProtected": true,+ "blobId": "string",+ "dateCreated": "2019-08-24T14:15:22Z",+ "dateModified": "2019-08-24T14:15:22Z",+ "utcDateCreated": "2019-08-24T14:15:22Z",+ "utcDateModified": "2019-08-24T14:15:22Z"+ }+ ],+ "branches": [+ {+ "branchId": "string",+ "noteId": "string",+ "parentNoteId": "string",+ "notePosition": 0,+ "prefix": "string",+ "isExpanded": true+ }+ ],+ "attributes": [+ {+ "attributeId": "string",+ "noteId": "string",+ "type": "label",+ "name": "string",+ "value": "string",+ "position": 0,+ "isInheritable": true+ }+ ]+ }+ ```++ </div>+ </div>++### Load specific notes++`POST /api/tree/load` · `loadNotes`++**Authorization**: `sessionAuth` or `tokenAuth`++**Request body** (required)++* `application/json`: `object`++<div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+<div class="trilium-multicolumn-column">++| Property | Description |+| --- | --- |+| `noteIds` <br>_required_ | `array of string` |++</div>+<div class="trilium-multicolumn-column">++```json+{+ "noteIds": [+ "string"+ ]+}+```++</div>+</div>++**Responses**++=== "200: Loaded notes"++ * `application/json`: `object`++ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+ <div class="trilium-multicolumn-column">++ | Property | Description |+ | --- | --- |+ | `notes` | `array of Note` |+ | `branches` | `array of Branch` |+ | `attributes` | `array of Attribute` |++ </div>+ <div class="trilium-multicolumn-column">++ ```json+ {+ "notes": [+ {+ "noteId": "ur11rSfHkzeV",+ "title": "string",+ "type": "text",+ "mime": "text/html",+ "isProtected": true,+ "blobId": "string",+ "dateCreated": "2019-08-24T14:15:22Z",+ "dateModified": "2019-08-24T14:15:22Z",+ "utcDateCreated": "2019-08-24T14:15:22Z",+ "utcDateModified": "2019-08-24T14:15:22Z"+ }+ ],+ "branches": [+ {+ "branchId": "string",+ "noteId": "string",+ "parentNoteId": "string",+ "notePosition": 0,+ "prefix": "string",+ "isExpanded": true+ }+ ],+ "attributes": [+ {+ "attributeId": "string",+ "noteId": "string",+ "type": "label",+ "name": "string",+ "value": "string",+ "position": 0,+ "isInheritable": true+ }+ ]+ }+ ```++ </div>+ </div>++### Delete branch++`DELETE /api/branches/{branchId}` · `deleteBranch`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `branchId` <br>_required_ | `string` |++**Query parameters**++| Name | Description |+| --- | --- |+| `taskId` <br>_required_ | `string` |+| `eraseNotes` | `boolean` |+| `last` <br>_required_ | `boolean` |++**Responses**++=== "200: Branch deleted"++ * `application/json`: `object`++ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+ <div class="trilium-multicolumn-column">++ | Property | Description |+ | --- | --- |+ | `noteDeleted` | `boolean` |++ </div>+ <div class="trilium-multicolumn-column">++ ```json+ {+ "noteDeleted": true+ }+ ```++ </div>+ </div>++### Move branch to new parent++`PUT /api/branches/{branchId}/move-to/{parentBranchId}` · `moveBranchToParent`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `branchId` <br>_required_ | `string` |+| `parentBranchId` <br>_required_ | `string` |++**Responses**++=== "204: Branch moved"++ No content.++### Move branch before another++`PUT /api/branches/{branchId}/move-before/{beforeBranchId}` · `moveBranchBefore`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `branchId` <br>_required_ | `string` |+| `beforeBranchId` <br>_required_ | `string` |++**Responses**++=== "204: Branch moved"++ No content.++### Move branch after another++`PUT /api/branches/{branchId}/move-after/{afterBranchId}` · `moveBranchAfter`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `branchId` <br>_required_ | `string` |+| `afterBranchId` <br>_required_ | `string` |++**Responses**++=== "204: Branch moved"++ No content.++### Set branch expanded state++`PUT /api/branches/{branchId}/expanded/{expanded}` · `setBranchExpanded`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `branchId` <br>_required_ | `string` |+| `expanded` <br>_required_ | `boolean` |++**Responses**++=== "204: Expanded state updated"++ No content.++### Set subtree expanded state++`PUT /api/branches/{branchId}/expanded-subtree/{expanded}` · `setSubtreeExpanded`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `branchId` <br>_required_ | `string` |+| `expanded` <br>_required_ | `boolean` |++**Responses**++=== "204: Subtree expanded state updated"++ No content.++### Set branch prefix++`PUT /api/branches/{branchId}/set-prefix` · `setBranchPrefix`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `branchId` <br>_required_ | `string` |++**Request body** (required)++* `application/json`: `object`++<div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+<div class="trilium-multicolumn-column">++| Property | Description |+| --- | --- |+| `prefix` | `string \| null` |++</div>+<div class="trilium-multicolumn-column">++```json+{+ "prefix": "string"+}+```++</div>+</div>++**Responses**++=== "204: Prefix updated"++ No content.++### Clone note to branch++`PUT /api/notes/{noteId}/clone-to-branch/{parentBranchId}` · `cloneToBranch`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `noteId` <br>_required_ | `string` <br>12-character note ID |+| `parentBranchId` <br>_required_ | `string` |++**Responses**++=== "200: Note cloned"++ * `application/json`: `Branch`++ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+ <div class="trilium-multicolumn-column">++ | Property | Description |+ | --- | --- |+ | `branchId` <br>_required_ | `string` <br>Branch ID (parentNoteId\_noteId) |+ | `noteId` <br>_required_ | `string` |+ | `parentNoteId` <br>_required_ | `string` |+ | `notePosition` <br>_required_ | `integer` |+ | `prefix` | `string \| null` |+ | `isExpanded` | `boolean` |++ </div>+ <div class="trilium-multicolumn-column">++ ```json+ {+ "branchId": "string",+ "noteId": "string",+ "parentNoteId": "string",+ "notePosition": 0,+ "prefix": "string",+ "isExpanded": true+ }+ ```++ </div>+ </div>++### Clone note to parent note++`PUT /api/notes/{noteId}/clone-to-note/{parentNoteId}` · `cloneToNote`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `noteId` <br>_required_ | `string` <br>12-character note ID |+| `parentNoteId` <br>_required_ | `string` |++**Responses**++=== "200: Note cloned"++ * `application/json`: `Branch`++ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+ <div class="trilium-multicolumn-column">++ | Property | Description |+ | --- | --- |+ | `branchId` <br>_required_ | `string` <br>Branch ID (parentNoteId\_noteId) |+ | `noteId` <br>_required_ | `string` |+ | `parentNoteId` <br>_required_ | `string` |+ | `notePosition` <br>_required_ | `integer` |+ | `prefix` | `string \| null` |+ | `isExpanded` | `boolean` |++ </div>+ <div class="trilium-multicolumn-column">++ ```json+ {+ "branchId": "string",+ "noteId": "string",+ "parentNoteId": "string",+ "notePosition": 0,+ "prefix": "string",+ "isExpanded": true+ }+ ```++ </div>+ </div>++### Clone note after branch++`PUT /api/notes/{noteId}/clone-after/{afterBranchId}` · `cloneAfterBranch`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `noteId` <br>_required_ | `string` <br>12-character note ID |+| `afterBranchId` <br>_required_ | `string` |++**Responses**++=== "200: Note cloned"++ * `application/json`: `Branch`++ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+ <div class="trilium-multicolumn-column">++ | Property | Description |+ | --- | --- |+ | `branchId` <br>_required_ | `string` <br>Branch ID (parentNoteId\_noteId) |+ | `noteId` <br>_required_ | `string` |+ | `parentNoteId` <br>_required_ | `string` |+ | `notePosition` <br>_required_ | `integer` |+ | `prefix` | `string \| null` |+ | `isExpanded` | `boolean` |++ </div>+ <div class="trilium-multicolumn-column">++ ```json+ {+ "branchId": "string",+ "noteId": "string",+ "parentNoteId": "string",+ "notePosition": 0,+ "prefix": "string",+ "isExpanded": true+ }+ ```++ </div>+ </div>++### Toggle note presence in parent++`PUT /api/notes/{noteId}/toggle-in-parent/{parentNoteId}/{present}` · `toggleInParent`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `noteId` <br>_required_ | `string` <br>12-character note ID |+| `parentNoteId` <br>_required_ | `string` |+| `present` <br>_required_ | `boolean` |++**Responses**++=== "204: Presence toggled"++ No content.++## Attributes++Note attributes and metadata++### Get effective note attributes++`GET /api/notes/{noteId}/attributes` · `getNoteAttributes`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `noteId` <br>_required_ | `string` <br>12-character note ID |++**Responses**++=== "200: Note attributes"++ * `application/json`: `array of Attribute`++ ```json+ [+ {+ "attributeId": "string",+ "noteId": "string",+ "type": "label",+ "name": "string",+ "value": "string",+ "position": 0,+ "isInheritable": true+ }+ ]+ ```++### Update all note attributes++`PUT /api/notes/{noteId}/attributes` · `updateNoteAttributes`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `noteId` <br>_required_ | `string` <br>12-character note ID |++**Request body** (required)++* `application/json`: `array of Attribute`++```json+[+ {+ "attributeId": "string",+ "noteId": "string",+ "type": "label",+ "name": "string",+ "value": "string",+ "position": 0,+ "isInheritable": true+ }+]+```++**Responses**++=== "204: Attributes updated"++ No content.++### Add note attribute++`POST /api/notes/{noteId}/attributes` · `addNoteAttribute`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `noteId` <br>_required_ | `string` <br>12-character note ID |++**Request body** (required)++* `application/json`: `Attribute`++<div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+<div class="trilium-multicolumn-column">++| Property | Description |+| --- | --- |+| `attributeId` <br>_required_ | `string` |+| `noteId` <br>_required_ | `string` |+| `type` <br>_required_ | `string` <br>One of `label`, `relation`. |+| `name` <br>_required_ | `string` |+| `value` <br>_required_ | `string` |+| `position` | `integer` |+| `isInheritable` | `boolean` |++</div>+<div class="trilium-multicolumn-column">++```json+{+ "attributeId": "string",+ "noteId": "string",+ "type": "label",+ "name": "string",+ "value": "string",+ "position": 0,+ "isInheritable": true+}+```++</div>+</div>++**Responses**++=== "201: Attribute added"++ * `application/json`: `Attribute`++ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+ <div class="trilium-multicolumn-column">++ | Property | Description |+ | --- | --- |+ | `attributeId` <br>_required_ | `string` |+ | `noteId` <br>_required_ | `string` |+ | `type` <br>_required_ | `string` <br>One of `label`, `relation`. |+ | `name` <br>_required_ | `string` |+ | `value` <br>_required_ | `string` |+ | `position` | `integer` |+ | `isInheritable` | `boolean` |++ </div>+ <div class="trilium-multicolumn-column">++ ```json+ {+ "attributeId": "string",+ "noteId": "string",+ "type": "label",+ "name": "string",+ "value": "string",+ "position": 0,+ "isInheritable": true+ }+ ```++ </div>+ </div>++### Delete attribute++`DELETE /api/notes/{noteId}/attributes/{attributeId}` · `deleteAttribute`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `noteId` <br>_required_ | `string` <br>12-character note ID |+| `attributeId` <br>_required_ | `string` |++**Responses**++=== "204: Attribute deleted"++ No content.++### Update single attribute++`PUT /api/notes/{noteId}/attribute` · `updateAttribute`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `noteId` <br>_required_ | `string` <br>12-character note ID |++**Request body** (required)++* `application/json`: `Attribute`++<div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+<div class="trilium-multicolumn-column">++| Property | Description |+| --- | --- |+| `attributeId` <br>_required_ | `string` |+| `noteId` <br>_required_ | `string` |+| `type` <br>_required_ | `string` <br>One of `label`, `relation`. |+| `name` <br>_required_ | `string` |+| `value` <br>_required_ | `string` |+| `position` | `integer` |+| `isInheritable` | `boolean` |++</div>+<div class="trilium-multicolumn-column">++```json+{+ "attributeId": "string",+ "noteId": "string",+ "type": "label",+ "name": "string",+ "value": "string",+ "position": 0,+ "isInheritable": true+}+```++</div>+</div>++**Responses**++=== "204: Attribute updated"++ No content.++### Set attribute value++`PUT /api/notes/{noteId}/set-attribute` · `setAttribute`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `noteId` <br>_required_ | `string` <br>12-character note ID |++**Request body** (required)++* `application/json`: `object`++<div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+<div class="trilium-multicolumn-column">++| Property | Description |+| --- | --- |+| `type` <br>_required_ | `string` <br>One of `label`, `relation`. |+| `name` <br>_required_ | `string` |+| `value` <br>_required_ | `string` |++</div>+<div class="trilium-multicolumn-column">++```json+{+ "type": "label",+ "name": "string",+ "value": "string"+}+```++</div>+</div>++**Responses**++=== "204: Attribute set"++ No content.++### Create relation++`PUT /api/notes/{noteId}/relations/{name}/to/{targetNoteId}` · `createRelation`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `noteId` <br>_required_ | `string` <br>12-character note ID |+| `name` <br>_required_ | `string` |+| `targetNoteId` <br>_required_ | `string` |++**Responses**++=== "204: Relation created"++ No content.++### Delete relation++`DELETE /api/notes/{noteId}/relations/{name}/to/{targetNoteId}` · `deleteRelation`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `noteId` <br>_required_ | `string` <br>12-character note ID |+| `name` <br>_required_ | `string` |+| `targetNoteId` <br>_required_ | `string` |++**Responses**++=== "204: Relation deleted"++ No content.++### Get attribute name suggestions++`GET /api/attribute-names` · `getAttributeNames`++**Authorization**: `sessionAuth` or `tokenAuth`++**Query parameters**++| Name | Description |+| --- | --- |+| `type` <br>_required_ | `string` <br>One of `label`, `relation`. |+| `query` | `string` |++**Responses**++=== "200: Attribute names"++ * `application/json`: `array of string`++ ```json+ [+ "string"+ ]+ ```++### Get values for attribute++`GET /api/attribute-values/{attributeName}` · `getAttributeValues`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `attributeName` <br>_required_ | `string` |++**Responses**++=== "200: Attribute values"++ * `application/json`: `array of string`++ ```json+ [+ "string"+ ]+ ```++## Attachments++File attachments++### Stream file with partial content support++`GET /api/attachments/{attachmentId}/open-partial` · `openPartialFileAttachment`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `attachmentId` <br>_required_ | `string` |++**Header parameters**++| Name | Description |+| --- | --- |+| `Range` | `string` |++**Responses**++=== "206: Partial content"++ * `application/octet-stream`: `string (binary)`++### Get note attachments++`GET /api/notes/{noteId}/attachments` · `getNoteAttachments`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `noteId` <br>_required_ | `string` <br>12-character note ID |++**Responses**++=== "200: Note attachments"++ * `application/json`: `array of Attachment`++ ```json+ [+ {+ "attachmentId": "string",+ "ownerId": "string",+ "role": "image",+ "mime": "string",+ "title": "string",+ "blobId": "string",+ "dateModified": "2019-08-24T14:15:22Z",+ "utcDateModified": "2019-08-24T14:15:22Z"+ }+ ]+ ```++### Save attachment++`POST /api/notes/{noteId}/attachments` · `saveAttachment`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `noteId` <br>_required_ | `string` <br>12-character note ID |++**Query parameters**++| Name | Description |+| --- | --- |+| `matchBy` | `string` <br>One of `attachmentId`, `title`. |++**Request body** (required)++* `application/json`: `Attachment`++<div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+<div class="trilium-multicolumn-column">++| Property | Description |+| --- | --- |+| `attachmentId` <br>_required_ | `string` |+| `ownerId` <br>_required_ | `string` |+| `role` <br>_required_ | `string` <br>One of `image`, `file`. |+| `mime` <br>_required_ | `string` |+| `title` <br>_required_ | `string` |+| `blobId` | `string` |+| `dateModified` | `string (date-time)` |+| `utcDateModified` | `string (date-time)` |++</div>+<div class="trilium-multicolumn-column">++```json+{+ "attachmentId": "string",+ "ownerId": "string",+ "role": "image",+ "mime": "string",+ "title": "string",+ "blobId": "string",+ "dateModified": "2019-08-24T14:15:22Z",+ "utcDateModified": "2019-08-24T14:15:22Z"+}+```++</div>+</div>++**Responses**++=== "201: Attachment saved"++ * `application/json`: `Attachment`++ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+ <div class="trilium-multicolumn-column">++ | Property | Description |+ | --- | --- |+ | `attachmentId` <br>_required_ | `string` |+ | `ownerId` <br>_required_ | `string` |+ | `role` <br>_required_ | `string` <br>One of `image`, `file`. |+ | `mime` <br>_required_ | `string` |+ | `title` <br>_required_ | `string` |+ | `blobId` | `string` |+ | `dateModified` | `string (date-time)` |+ | `utcDateModified` | `string (date-time)` |++ </div>+ <div class="trilium-multicolumn-column">++ ```json+ {+ "attachmentId": "string",+ "ownerId": "string",+ "role": "image",+ "mime": "string",+ "title": "string",+ "blobId": "string",+ "dateModified": "2019-08-24T14:15:22Z",+ "utcDateModified": "2019-08-24T14:15:22Z"+ }+ ```++ </div>+ </div>++### Upload attachment file++`POST /api/notes/{noteId}/attachments/upload` · `uploadAttachment`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `noteId` <br>_required_ | `string` <br>12-character note ID |++**Query parameters**++| Name | Description |+| --- | --- |+| `link` | `boolean` <br>`true` answers with a link to the attachment instead of an image URL, and stores a picture as uploaded, without compressing it or shortening its name. |++**Request body** (required)++* `multipart/form-data`: `object`++| Property | Description |+| --- | --- |+| `upload` | `string (binary)` |++**Responses**++=== "201: Attachment uploaded"++ * `application/json`: `Attachment`++ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+ <div class="trilium-multicolumn-column">++ | Property | Description |+ | --- | --- |+ | `attachmentId` <br>_required_ | `string` |+ | `ownerId` <br>_required_ | `string` |+ | `role` <br>_required_ | `string` <br>One of `image`, `file`. |+ | `mime` <br>_required_ | `string` |+ | `title` <br>_required_ | `string` |+ | `blobId` | `string` |+ | `dateModified` | `string (date-time)` |+ | `utcDateModified` | `string (date-time)` |++ </div>+ <div class="trilium-multicolumn-column">++ ```json+ {+ "attachmentId": "string",+ "ownerId": "string",+ "role": "image",+ "mime": "string",+ "title": "string",+ "blobId": "string",+ "dateModified": "2019-08-24T14:15:22Z",+ "utcDateModified": "2019-08-24T14:15:22Z"+ }+ ```++ </div>+ </div>++### Get attachment metadata++`GET /api/attachments/{attachmentId}` · `getAttachment`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `attachmentId` <br>_required_ | `string` |++**Responses**++=== "200: Attachment metadata"++ * `application/json`: `Attachment`++ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+ <div class="trilium-multicolumn-column">++ | Property | Description |+ | --- | --- |+ | `attachmentId` <br>_required_ | `string` |+ | `ownerId` <br>_required_ | `string` |+ | `role` <br>_required_ | `string` <br>One of `image`, `file`. |+ | `mime` <br>_required_ | `string` |+ | `title` <br>_required_ | `string` |+ | `blobId` | `string` |+ | `dateModified` | `string (date-time)` |+ | `utcDateModified` | `string (date-time)` |++ </div>+ <div class="trilium-multicolumn-column">++ ```json+ {+ "attachmentId": "string",+ "ownerId": "string",+ "role": "image",+ "mime": "string",+ "title": "string",+ "blobId": "string",+ "dateModified": "2019-08-24T14:15:22Z",+ "utcDateModified": "2019-08-24T14:15:22Z"+ }+ ```++ </div>+ </div>++### Delete attachment++`DELETE /api/attachments/{attachmentId}` · `deleteAttachment`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `attachmentId` <br>_required_ | `string` |++**Responses**++=== "204: Attachment deleted"++ No content.++### Get attachment content++`GET /api/attachments/{attachmentId}/blob` · `getAttachmentBlob`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `attachmentId` <br>_required_ | `string` |++**Query parameters**++| Name | Description |+| --- | --- |+| `preview` | `boolean` |++**Responses**++=== "200: Attachment content"++ * `application/octet-stream`: `string (binary)`++### Rename attachment++`PUT /api/attachments/{attachmentId}/rename` · `renameAttachment`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `attachmentId` <br>_required_ | `string` |++**Request body** (required)++* `application/json`: `object`++<div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+<div class="trilium-multicolumn-column">++| Property | Description |+| --- | --- |+| `title` <br>_required_ | `string` |++</div>+<div class="trilium-multicolumn-column">++```json+{+ "title": "string"+}+```++</div>+</div>++**Responses**++=== "204: Attachment renamed"++ No content.++### Convert attachment to note++`POST /api/attachments/{attachmentId}/convert-to-note` · `convertAttachmentToNote`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `attachmentId` <br>_required_ | `string` |++**Responses**++=== "200: Attachment converted to note"++ * `application/json`: `Note`++ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+ <div class="trilium-multicolumn-column">++ | Property | Description |+ | --- | --- |+ | `noteId` <br>_required_ | `string` <br>12-character note ID |+ | `title` <br>_required_ | `string` <br>Note title |+ | `type` <br>_required_ | `NoteType` <br>One of `text`, `code`, `render`, `file`, `image`, `search`, `relationMap`, `book`, `noteMap`, `mermaid`, `canvas`, `webView`, `launcher`, `doc`, `contentWidget`, `mindMap`, `geoMap`. |+ | `mime` <br>_required_ | `string` <br>MIME type |+ | `isProtected` <br>_required_ | `boolean` <br>Whether note is protected |+ | `blobId` | `string` <br>ID of content blob |+ | `dateCreated` | `string (date-time)` |+ | `dateModified` | `string (date-time)` |+ | `utcDateCreated` | `string (date-time)` |+ | `utcDateModified` | `string (date-time)` |++ </div>+ <div class="trilium-multicolumn-column">++ ```json+ {+ "noteId": "ur11rSfHkzeV",+ "title": "string",+ "type": "text",+ "mime": "text/html",+ "isProtected": true,+ "blobId": "string",+ "dateCreated": "2019-08-24T14:15:22Z",+ "dateModified": "2019-08-24T14:15:22Z",+ "utcDateCreated": "2019-08-24T14:15:22Z",+ "utcDateModified": "2019-08-24T14:15:22Z"+ }+ ```++ </div>+ </div>++### Update attachment file++`PUT /api/attachments/{attachmentId}/file` · `updateAttachmentFile`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `attachmentId` <br>_required_ | `string` |++**Request body** (required)++* `multipart/form-data`: `object`++| Property | Description |+| --- | --- |+| `upload` | `string (binary)` |++**Responses**++=== "204: Attachment file updated"++ No content.++### Open attachment++`GET /api/attachments/{attachmentId}/open` · `openAttachment`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `attachmentId` <br>_required_ | `string` |++**Responses**++=== "200: Attachment content"++ * `application/octet-stream`: `string (binary)`++### Download attachment++`GET /api/attachments/download/{attachmentId}` · `downloadAttachment`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `attachmentId` <br>_required_ | `string` |++**Responses**++=== "200: Attachment content"++ * `application/octet-stream`: `string (binary)`++### Download attachment (alternative path)++`GET /api/attachments/{attachmentId}/download` · `downloadAttachmentAlt`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `attachmentId` <br>_required_ | `string` |++**Responses**++=== "200: Attachment content"++ * `application/octet-stream`: `string (binary)`++### Get all attachment information++`GET /api/attachments/{attachmentId}/all` · `getAllAttachmentInfo`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `attachmentId` <br>_required_ | `string` |++**Responses**++=== "200: Complete attachment information"++ * `application/json`: `object`++ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+ <div class="trilium-multicolumn-column">++ | Property | Description |+ | --- | --- |+ | `attachmentId` | `string` |+ | `title` | `string` |+ | `mime` | `string` |+ | `isProtected` | `boolean` |+ | `position` | `integer` |+ | `contentLength` | `integer` |+ | `ownerId` | `string` |+ | `dateCreated` | `string (date-time)` |+ | `dateModified` | `string (date-time)` |++ </div>+ <div class="trilium-multicolumn-column">++ ```json+ {+ "attachmentId": "string",+ "title": "string",+ "mime": "string",+ "isProtected": true,+ "position": 0,+ "contentLength": 0,+ "ownerId": "string",+ "dateCreated": "2019-08-24T14:15:22Z",+ "dateModified": "2019-08-24T14:15:22Z"+ }+ ```++ </div>+ </div>++### Save attachment to temporary directory++`POST /api/attachments/{attachmentId}/save-to-tmp-dir` · `saveAttachmentToTmpDir`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `attachmentId` <br>_required_ | `string` |++**Responses**++=== "200: Attachment saved to temporary directory"++ * `application/json`: `object`++ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+ <div class="trilium-multicolumn-column">++ | Property | Description |+ | --- | --- |+ | `tmpPath` | `string` <br>Path to temporary file |+ | `success` | `boolean` |++ </div>+ <div class="trilium-multicolumn-column">++ ```json+ {+ "tmpPath": "string",+ "success": true+ }+ ```++ </div>+ </div>++### Upload modified attachment file++`POST /api/attachments/{attachmentId}/upload-modified-file` · `uploadModifiedAttachmentFile`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `attachmentId` <br>_required_ | `string` |++**Request body** (required)++* `multipart/form-data`: `object`++| Property | Description |+| --- | --- |+| `upload` | `string (binary)` |++**Responses**++=== "200: Modified file uploaded"++ * `application/json`: `object`++ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+ <div class="trilium-multicolumn-column">++ | Property | Description |+ | --- | --- |+ | `success` | `boolean` |++ </div>+ <div class="trilium-multicolumn-column">++ ```json+ {+ "success": true+ }+ ```++ </div>+ </div>++### Get attached image++`GET /api/attachments/{attachmentId}/image/{filename}` · `getAttachmentImage`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `attachmentId` <br>_required_ | `string` |+| `filename` <br>_required_ | `string` |++**Responses**++=== "200: Image content"++ * `image/*`: `string (binary)`++### Erase unused attachments++`POST /api/notes/erase-unused-attachments-now` · `eraseUnusedAttachments`++**Authorization**: `sessionAuth` or `tokenAuth`++**Responses**++=== "204: Unused attachments erased"++ No content.++## Revisions++Note revision history++### Get note revisions++`GET /api/notes/{noteId}/revisions` · `getNoteRevisions`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `noteId` <br>_required_ | `string` <br>12-character note ID |++**Responses**++=== "200: Note revisions"++ * `application/json`: `array of Revision`++ ```json+ [+ {+ "revisionId": "string",+ "noteId": "string",+ "title": "string",+ "type": "text",+ "mime": "string",+ "dateCreated": "2019-08-24T14:15:22Z",+ "utcDateCreated": "2019-08-24T14:15:22Z"+ }+ ]+ ```++### Erase all note revisions++`DELETE /api/notes/{noteId}/revisions` · `eraseNoteRevisions`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `noteId` <br>_required_ | `string` <br>12-character note ID |++**Responses**++=== "204: Revisions erased"++ No content.++### Get revision details++`GET /api/revisions/{revisionId}` · `getRevision`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `revisionId` <br>_required_ | `string` |++**Responses**++=== "200: Revision details"++ * `application/json`: `Revision`++ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+ <div class="trilium-multicolumn-column">++ | Property | Description |+ | --- | --- |+ | `revisionId` | `string` |+ | `noteId` | `string` |+ | `title` | `string` |+ | `type` | `NoteType` <br>One of `text`, `code`, `render`, `file`, `image`, `search`, `relationMap`, `book`, `noteMap`, `mermaid`, `canvas`, `webView`, `launcher`, `doc`, `contentWidget`, `mindMap`, `geoMap`. |+ | `mime` | `string` |+ | `dateCreated` | `string (date-time)` |+ | `utcDateCreated` | `string (date-time)` |++ </div>+ <div class="trilium-multicolumn-column">++ ```json+ {+ "revisionId": "string",+ "noteId": "string",+ "title": "string",+ "type": "text",+ "mime": "string",+ "dateCreated": "2019-08-24T14:15:22Z",+ "utcDateCreated": "2019-08-24T14:15:22Z"+ }+ ```++ </div>+ </div>++### Erase revision++`DELETE /api/revisions/{revisionId}` · `eraseRevision`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `revisionId` <br>_required_ | `string` |++**Responses**++=== "204: Revision erased"++ No content.++### Get revision content++`GET /api/revisions/{revisionId}/blob` · `getRevisionBlob`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `revisionId` <br>_required_ | `string` |++**Query parameters**++| Name | Description |+| --- | --- |+| `preview` | `boolean` |++**Responses**++=== "200: Revision content"++ * `text/html`: `string`+ * `text/plain`: `string`+ * `application/octet-stream`: `string (binary)`++### Restore revision++`POST /api/revisions/{revisionId}/restore` · `restoreRevision`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `revisionId` <br>_required_ | `string` |++**Responses**++=== "200: Revision restored"++ * `application/json`: `Note`++ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+ <div class="trilium-multicolumn-column">++ | Property | Description |+ | --- | --- |+ | `noteId` <br>_required_ | `string` <br>12-character note ID |+ | `title` <br>_required_ | `string` <br>Note title |+ | `type` <br>_required_ | `NoteType` <br>One of `text`, `code`, `render`, `file`, `image`, `search`, `relationMap`, `book`, `noteMap`, `mermaid`, `canvas`, `webView`, `launcher`, `doc`, `contentWidget`, `mindMap`, `geoMap`. |+ | `mime` <br>_required_ | `string` <br>MIME type |+ | `isProtected` <br>_required_ | `boolean` <br>Whether note is protected |+ | `blobId` | `string` <br>ID of content blob |+ | `dateCreated` | `string (date-time)` |+ | `dateModified` | `string (date-time)` |+ | `utcDateCreated` | `string (date-time)` |+ | `utcDateModified` | `string (date-time)` |++ </div>+ <div class="trilium-multicolumn-column">++ ```json+ {+ "noteId": "ur11rSfHkzeV",+ "title": "string",+ "type": "text",+ "mime": "text/html",+ "isProtected": true,+ "blobId": "string",+ "dateCreated": "2019-08-24T14:15:22Z",+ "dateModified": "2019-08-24T14:15:22Z",+ "utcDateCreated": "2019-08-24T14:15:22Z",+ "utcDateModified": "2019-08-24T14:15:22Z"+ }+ ```++ </div>+ </div>++### Download revision++`GET /api/revisions/{revisionId}/download` · `downloadRevision`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `revisionId` <br>_required_ | `string` |++**Responses**++=== "200: Revision content"++ * `application/octet-stream`: `string (binary)`++### Cleanup old revisions++`POST /api/revisions/erase-all-excess-revisions` · `eraseExcessRevisions`++**Authorization**: `sessionAuth` or `tokenAuth`++**Request body**++* `application/json`: `object`++<div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+<div class="trilium-multicolumn-column">++| Property | Description |+| --- | --- |+| `snapshotsToKeep` | `integer` <br>Snapshots to keep per note, standing in for the revisionSnapshotNumberLimit option. -1 keeps every snapshot, 0 keeps none. Omitted, the option applies. A note carrying a valid #versioningLimit follows its own label instead. |+| `keepNamedSnapshots` | `boolean` <br>Spare named snapshots (those with a description) from erasure and leave them out of the count, so the limit governs the automatic snapshots alone. |++</div>+<div class="trilium-multicolumn-column">++```json+{+ "snapshotsToKeep": 0,+ "keepNamedSnapshots": true+}+```++</div>+</div>++**Responses**++=== "200: Excess revisions erased"++ * `application/json`: `object`++ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+ <div class="trilium-multicolumn-column">++ | Property | Description |+ | --- | --- |+ | `erasedCount` | `integer` |++ </div>+ <div class="trilium-multicolumn-column">++ ```json+ {+ "erasedCount": 0+ }+ ```++ </div>+ </div>++=== "400: Invalid options"++ No content.++### Get notes edited on date++`GET /api/edited-notes/{date}` · `getEditedNotes`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `date` <br>_required_ | `string (date)` |++**Responses**++=== "200: Edited notes"++ * `application/json`: `array of Note`++ ```json+ [+ {+ "noteId": "ur11rSfHkzeV",+ "title": "string",+ "type": "text",+ "mime": "text/html",+ "isProtected": true,+ "blobId": "string",+ "dateCreated": "2019-08-24T14:15:22Z",+ "dateModified": "2019-08-24T14:15:22Z",+ "utcDateCreated": "2019-08-24T14:15:22Z",+ "utcDateModified": "2019-08-24T14:15:22Z"+ }+ ]+ ```++### Get image from revision++`GET /api/revisions/{revisionId}/image/{filename}` · `getRevisionImage`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `revisionId` <br>_required_ | `string` |+| `filename` <br>_required_ | `string` |++**Responses**++=== "200: Image content"++ * `image/*`: `string (binary)`++## Search++Search and discovery++### Full text search++`GET /api/search` · `search`++**Authorization**: `sessionAuth` or `tokenAuth`++**Query parameters**++| Name | Description |+| --- | --- |+| `searchString` <br>_required_ | `string` |++**Responses**++=== "200: Search results"++ * `application/json`: `array of SearchResult`++ ```json+ [+ {+ "noteId": "string",+ "title": "string",+ "path": "string",+ "score": 0,+ "highlights": [+ "string"+ ]+ }+ ]+ ```++=== "400: Missing or empty search string"++ No content.++### Quick search with highlighting++`GET /api/quick-search` · `quickSearch`++**Authorization**: `sessionAuth` or `tokenAuth`++**Query parameters**++| Name | Description |+| --- | --- |+| `searchString` <br>_required_ | `string` |++**Responses**++=== "200: Quick search results"++ * `application/json`: `array of SearchResult`++ ```json+ [+ {+ "noteId": "string",+ "title": "string",+ "path": "string",+ "score": 0,+ "highlights": [+ "string"+ ]+ }+ ]+ ```++=== "400: Missing or empty search string"++ No content.++### Execute search note++`GET /api/search-note/{noteId}` · `executeSearchNote`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `noteId` <br>_required_ | `string` <br>12-character note ID |++**Responses**++=== "200: Search results"++ * `application/json`: `array of SearchResult`++ ```json+ [+ {+ "noteId": "string",+ "title": "string",+ "path": "string",+ "score": 0,+ "highlights": [+ "string"+ ]+ }+ ]+ ```++### Search and execute actions++`POST /api/search-and-execute-note/{noteId}` · `searchAndExecute`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `noteId` <br>_required_ | `string` <br>12-character note ID |++**Responses**++=== "200: Execution results"++ No content.++### Find related notes by attributes++`POST /api/search-related` · `searchRelated`++**Authorization**: `sessionAuth` or `tokenAuth`++**Request body** (required)++* `application/json`: `Attribute`++<div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+<div class="trilium-multicolumn-column">++| Property | Description |+| --- | --- |+| `attributeId` <br>_required_ | `string` |+| `noteId` <br>_required_ | `string` |+| `type` <br>_required_ | `string` <br>One of `label`, `relation`. |+| `name` <br>_required_ | `string` |+| `value` <br>_required_ | `string` |+| `position` | `integer` |+| `isInheritable` | `boolean` |++</div>+<div class="trilium-multicolumn-column">++```json+{+ "attributeId": "string",+ "noteId": "string",+ "type": "label",+ "name": "string",+ "value": "string",+ "position": 0,+ "isInheritable": true+}+```++</div>+</div>++**Responses**++=== "200: Related notes"++ * `application/json`: `object`++ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+ <div class="trilium-multicolumn-column">++ | Property | Description |+ | --- | --- |+ | `count` <br>_required_ | `integer` <br>Distinct notes matching, counted before the twenty-result cap. |+ | `results` <br>_required_ | `array of object` <br>At most twenty, name-and-value matches ahead of name-only ones. |++ </div>+ <div class="trilium-multicolumn-column">++ ```json+ {+ "count": 0,+ "results": [+ {+ "notePathArray": [+ "string"+ ],+ "score": 0+ }+ ]+ }+ ```++ </div>+ </div>++### Search template notes++`GET /api/search-templates` · `searchTemplates`++**Authorization**: `sessionAuth` or `tokenAuth`++**Responses**++=== "200: Template notes"++ * `application/json`: `array of Note`++ ```json+ [+ {+ "noteId": "ur11rSfHkzeV",+ "title": "string",+ "type": "text",+ "mime": "text/html",+ "isProtected": true,+ "blobId": "string",+ "dateCreated": "2019-08-24T14:15:22Z",+ "dateModified": "2019-08-24T14:15:22Z",+ "utcDateCreated": "2019-08-24T14:15:22Z",+ "utcDateModified": "2019-08-24T14:15:22Z"+ }+ ]+ ```++### Get autocomplete suggestions++`GET /api/autocomplete` · `autocomplete`++**Authorization**: `sessionAuth` or `tokenAuth`++**Query parameters**++| Name | Description |+| --- | --- |+| `query` <br>_required_ | `string` |+| `fastSearch` | `boolean` |+| `activeNoteId` | `string` |++**Responses**++=== "200: Autocomplete suggestions"++ * `application/json`: `array of object`++ ```json+ [+ {+ "noteId": "string",+ "title": "string",+ "path": "string"+ }+ ]+ ```++### Find similar notes++`GET /api/similar-notes/{noteId}` · `findSimilarNotes`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `noteId` <br>_required_ | `string` <br>12-character note ID |++**Responses**++=== "200: Similar notes"++ * `application/json`: `array of object`++ ```json+ [+ {+ "noteId": "string",+ "title": "string",+ "similarity": 0+ }+ ]+ ```++## Import/Export++Import and export operations++### Export branch++`GET /api/branches/{branchId}/export/{type}/{format}/{taskId}` · `exportBranch`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `branchId` <br>_required_ | `string` |+| `type` <br>_required_ | `string` <br>One of `subtree`, `single`. |+| `format` <br>_required_ | `string` <br>One of `html`, `markdown`, `opml`. |+| `taskId` <br>_required_ | `string` |++**Responses**++=== "200: Exported content"++ * `application/octet-stream`: `string (binary)`++### Import notes++`POST /api/notes/{parentNoteId}/notes-import` · `importNotes`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `parentNoteId` <br>_required_ | `string` |++**Request body** (required)++* `multipart/form-data`: `object`++| Property | Description |+| --- | --- |+| `upload` | `string (binary)` |+| `safeImport` | `boolean` |+| `shrinkImages` | `boolean` |+| `textImportedAsText` | `boolean` |+| `codeImportedAsCode` | `boolean` |+| `explodeArchives` | `boolean` |+| `replaceUnderscoresWithSpaces` | `boolean` |++**Responses**++=== "200: Import results"++ * `application/json`: `object`++ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+ <div class="trilium-multicolumn-column">++ | Property | Description |+ | --- | --- |+ | `noteId` | `string` |+ | `note` | `Note` |++ </div>+ <div class="trilium-multicolumn-column">++ ```json+ {+ "noteId": "string",+ "note": {+ "noteId": "ur11rSfHkzeV",+ "title": "string",+ "type": "text",+ "mime": "text/html",+ "isProtected": true,+ "blobId": "string",+ "dateCreated": "2019-08-24T14:15:22Z",+ "dateModified": "2019-08-24T14:15:22Z",+ "utcDateCreated": "2019-08-24T14:15:22Z",+ "utcDateModified": "2019-08-24T14:15:22Z"+ }+ }+ ```++ </div>+ </div>++### Import attachments++`POST /api/notes/{parentNoteId}/attachments-import` · `importAttachments`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `parentNoteId` <br>_required_ | `string` |++**Request body** (required)++* `multipart/form-data`: `object`++| Property | Description |+| --- | --- |+| `upload` | `array of string (binary)` |++**Responses**++=== "200: Import results"++ No content.++## Sync++Synchronization between instances++### Test sync connection++`POST /api/sync/test` · `testSync`++**Authorization**: `sessionAuth` or `tokenAuth`++**Responses**++=== "200: Sync test results"++ No content.++### Trigger sync now++`POST /api/sync/now` · `syncNow`++**Authorization**: `sessionAuth` or `tokenAuth`++**Responses**++=== "200: Sync started"++ No content.++### Get sync status++`GET /api/sync/check` · `checkSync`++**Authorization**: `sessionAuth` or `tokenAuth`++**Responses**++=== "200: Sync status"++ * `application/json`: `object`++ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+ <div class="trilium-multicolumn-column">++ | Property | Description |+ | --- | --- |+ | `synced` | `boolean` |+ | `lastSyncedPush` | `string (date-time)` |+ | `lastSyncedPull` | `string (date-time)` |++ </div>+ <div class="trilium-multicolumn-column">++ ```json+ {+ "synced": true,+ "lastSyncedPush": "2019-08-24T14:15:22Z",+ "lastSyncedPull": "2019-08-24T14:15:22Z"+ }+ ```++ </div>+ </div>++### Get sync changes++`GET /api/sync/changed` · `getSyncChanges`++**Authorization**: `sessionAuth` or `tokenAuth`++**Query parameters**++| Name | Description |+| --- | --- |+| `instanceId` <br>_required_ | `string` |+| `lastEntityChangeId` <br>_required_ | `integer` |+| `logMarkerId` <br>_required_ | `string` |++**Responses**++=== "200: Sync changes"++ * `application/json`: `object`++ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+ <div class="trilium-multicolumn-column">++ | Property | Description |+ | --- | --- |+ | `entityChanges` | `array of EntityChange` |+ | `lastEntityChangeId` | `integer` |+ | `outstandingPullCount` | `integer` |++ </div>+ <div class="trilium-multicolumn-column">++ ```json+ {+ "entityChanges": [+ {+ "entityChange": {+ "entityName": "string",+ "changeId": "string"+ },+ "entity": {}+ }+ ],+ "lastEntityChangeId": 0,+ "outstandingPullCount": 0+ }+ ```++ </div>+ </div>++### Push sync changes++`PUT /api/sync/update` · `pushSyncChanges`++**Authorization**: `sessionAuth` or `tokenAuth`++**Query parameters**++| Name | Description |+| --- | --- |+| `logMarkerId` <br>_required_ | `string` |++**Header parameters**++| Name | Description |+| --- | --- |+| `pageCount` <br>_required_ | `integer` |+| `pageIndex` <br>_required_ | `integer` |+| `requestId` | `string` |++**Request body** (required)++* `application/json`: `object`++<div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+<div class="trilium-multicolumn-column">++| Property | Description |+| --- | --- |+| `instanceId` | `string` |+| `entities` | `array of EntityChange` |++</div>+<div class="trilium-multicolumn-column">++```json+{+ "instanceId": "string",+ "entities": [+ {+ "entityChange": {+ "entityName": "string",+ "changeId": "string"+ },+ "entity": {}+ }+ ]+}+```++</div>+</div>++**Responses**++=== "200: Changes processed"++ No content.++### Mark sync as finished++`POST /api/sync/finished` · `finishSync`++**Authorization**: `sessionAuth` or `tokenAuth`++**Responses**++=== "204: Sync finished"++ No content.++### Get sync statistics++`GET /api/sync/stats` · `getSyncStats`++**Authorization**: none++**Responses**++=== "200: Sync statistics"++ * `application/json`: `object`++ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+ <div class="trilium-multicolumn-column">++ | Property | Description |+ | --- | --- |+ | `initialized` | `boolean` |+ | `stats` | `object` |++ </div>+ <div class="trilium-multicolumn-column">++ ```json+ {+ "initialized": true,+ "stats": {}+ }+ ```++ </div>+ </div>++### Fill entity changes++`POST /api/sync/fill-entity-changes` · `fillEntityChanges`++**Authorization**: `sessionAuth` or `tokenAuth`++**Responses**++=== "204: Entity changes filled"++ No content.++### Force full sync++`POST /api/sync/force-full-sync` · `forceFullSync`++**Authorization**: `sessionAuth` or `tokenAuth`++**Responses**++=== "204: Full sync forced"++ No content.++### Check entity changes consistency++`POST /api/sync/check-entity-changes` · `checkEntityChanges`++**Authorization**: `sessionAuth` or `tokenAuth`++**Responses**++=== "200: Consistency check results"++ No content.++### Queue sector for sync++`POST /api/sync/queue-sector/{entityName}/{sector}` · `queueSyncSector`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `entityName` <br>_required_ | `string` |+| `sector` <br>_required_ | `string` |++**Responses**++=== "204: Sector queued"++ No content.++## Scripting++Script execution and automation++### Execute script++`POST /api/script/exec` · `executeScript`++**Authorization**: `sessionAuth` or `tokenAuth`++**Request body** (required)++* `application/json`: `object`++<div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+<div class="trilium-multicolumn-column">++| Property | Description |+| --- | --- |+| `script` <br>_required_ | `string` |+| `params` | `array of string` |+| `startNoteId` | `string` |+| `currentNoteId` | `string` |+| `originEntityName` | `string` |+| `originEntityId` | `string` |+| `transactional` | `boolean` |++</div>+<div class="trilium-multicolumn-column">++```json+{+ "script": "string",+ "params": [+ "string"+ ],+ "startNoteId": "string",+ "currentNoteId": "string",+ "originEntityName": "string",+ "originEntityId": "string",+ "transactional": true+}+```++</div>+</div>++**Responses**++=== "200: Script execution results"++ * `application/json`: `object`++ ```json+ {}+ ```++### Run script note++`POST /api/script/run/{noteId}` · `runScriptNote`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `noteId` <br>_required_ | `string` <br>12-character note ID |++**Responses**++=== "200: Script execution results"++ No content.++### Get startup script bundles++`GET /api/script/startup` · `getStartupScripts`++**Authorization**: `sessionAuth` or `tokenAuth`++**Query parameters**++| Name | Description |+| --- | --- |+| `mobile` | `boolean` |++**Responses**++=== "200: Startup scripts"++ * `application/json`: `array of ScriptBundle`++ ```json+ [+ {+ "noteId": "string",+ "script": "string",+ "html": "string",+ "css": "string"+ }+ ]+ ```++### Get widget script bundles++`GET /api/script/widgets` · `getWidgetScripts`++**Authorization**: `sessionAuth` or `tokenAuth`++**Responses**++=== "200: Widget scripts"++ * `application/json`: `array of ScriptBundle`++ ```json+ [+ {+ "noteId": "string",+ "script": "string",+ "html": "string",+ "css": "string"+ }+ ]+ ```++### Get script bundle for note++`POST /api/script/bundle/{noteId}` · `getScriptBundle`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `noteId` <br>_required_ | `string` <br>12-character note ID |++**Responses**++=== "200: Script bundle"++ * `application/json`: `ScriptBundle`++ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+ <div class="trilium-multicolumn-column">++ | Property | Description |+ | --- | --- |+ | `noteId` | `string` |+ | `script` | `string` |+ | `html` | `string` |+ | `css` | `string` |++ </div>+ <div class="trilium-multicolumn-column">++ ```json+ {+ "noteId": "string",+ "script": "string",+ "html": "string",+ "css": "string"+ }+ ```++ </div>+ </div>++### Get relation script bundles++`GET /api/script/relation/{noteId}/{relationName}` · `getRelationScripts`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `noteId` <br>_required_ | `string` <br>12-character note ID |+| `relationName` <br>_required_ | `string` |++**Responses**++=== "200: Relation scripts"++ * `application/json`: `array of ScriptBundle`++ ```json+ [+ {+ "noteId": "string",+ "script": "string",+ "html": "string",+ "css": "string"+ }+ ]+ ```++## Configuration++System options and settings++### Get application information++`GET /api/app-info` · `getAppInfo`++**Authorization**: `sessionAuth` or `tokenAuth`++**Responses**++=== "200: Application information"++ * `application/json`: `AppInfo`++ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+ <div class="trilium-multicolumn-column">++ | Property | Description |+ | --- | --- |+ | `appVersion` | `string` |+ | `dbVersion` | `integer` |+ | `nodeVersion` | `string` |+ | `syncVersion` | `integer` |+ | `buildDate` | `string (date-time)` |+ | `buildRevision` | `string` |+ | `dataDirectory` | `string` |+ | `clipperProtocolVersion` | `string` |+ | `utcDateTime` | `string (date-time)` |++ </div>+ <div class="trilium-multicolumn-column">++ ```json+ {+ "appVersion": "0.91.6",+ "dbVersion": 228,+ "nodeVersion": "string",+ "syncVersion": 34,+ "buildDate": "2019-08-24T14:15:22Z",+ "buildRevision": "string",+ "dataDirectory": "string",+ "clipperProtocolVersion": "string",+ "utcDateTime": "2019-08-24T14:15:22Z"+ }+ ```++ </div>+ </div>++### Get setup status++`GET /api/setup/status` · `getSetupStatus`++**Authorization**: none++**Responses**++=== "200: Setup status"++ * `application/json`: `object`++ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+ <div class="trilium-multicolumn-column">++ | Property | Description |+ | --- | --- |+ | `isInitialized` | `boolean` |+ | `schemaExists` | `boolean` |+ | `syncVersion` | `integer` |++ </div>+ <div class="trilium-multicolumn-column">++ ```json+ {+ "isInitialized": true,+ "schemaExists": true,+ "syncVersion": 0+ }+ ```++ </div>+ </div>++### Initialize new document++`POST /api/setup/new-document` · `initNewDocument`++**Authorization**: none++**Request body** (required)++* `application/json`: `object`++<div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+<div class="trilium-multicolumn-column">++| Property | Description |+| --- | --- |+| `password` <br>_required_ | `string (password)` |+| `theme` | `string` |++</div>+<div class="trilium-multicolumn-column">++```json+{+ "password": "string",+ "theme": "string"+}+```++</div>+</div>++**Responses**++=== "201: Document initialized"++ No content.++### Setup sync from server++`POST /api/setup/sync-from-server` · `setupSyncFromServer`++**Authorization**: none++**Request body** (required)++* `application/json`: `object`++<div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+<div class="trilium-multicolumn-column">++| Property | Description |+| --- | --- |+| `syncServerHost` <br>_required_ | `string (uri)` |+| `syncProxy` | `string` |+| `password` <br>_required_ | `string (password)` |++</div>+<div class="trilium-multicolumn-column">++```json+{+ "syncServerHost": "string",+ "syncProxy": "string",+ "password": "string"+}+```++</div>+</div>++**Responses**++=== "200: Sync setup successful"++ No content.++### Get sync seed for setup++`GET /api/setup/sync-seed` · `getSyncSeed`++**Authorization**: none++**Responses**++=== "200: Sync seed information"++ * `application/json`: `object`++ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+ <div class="trilium-multicolumn-column">++ | Property | Description |+ | --- | --- |+ | `syncVersion` | `integer` |+ | `schemaVersion` | `integer` |+ | `documentSecret` | `string` |+ | `maxSyncId` | `integer` |++ </div>+ <div class="trilium-multicolumn-column">++ ```json+ {+ "syncVersion": 0,+ "schemaVersion": 0,+ "documentSecret": "string",+ "maxSyncId": 0+ }+ ```++ </div>+ </div>++### Get system options++`GET /api/options` · `getOptions`++**Authorization**: `sessionAuth` or `tokenAuth`++**Responses**++=== "200: System options"++ * `application/json`: `object`++ ```json+ {}+ ```++### Update multiple options++`PUT /api/options` · `updateOptions`++**Authorization**: `sessionAuth` or `tokenAuth`++**Request body** (required)++* `application/json`: `object`++```json+{}+```++**Responses**++=== "204: Options updated"++ No content.++### Update single option++`PUT /api/options/{name}/{value}` · `updateOption`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `name` <br>_required_ | `string` |+| `value` <br>_required_ | `string` |++**Responses**++=== "204: Option updated"++ No content.++### Get user-defined themes++`GET /api/options/user-themes` · `getUserThemes`++**Authorization**: `sessionAuth` or `tokenAuth`++**Responses**++=== "200: User themes"++ * `application/json`: `array of object`++ ```json+ [+ {+ "name": "string",+ "label": "string"+ }+ ]+ ```++### Get supported locales++`GET /api/options/locales` · `getLocales`++**Authorization**: `sessionAuth` or `tokenAuth`++**Responses**++=== "200: Supported locales"++ * `application/json`: `array of object`++ ```json+ [+ {+ "code": "string",+ "name": "string"+ }+ ]+ ```++## Database++Database operations++### Get database schema++`GET /api/sql/schema` · `getDatabaseSchema`++**Authorization**: `sessionAuth` or `tokenAuth`++**Responses**++=== "200: Database schema"++ * `text/plain`: `string`++### Execute SQL from note++`POST /api/sql/execute/{noteId}` · `executeSql`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `noteId` <br>_required_ | `string` <br>12-character note ID |++**Responses**++=== "200: SQL execution results"++ * `application/json`: `array of object`++ ```json+ [+ {}+ ]+ ```++### Create database backup++`POST /api/database/backup-database` · `backupDatabase`++**Authorization**: `sessionAuth` or `tokenAuth`++**Responses**++=== "204: Backup created"++ No content.++### List existing backups++`GET /api/database/backups` · `listBackups`++**Authorization**: `sessionAuth` or `tokenAuth`++**Responses**++=== "200: Backup list"++ * `application/json`: `object`++ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+ <div class="trilium-multicolumn-column">++ | Property | Description |+ | --- | --- |+ | `backupFolderPath` | `string \| null` <br>Directory where the backups are stored, or null if there is no user-accessible location. |+ | `backups` | `array of object` |++ </div>+ <div class="trilium-multicolumn-column">++ ```json+ {+ "backupFolderPath": "string",+ "backups": [+ {+ "fileName": "string",+ "filePath": "string",+ "mtime": "2019-08-24T14:15:22Z",+ "fileSize": 0+ }+ ]+ }+ ```++ </div>+ </div>++### Vacuum database++`POST /api/database/vacuum-database` · `vacuumDatabase`++**Authorization**: `sessionAuth` or `tokenAuth`++**Responses**++=== "204: Database vacuumed"++ No content.++### Anonymize database++`POST /api/database/anonymize/{type}` · `anonymizeDatabase`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `type` <br>_required_ | `string` <br>One of `save-as-file`, `save-and-send`. |++**Responses**++=== "200: Anonymization results"++ No content.++### List anonymized databases++`GET /api/database/anonymized-databases` · `listAnonymizedDatabases`++**Authorization**: `sessionAuth` or `tokenAuth`++**Responses**++=== "200: Anonymized database list"++ * `application/json`: `object`++ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+ <div class="trilium-multicolumn-column">++ | Property | Description |+ | --- | --- |+ | `anonymizedFolderPath` | `string` <br>Directory where the anonymized databases are stored. |+ | `databases` | `array of object` |++ </div>+ <div class="trilium-multicolumn-column">++ ```json+ {+ "anonymizedFolderPath": "string",+ "databases": [+ {+ "fileName": "string",+ "filePath": "string",+ "mtime": "2019-08-24T14:15:22Z",+ "fileSize": 0+ }+ ]+ }+ ```++ </div>+ </div>++### Download an anonymized database file++`GET /api/database/anonymized/download` · `downloadAnonymizedDatabase`++**Authorization**: `sessionAuth` or `tokenAuth`++**Query parameters**++| Name | Description |+| --- | --- |+| `filePath` <br>_required_ | `string` |++**Responses**++=== "200: Anonymized database file"++ * `application/x-sqlite3`: `string (binary)`++=== "400: Missing filePath"++ No content.++=== "403: Path outside the anonymized database directory"++ No content.++=== "404: File not found"++ No content.++### Fix consistency issues++`POST /api/database/find-and-fix-consistency-issues` · `fixConsistencyIssues`++**Authorization**: `sessionAuth` or `tokenAuth`++**Responses**++=== "200: Consistency check results"++ No content.++### Check database integrity++`GET /api/database/check-integrity` · `checkIntegrity`++**Authorization**: `sessionAuth` or `tokenAuth`++**Responses**++=== "200: Integrity check results"++ * `application/json`: `object`++ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+ <div class="trilium-multicolumn-column">++ | Property | Description |+ | --- | --- |+ | `results` | `array of string` |++ </div>+ <div class="trilium-multicolumn-column">++ ```json+ {+ "results": [+ "string"+ ]+ }+ ```++ </div>+ </div>++## LLM++AI/LLM integration++### List all chat sessions++`GET /api/llm/chat` · `listChatSessions`++**Authorization**: `sessionAuth` or `tokenAuth`++**Responses**++=== "200: Chat sessions"++ * `application/json`: `array of ChatSession`++ ```json+ [+ {+ "sessionId": "string",+ "title": "string",+ "messages": [+ {+ "role": "user",+ "content": "string",+ "timestamp": "2019-08-24T14:15:22Z"+ }+ ],+ "createdAt": "2019-08-24T14:15:22Z",+ "lastActive": "2019-08-24T14:15:22Z",+ "messageCount": 0+ }+ ]+ ```++### Create new chat session++`POST /api/llm/chat` · `createChatSession`++**Authorization**: `sessionAuth` or `tokenAuth`++**Request body** (required)++* `application/json`: `object`++<div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+<div class="trilium-multicolumn-column">++| Property | Description |+| --- | --- |+| `title` | `string` |+| `systemPrompt` | `string` |+| `temperature` | `number` |+| `maxTokens` | `integer` |+| `model` | `string` |+| `provider` | `string` <br>One of `openai`, `anthropic`, `ollama`. |+| `contextNoteId` | `string` |++</div>+<div class="trilium-multicolumn-column">++```json+{+ "title": "string",+ "systemPrompt": "string",+ "temperature": 0,+ "maxTokens": 0,+ "model": "string",+ "provider": "openai",+ "contextNoteId": "string"+}+```++</div>+</div>++**Responses**++=== "201: Chat session created"++ * `application/json`: `ChatSession`++ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+ <div class="trilium-multicolumn-column">++ | Property | Description |+ | --- | --- |+ | `sessionId` | `string` |+ | `title` | `string` |+ | `messages` | `array of object` |+ | `createdAt` | `string (date-time)` |+ | `lastActive` | `string (date-time)` |+ | `messageCount` | `integer` |++ </div>+ <div class="trilium-multicolumn-column">++ ```json+ {+ "sessionId": "string",+ "title": "string",+ "messages": [+ {+ "role": "user",+ "content": "string",+ "timestamp": "2019-08-24T14:15:22Z"+ }+ ],+ "createdAt": "2019-08-24T14:15:22Z",+ "lastActive": "2019-08-24T14:15:22Z",+ "messageCount": 0+ }+ ```++ </div>+ </div>++### Get specific chat session++`GET /api/llm/chat/{sessionId}` · `getChatSession`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `sessionId` <br>_required_ | `string` |++**Responses**++=== "200: Chat session details"++ * `application/json`: `ChatSession`++ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+ <div class="trilium-multicolumn-column">++ | Property | Description |+ | --- | --- |+ | `sessionId` | `string` |+ | `title` | `string` |+ | `messages` | `array of object` |+ | `createdAt` | `string (date-time)` |+ | `lastActive` | `string (date-time)` |+ | `messageCount` | `integer` |++ </div>+ <div class="trilium-multicolumn-column">++ ```json+ {+ "sessionId": "string",+ "title": "string",+ "messages": [+ {+ "role": "user",+ "content": "string",+ "timestamp": "2019-08-24T14:15:22Z"+ }+ ],+ "createdAt": "2019-08-24T14:15:22Z",+ "lastActive": "2019-08-24T14:15:22Z",+ "messageCount": 0+ }+ ```++ </div>+ </div>++### Update chat session++`PATCH /api/llm/chat/{sessionId}` · `updateChatSession`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `sessionId` <br>_required_ | `string` |++**Request body** (required)++* `application/json`: `object`++<div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+<div class="trilium-multicolumn-column">++| Property | Description |+| --- | --- |+| `title` | `string` |+| `systemPrompt` | `string` |+| `temperature` | `number` |+| `maxTokens` | `integer` |+| `model` | `string` |+| `provider` | `string` |+| `contextNoteId` | `string` |++</div>+<div class="trilium-multicolumn-column">++```json+{+ "title": "string",+ "systemPrompt": "string",+ "temperature": 0,+ "maxTokens": 0,+ "model": "string",+ "provider": "string",+ "contextNoteId": "string"+}+```++</div>+</div>++**Responses**++=== "200: Session updated"++ * `application/json`: `ChatSession`++ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+ <div class="trilium-multicolumn-column">++ | Property | Description |+ | --- | --- |+ | `sessionId` | `string` |+ | `title` | `string` |+ | `messages` | `array of object` |+ | `createdAt` | `string (date-time)` |+ | `lastActive` | `string (date-time)` |+ | `messageCount` | `integer` |++ </div>+ <div class="trilium-multicolumn-column">++ ```json+ {+ "sessionId": "string",+ "title": "string",+ "messages": [+ {+ "role": "user",+ "content": "string",+ "timestamp": "2019-08-24T14:15:22Z"+ }+ ],+ "createdAt": "2019-08-24T14:15:22Z",+ "lastActive": "2019-08-24T14:15:22Z",+ "messageCount": 0+ }+ ```++ </div>+ </div>++### Delete chat session++`DELETE /api/llm/chat/{chatNoteId}` · `deleteChatSession`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `chatNoteId` <br>_required_ | `string` |++**Responses**++=== "204: Session deleted"++ No content.++### Send message to LLM++`POST /api/llm/chat/{chatNoteId}/messages` · `sendChatMessage`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `sessionId` <br>_required_ | `string` |++**Request body** (required)++* `application/json`: `object`++<div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+<div class="trilium-multicolumn-column">++| Property | Description |+| --- | --- |+| `message` <br>_required_ | `string` |+| `options` | `object` |+| `includeContext` | `boolean` |+| `useNoteContext` | `boolean` |++</div>+<div class="trilium-multicolumn-column">++```json+{+ "message": "string",+ "options": {+ "temperature": 0,+ "maxTokens": 0,+ "model": "string",+ "provider": "string"+ },+ "includeContext": true,+ "useNoteContext": true+}+```++</div>+</div>++**Responses**++=== "200: LLM response"++ * `application/json`: `object`++ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+ <div class="trilium-multicolumn-column">++ | Property | Description |+ | --- | --- |+ | `response` | `string` |+ | `sources` | `array of object` |++ </div>+ <div class="trilium-multicolumn-column">++ ```json+ {+ "response": "string",+ "sources": [+ {+ "noteId": "string",+ "title": "string",+ "similarity": 0+ }+ ]+ }+ ```++ </div>+ </div>++### Stream message to LLM++`POST /api/llm/chat/{chatNoteId}/messages/stream` · `streamChatMessage`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `sessionId` <br>_required_ | `string` |++**Request body** (required)++* `application/json`: `object`++<div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+<div class="trilium-multicolumn-column">++| Property | Description |+| --- | --- |+| `content` <br>_required_ | `string` |+| `useAdvancedContext` | `boolean` |+| `showThinking` | `boolean` |+| `mentions` | `array of string` |++</div>+<div class="trilium-multicolumn-column">++```json+{+ "content": "string",+ "useAdvancedContext": true,+ "showThinking": true,+ "mentions": [+ "string"+ ]+}+```++</div>+</div>++**Responses**++=== "200: Streaming started"++ No content.++### List Ollama models++`GET /api/llm/providers/ollama/models` · `listOllamaModels`++**Authorization**: `sessionAuth` or `tokenAuth`++**Query parameters**++| Name | Description |+| --- | --- |+| `baseUrl` | `string` |++**Responses**++=== "200: Ollama models"++ * `application/json`: `object`++ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+ <div class="trilium-multicolumn-column">++ | Property | Description |+ | --- | --- |+ | `success` | `boolean` |+ | `models` | `array of object` |++ </div>+ <div class="trilium-multicolumn-column">++ ```json+ {+ "success": true,+ "models": [+ {}+ ]+ }+ ```++ </div>+ </div>++### List OpenAI models++`GET /api/llm/providers/openai/models` · `listOpenAIModels`++**Authorization**: `sessionAuth` or `tokenAuth`++**Responses**++=== "200: OpenAI models"++ * `application/json`: `object`++ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+ <div class="trilium-multicolumn-column">++ | Property | Description |+ | --- | --- |+ | `success` | `boolean` |+ | `chatModels` | `array of object` |+ | `embeddingModels` | `array of object` |++ </div>+ <div class="trilium-multicolumn-column">++ ```json+ {+ "success": true,+ "chatModels": [+ {+ "id": "string",+ "name": "string",+ "type": "string"+ }+ ],+ "embeddingModels": [+ {+ "id": "string",+ "name": "string",+ "type": "string"+ }+ ]+ }+ ```++ </div>+ </div>++### List Anthropic models++`GET /api/llm/providers/anthropic/models` · `listAnthropicModels`++**Authorization**: `sessionAuth` or `tokenAuth`++**Responses**++=== "200: Anthropic models"++ * `application/json`: `object`++ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+ <div class="trilium-multicolumn-column">++ | Property | Description |+ | --- | --- |+ | `success` | `boolean` |+ | `chatModels` | `array of object` |++ </div>+ <div class="trilium-multicolumn-column">++ ```json+ {+ "success": true,+ "chatModels": [+ {+ "id": "string",+ "name": "string",+ "type": "string"+ }+ ]+ }+ ```++ </div>+ </div>++## Security++Security features (2FA, tokens)++### Change password++`POST /api/password/change` · `changePassword`++**Authorization**: `sessionAuth` or `tokenAuth`++**Request body** (required)++* `application/json`: `object`++<div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+<div class="trilium-multicolumn-column">++| Property | Description |+| --- | --- |+| `current_password` | `string (password)` |+| `new_password` <br>_required_ | `string (password)` |++</div>+<div class="trilium-multicolumn-column">++```json+{+ "current_password": "string",+ "new_password": "string"+}+```++</div>+</div>++**Responses**++=== "204: Password changed"++ No content.++### Reset password (destructive)++`POST /api/password/reset` · `resetPassword`++**Authorization**: `sessionAuth` or `tokenAuth`++**Query parameters**++| Name | Description |+| --- | --- |+| `really` <br>_required_ | `string` |++**Responses**++=== "204: Password reset"++ No content.++### Generate a TOTP secret++`GET /api/totp/generate` · `generateTotpSecret`++Generates a fresh TOTP secret without persisting it. The caller must verify a code for this secret (see `/api/totp/verify`) and commit it (see `/api/totp/enable`) before it becomes active.++**Authorization**: `sessionAuth` or `tokenAuth`++**Responses**++=== "200: TOTP secret generated"++ * `application/json`: `object`++ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+ <div class="trilium-multicolumn-column">++ | Property | Description |+ | --- | --- |+ | `success` | `boolean` |+ | `message` | `string` <br>The bare TOTP secret (for manual entry), or an error message on failure. |+ | `url` | `string` <br>The `otpauth://` URL the authenticator expects, rendered as a QR code by the client. |++ </div>+ <div class="trilium-multicolumn-column">++ ```json+ {+ "success": true,+ "message": "string",+ "url": "string"+ }+ ```++ </div>+ </div>++### Verify a generated TOTP secret++`POST /api/totp/verify` · `verifyTotpSecret`++Verifies a freshly generated secret against a code the user produced for it, without persisting anything. On success, issues (unpersisted) recovery codes to be shown as the next enrollment step.++**Authorization**: `sessionAuth` or `tokenAuth`++**Request body** (required)++* `application/json`: `object`++<div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+<div class="trilium-multicolumn-column">++| Property | Description |+| --- | --- |+| `secret` <br>_required_ | `string` |+| `token` <br>_required_ | `string` <br>A TOTP code the user generated for the supplied secret. |++</div>+<div class="trilium-multicolumn-column">++```json+{+ "secret": "string",+ "token": "string"+}+```++</div>+</div>++**Responses**++=== "200: Verification result"++ * `application/json`: `object`++ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+ <div class="trilium-multicolumn-column">++ | Property | Description |+ | --- | --- |+ | `success` | `boolean` |+ | `recoveryCodes` | `array of string` <br>One-time recovery codes, present only when verification succeeds. |++ </div>+ <div class="trilium-multicolumn-column">++ ```json+ {+ "success": true,+ "recoveryCodes": [+ "string"+ ]+ }+ ```++ </div>+ </div>++### Enable TOTP with a verified secret++`POST /api/totp/enable` · `enableTotp`++Commits a verified secret together with its recovery codes, activating TOTP. This is the final enrollment step and the only point at which the secret and recovery codes are persisted.++**Authorization**: `sessionAuth` or `tokenAuth`++**Request body** (required)++* `application/json`: `object`++<div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+<div class="trilium-multicolumn-column">++| Property | Description |+| --- | --- |+| `secret` <br>_required_ | `string` |+| `recoveryCodes` <br>_required_ | `array of string` |++</div>+<div class="trilium-multicolumn-column">++```json+{+ "secret": "string",+ "recoveryCodes": [+ "string"+ ]+}+```++</div>+</div>++**Responses**++=== "200: Result of enabling TOTP"++ * `application/json`: `object`++ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+ <div class="trilium-multicolumn-column">++ | Property | Description |+ | --- | --- |+ | `success` | `boolean` |++ </div>+ <div class="trilium-multicolumn-column">++ ```json+ {+ "success": true+ }+ ```++ </div>+ </div>++### Get TOTP status++`GET /api/totp/status` · `getTotpStatus`++**Authorization**: `sessionAuth` or `tokenAuth`++**Responses**++=== "200: TOTP status"++ * `application/json`: `object`++ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+ <div class="trilium-multicolumn-column">++ | Property | Description |+ | --- | --- |+ | `success` | `boolean` |+ | `message` | `boolean` <br>Whether TOTP is the active second factor and a secret is set. |+ | `set` | `boolean` <br>Whether a TOTP secret is currently stored. |++ </div>+ <div class="trilium-multicolumn-column">++ ```json+ {+ "success": true,+ "message": true,+ "set": true+ }+ ```++ </div>+ </div>++### Get the stored TOTP secret++`GET /api/totp/get` · `getTotpSecret`++**Authorization**: `sessionAuth` or `tokenAuth`++**Responses**++=== "200: The stored TOTP secret, or `null` if none is set."++ * `application/json`: `string | null`++ ```json+ "string"+ ```++### Reset (disable) TOTP++`POST /api/totp/reset` · `resetTotp`++Clears the stored TOTP secret and its recovery codes, disabling TOTP.++**Authorization**: `sessionAuth` or `tokenAuth`++**Responses**++=== "200: Result of resetting TOTP"++ * `application/json`: `object`++ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+ <div class="trilium-multicolumn-column">++ | Property | Description |+ | --- | --- |+ | `success` | `boolean` |++ </div>+ <div class="trilium-multicolumn-column">++ ```json+ {+ "success": true+ }+ ```++ </div>+ </div>++### Check if TOTP recovery codes are set++`GET /api/totp_recovery/enabled` · `isTotpRecoveryEnabled`++**Authorization**: `sessionAuth` or `tokenAuth`++**Responses**++=== "200: TOTP recovery status"++ * `application/json`: `object`++ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+ <div class="trilium-multicolumn-column">++ | Property | Description |+ | --- | --- |+ | `success` | `boolean` |+ | `keysExist` | `boolean` |++ </div>+ <div class="trilium-multicolumn-column">++ ```json+ {+ "success": true,+ "keysExist": true+ }+ ```++ </div>+ </div>++### Regenerate TOTP recovery codes++`POST /api/totp_recovery/regenerate` · `regenerateTotpRecoveryCodes`++Issues a fresh batch of recovery codes for the already-enrolled TOTP secret, replacing any existing ones, and returns them for one-time display. Refuses when no TOTP secret is set.++**Authorization**: `sessionAuth` or `tokenAuth`++**Responses**++=== "200: Generated recovery codes"++ * `application/json`: `object`++ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+ <div class="trilium-multicolumn-column">++ | Property | Description |+ | --- | --- |+ | `success` | `boolean` |+ | `recoveryCodes` | `array of string` <br>New recovery codes, present only when regeneration succeeds. |++ </div>+ <div class="trilium-multicolumn-column">++ ```json+ {+ "success": true,+ "recoveryCodes": [+ "string"+ ]+ }+ ```++ </div>+ </div>++### Get used TOTP recovery codes++`GET /api/totp_recovery/used` · `getUsedTotpRecoveryCodes`++**Authorization**: `sessionAuth` or `tokenAuth`++**Responses**++=== "200: Used recovery codes status. Returns an empty array if no recovery codes are set, otherwise an object listing each code's status."++ * `application/json`: `array of any | object`++ ```json+ [+ null+ ]+ ```++### Verify a TOTP recovery code++`POST /api/totp_recovery/verify` · `verifyTotpRecoveryCode`++**Authorization**: `sessionAuth` or `tokenAuth`++**Request body** (required)++* `application/json`: `object`++<div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+<div class="trilium-multicolumn-column">++| Property | Description |+| --- | --- |+| `recovery_code_guess` <br>_required_ | `string` |++</div>+<div class="trilium-multicolumn-column">++```json+{+ "recovery_code_guess": "string"+}+```++</div>+</div>++**Responses**++=== "200: Verification result"++ * `application/json`: `object`++ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+ <div class="trilium-multicolumn-column">++ | Property | Description |+ | --- | --- |+ | `success` | `boolean` |++ </div>+ <div class="trilium-multicolumn-column">++ ```json+ {+ "success": true+ }+ ```++ </div>+ </div>++### List ETAPI tokens++`GET /api/etapi-tokens` · `listEtapiTokens`++**Authorization**: `sessionAuth` or `tokenAuth`++**Responses**++=== "200: ETAPI tokens"++ * `application/json`: `array of EtapiToken`++ ```json+ [+ {+ "etapiTokenId": "string",+ "name": "string",+ "token": "string",+ "dateCreated": "2019-08-24T14:15:22Z",+ "isDeleted": true+ }+ ]+ ```++### Create ETAPI token++`POST /api/etapi-tokens` · `createEtapiToken`++**Authorization**: `sessionAuth` or `tokenAuth`++**Request body** (required)++* `application/json`: `object`++<div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+<div class="trilium-multicolumn-column">++| Property | Description |+| --- | --- |+| `name` <br>_required_ | `string` |++</div>+<div class="trilium-multicolumn-column">++```json+{+ "name": "string"+}+```++</div>+</div>++**Responses**++=== "201: Token created"++ * `application/json`: `EtapiToken`++ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+ <div class="trilium-multicolumn-column">++ | Property | Description |+ | --- | --- |+ | `etapiTokenId` | `string` |+ | `name` | `string` |+ | `token` | `string` |+ | `dateCreated` | `string (date-time)` |+ | `isDeleted` | `boolean` |++ </div>+ <div class="trilium-multicolumn-column">++ ```json+ {+ "etapiTokenId": "string",+ "name": "string",+ "token": "string",+ "dateCreated": "2019-08-24T14:15:22Z",+ "isDeleted": true+ }+ ```++ </div>+ </div>++### Delete ETAPI token++`DELETE /api/etapi-tokens/{etapiTokenId}` · `deleteEtapiToken`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `etapiTokenId` <br>_required_ | `string` |++**Responses**++=== "204: Token deleted"++ No content.++### Update ETAPI token++`PATCH /api/etapi-tokens/{etapiTokenId}` · `updateEtapiToken`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `etapiTokenId` <br>_required_ | `string` |++**Request body** (required)++* `application/json`: `object`++<div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+<div class="trilium-multicolumn-column">++| Property | Description |+| --- | --- |+| `name` | `string` |++</div>+<div class="trilium-multicolumn-column">++```json+{+ "name": "string"+}+```++</div>+</div>++**Responses**++=== "200: Token updated"++ * `application/json`: `EtapiToken`++ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+ <div class="trilium-multicolumn-column">++ | Property | Description |+ | --- | --- |+ | `etapiTokenId` | `string` |+ | `name` | `string` |+ | `token` | `string` |+ | `dateCreated` | `string (date-time)` |+ | `isDeleted` | `boolean` |++ </div>+ <div class="trilium-multicolumn-column">++ ```json+ {+ "etapiTokenId": "string",+ "name": "string",+ "token": "string",+ "dateCreated": "2019-08-24T14:15:22Z",+ "isDeleted": true+ }+ ```++ </div>+ </div>++## Special Notes++Special note types (calendar, inbox)++### Get/create inbox note++`GET /api/special-notes/inbox/{date}` · `getInboxNote`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `date` <br>_required_ | `string (date)` |++**Responses**++=== "200: Inbox note"++ * `application/json`: `Note`++ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+ <div class="trilium-multicolumn-column">++ | Property | Description |+ | --- | --- |+ | `noteId` <br>_required_ | `string` <br>12-character note ID |+ | `title` <br>_required_ | `string` <br>Note title |+ | `type` <br>_required_ | `NoteType` <br>One of `text`, `code`, `render`, `file`, `image`, `search`, `relationMap`, `book`, `noteMap`, `mermaid`, `canvas`, `webView`, `launcher`, `doc`, `contentWidget`, `mindMap`, `geoMap`. |+ | `mime` <br>_required_ | `string` <br>MIME type |+ | `isProtected` <br>_required_ | `boolean` <br>Whether note is protected |+ | `blobId` | `string` <br>ID of content blob |+ | `dateCreated` | `string (date-time)` |+ | `dateModified` | `string (date-time)` |+ | `utcDateCreated` | `string (date-time)` |+ | `utcDateModified` | `string (date-time)` |++ </div>+ <div class="trilium-multicolumn-column">++ ```json+ {+ "noteId": "ur11rSfHkzeV",+ "title": "string",+ "type": "text",+ "mime": "text/html",+ "isProtected": true,+ "blobId": "string",+ "dateCreated": "2019-08-24T14:15:22Z",+ "dateModified": "2019-08-24T14:15:22Z",+ "utcDateCreated": "2019-08-24T14:15:22Z",+ "utcDateModified": "2019-08-24T14:15:22Z"+ }+ ```++ </div>+ </div>++### Resolve where an inbox capture would go++`GET /api/special-notes/inbox-target` · `getInboxTarget`++Reports the destination `/api/special-notes/inbox/{date}` would use, without creating anything. Honours the hoisted note, read from the `trilium-hoisted-note-id` header.++**Authorization**: `sessionAuth` or `tokenAuth`++**Responses**++=== "200: The resolved destination"++ * `application/json`: `object`++ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+ <div class="trilium-multicolumn-column">++ | Property | Description |+ | --- | --- |+ | `kind` <br>_required_ | `string` <br>Which rule decided the destination. `dayNote` names no note, because the day note is created when the capture happens. One of `inbox`, `workspaceInbox`, `workspaceRoot`, `dayNote`, `root`. |+ | `noteId` | `string` <br>Absent for `dayNote`. |+ | `title` | `string` <br>Absent for `dayNote`. |++ </div>+ <div class="trilium-multicolumn-column">++ ```json+ {+ "kind": "inbox",+ "noteId": "string",+ "title": "string"+ }+ ```++ </div>+ </div>++### Get/create day note++`GET /api/special-notes/days/{date}` · `getDayNote`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `date` <br>_required_ | `string (date)` |++**Responses**++=== "200: Day note"++ * `application/json`: `Note`++ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+ <div class="trilium-multicolumn-column">++ | Property | Description |+ | --- | --- |+ | `noteId` <br>_required_ | `string` <br>12-character note ID |+ | `title` <br>_required_ | `string` <br>Note title |+ | `type` <br>_required_ | `NoteType` <br>One of `text`, `code`, `render`, `file`, `image`, `search`, `relationMap`, `book`, `noteMap`, `mermaid`, `canvas`, `webView`, `launcher`, `doc`, `contentWidget`, `mindMap`, `geoMap`. |+ | `mime` <br>_required_ | `string` <br>MIME type |+ | `isProtected` <br>_required_ | `boolean` <br>Whether note is protected |+ | `blobId` | `string` <br>ID of content blob |+ | `dateCreated` | `string (date-time)` |+ | `dateModified` | `string (date-time)` |+ | `utcDateCreated` | `string (date-time)` |+ | `utcDateModified` | `string (date-time)` |++ </div>+ <div class="trilium-multicolumn-column">++ ```json+ {+ "noteId": "ur11rSfHkzeV",+ "title": "string",+ "type": "text",+ "mime": "text/html",+ "isProtected": true,+ "blobId": "string",+ "dateCreated": "2019-08-24T14:15:22Z",+ "dateModified": "2019-08-24T14:15:22Z",+ "utcDateCreated": "2019-08-24T14:15:22Z",+ "utcDateModified": "2019-08-24T14:15:22Z"+ }+ ```++ </div>+ </div>++### Get/create week note++`GET /api/special-notes/weeks/{week}` · `getWeekNote`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `week` <br>_required_ | `string` |++**Responses**++=== "200: Week note"++ * `application/json`: `Note`++ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+ <div class="trilium-multicolumn-column">++ | Property | Description |+ | --- | --- |+ | `noteId` <br>_required_ | `string` <br>12-character note ID |+ | `title` <br>_required_ | `string` <br>Note title |+ | `type` <br>_required_ | `NoteType` <br>One of `text`, `code`, `render`, `file`, `image`, `search`, `relationMap`, `book`, `noteMap`, `mermaid`, `canvas`, `webView`, `launcher`, `doc`, `contentWidget`, `mindMap`, `geoMap`. |+ | `mime` <br>_required_ | `string` <br>MIME type |+ | `isProtected` <br>_required_ | `boolean` <br>Whether note is protected |+ | `blobId` | `string` <br>ID of content blob |+ | `dateCreated` | `string (date-time)` |+ | `dateModified` | `string (date-time)` |+ | `utcDateCreated` | `string (date-time)` |+ | `utcDateModified` | `string (date-time)` |++ </div>+ <div class="trilium-multicolumn-column">++ ```json+ {+ "noteId": "ur11rSfHkzeV",+ "title": "string",+ "type": "text",+ "mime": "text/html",+ "isProtected": true,+ "blobId": "string",+ "dateCreated": "2019-08-24T14:15:22Z",+ "dateModified": "2019-08-24T14:15:22Z",+ "utcDateCreated": "2019-08-24T14:15:22Z",+ "utcDateModified": "2019-08-24T14:15:22Z"+ }+ ```++ </div>+ </div>++### Get/create month note++`GET /api/special-notes/months/{month}` · `getMonthNote`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `month` <br>_required_ | `string` |++**Responses**++=== "200: Month note"++ * `application/json`: `Note`++ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+ <div class="trilium-multicolumn-column">++ | Property | Description |+ | --- | --- |+ | `noteId` <br>_required_ | `string` <br>12-character note ID |+ | `title` <br>_required_ | `string` <br>Note title |+ | `type` <br>_required_ | `NoteType` <br>One of `text`, `code`, `render`, `file`, `image`, `search`, `relationMap`, `book`, `noteMap`, `mermaid`, `canvas`, `webView`, `launcher`, `doc`, `contentWidget`, `mindMap`, `geoMap`. |+ | `mime` <br>_required_ | `string` <br>MIME type |+ | `isProtected` <br>_required_ | `boolean` <br>Whether note is protected |+ | `blobId` | `string` <br>ID of content blob |+ | `dateCreated` | `string (date-time)` |+ | `dateModified` | `string (date-time)` |+ | `utcDateCreated` | `string (date-time)` |+ | `utcDateModified` | `string (date-time)` |++ </div>+ <div class="trilium-multicolumn-column">++ ```json+ {+ "noteId": "ur11rSfHkzeV",+ "title": "string",+ "type": "text",+ "mime": "text/html",+ "isProtected": true,+ "blobId": "string",+ "dateCreated": "2019-08-24T14:15:22Z",+ "dateModified": "2019-08-24T14:15:22Z",+ "utcDateCreated": "2019-08-24T14:15:22Z",+ "utcDateModified": "2019-08-24T14:15:22Z"+ }+ ```++ </div>+ </div>++### Get/create year note++`GET /api/special-notes/years/{year}` · `getYearNote`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `year` <br>_required_ | `string` |++**Responses**++=== "200: Year note"++ * `application/json`: `Note`++ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+ <div class="trilium-multicolumn-column">++ | Property | Description |+ | --- | --- |+ | `noteId` <br>_required_ | `string` <br>12-character note ID |+ | `title` <br>_required_ | `string` <br>Note title |+ | `type` <br>_required_ | `NoteType` <br>One of `text`, `code`, `render`, `file`, `image`, `search`, `relationMap`, `book`, `noteMap`, `mermaid`, `canvas`, `webView`, `launcher`, `doc`, `contentWidget`, `mindMap`, `geoMap`. |+ | `mime` <br>_required_ | `string` <br>MIME type |+ | `isProtected` <br>_required_ | `boolean` <br>Whether note is protected |+ | `blobId` | `string` <br>ID of content blob |+ | `dateCreated` | `string (date-time)` |+ | `dateModified` | `string (date-time)` |+ | `utcDateCreated` | `string (date-time)` |+ | `utcDateModified` | `string (date-time)` |++ </div>+ <div class="trilium-multicolumn-column">++ ```json+ {+ "noteId": "ur11rSfHkzeV",+ "title": "string",+ "type": "text",+ "mime": "text/html",+ "isProtected": true,+ "blobId": "string",+ "dateCreated": "2019-08-24T14:15:22Z",+ "dateModified": "2019-08-24T14:15:22Z",+ "utcDateCreated": "2019-08-24T14:15:22Z",+ "utcDateModified": "2019-08-24T14:15:22Z"+ }+ ```++ </div>+ </div>++### Create SQL console note++`POST /api/special-notes/sql-console` · `createSqlConsole`++**Authorization**: `sessionAuth` or `tokenAuth`++**Responses**++=== "201: SQL console created"++ * `application/json`: `Note`++ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+ <div class="trilium-multicolumn-column">++ | Property | Description |+ | --- | --- |+ | `noteId` <br>_required_ | `string` <br>12-character note ID |+ | `title` <br>_required_ | `string` <br>Note title |+ | `type` <br>_required_ | `NoteType` <br>One of `text`, `code`, `render`, `file`, `image`, `search`, `relationMap`, `book`, `noteMap`, `mermaid`, `canvas`, `webView`, `launcher`, `doc`, `contentWidget`, `mindMap`, `geoMap`. |+ | `mime` <br>_required_ | `string` <br>MIME type |+ | `isProtected` <br>_required_ | `boolean` <br>Whether note is protected |+ | `blobId` | `string` <br>ID of content blob |+ | `dateCreated` | `string (date-time)` |+ | `dateModified` | `string (date-time)` |+ | `utcDateCreated` | `string (date-time)` |+ | `utcDateModified` | `string (date-time)` |++ </div>+ <div class="trilium-multicolumn-column">++ ```json+ {+ "noteId": "ur11rSfHkzeV",+ "title": "string",+ "type": "text",+ "mime": "text/html",+ "isProtected": true,+ "blobId": "string",+ "dateCreated": "2019-08-24T14:15:22Z",+ "dateModified": "2019-08-24T14:15:22Z",+ "utcDateCreated": "2019-08-24T14:15:22Z",+ "utcDateModified": "2019-08-24T14:15:22Z"+ }+ ```++ </div>+ </div>++### Create search note++`POST /api/special-notes/search-note` · `createSearchNote`++**Authorization**: `sessionAuth` or `tokenAuth`++**Responses**++=== "201: Search note created"++ * `application/json`: `Note`++ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+ <div class="trilium-multicolumn-column">++ | Property | Description |+ | --- | --- |+ | `noteId` <br>_required_ | `string` <br>12-character note ID |+ | `title` <br>_required_ | `string` <br>Note title |+ | `type` <br>_required_ | `NoteType` <br>One of `text`, `code`, `render`, `file`, `image`, `search`, `relationMap`, `book`, `noteMap`, `mermaid`, `canvas`, `webView`, `launcher`, `doc`, `contentWidget`, `mindMap`, `geoMap`. |+ | `mime` <br>_required_ | `string` <br>MIME type |+ | `isProtected` <br>_required_ | `boolean` <br>Whether note is protected |+ | `blobId` | `string` <br>ID of content blob |+ | `dateCreated` | `string (date-time)` |+ | `dateModified` | `string (date-time)` |+ | `utcDateCreated` | `string (date-time)` |+ | `utcDateModified` | `string (date-time)` |++ </div>+ <div class="trilium-multicolumn-column">++ ```json+ {+ "noteId": "ur11rSfHkzeV",+ "title": "string",+ "type": "text",+ "mime": "text/html",+ "isProtected": true,+ "blobId": "string",+ "dateCreated": "2019-08-24T14:15:22Z",+ "dateModified": "2019-08-24T14:15:22Z",+ "utcDateCreated": "2019-08-24T14:15:22Z",+ "utcDateModified": "2019-08-24T14:15:22Z"+ }+ ```++ </div>+ </div>++### Create launcher++`POST /api/special-notes/launchers/{parentNoteId}/{launcherType}` · `createLauncher`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `parentNoteId` <br>_required_ | `string` |+| `launcherType` <br>_required_ | `string` |++**Responses**++=== "201: Launcher created"++ * `application/json`: `Note`++ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+ <div class="trilium-multicolumn-column">++ | Property | Description |+ | --- | --- |+ | `noteId` <br>_required_ | `string` <br>12-character note ID |+ | `title` <br>_required_ | `string` <br>Note title |+ | `type` <br>_required_ | `NoteType` <br>One of `text`, `code`, `render`, `file`, `image`, `search`, `relationMap`, `book`, `noteMap`, `mermaid`, `canvas`, `webView`, `launcher`, `doc`, `contentWidget`, `mindMap`, `geoMap`. |+ | `mime` <br>_required_ | `string` <br>MIME type |+ | `isProtected` <br>_required_ | `boolean` <br>Whether note is protected |+ | `blobId` | `string` <br>ID of content blob |+ | `dateCreated` | `string (date-time)` |+ | `dateModified` | `string (date-time)` |+ | `utcDateCreated` | `string (date-time)` |+ | `utcDateModified` | `string (date-time)` |++ </div>+ <div class="trilium-multicolumn-column">++ ```json+ {+ "noteId": "ur11rSfHkzeV",+ "title": "string",+ "type": "text",+ "mime": "text/html",+ "isProtected": true,+ "blobId": "string",+ "dateCreated": "2019-08-24T14:15:22Z",+ "dateModified": "2019-08-24T14:15:22Z",+ "utcDateCreated": "2019-08-24T14:15:22Z",+ "utcDateModified": "2019-08-24T14:15:22Z"+ }+ ```++ </div>+ </div>++### Get notes for specific month++`GET /api/special-notes/notes-for-month/{month}` · `getNotesForMonth`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `month` <br>_required_ | `string` |++**Responses**++=== "200: Notes for the month"++ * `application/json`: `array of Note`++ ```json+ [+ {+ "noteId": "ur11rSfHkzeV",+ "title": "string",+ "type": "text",+ "mime": "text/html",+ "isProtected": true,+ "blobId": "string",+ "dateCreated": "2019-08-24T14:15:22Z",+ "dateModified": "2019-08-24T14:15:22Z",+ "utcDateCreated": "2019-08-24T14:15:22Z",+ "utcDateModified": "2019-08-24T14:15:22Z"+ }+ ]+ ```++### Get quarter note++`GET /api/special-notes/quarters/{quarter}` · `getQuarter`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `quarter` <br>_required_ | `string` |++**Responses**++=== "200: Quarter note"++ * `application/json`: `Note`++ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+ <div class="trilium-multicolumn-column">++ | Property | Description |+ | --- | --- |+ | `noteId` <br>_required_ | `string` <br>12-character note ID |+ | `title` <br>_required_ | `string` <br>Note title |+ | `type` <br>_required_ | `NoteType` <br>One of `text`, `code`, `render`, `file`, `image`, `search`, `relationMap`, `book`, `noteMap`, `mermaid`, `canvas`, `webView`, `launcher`, `doc`, `contentWidget`, `mindMap`, `geoMap`. |+ | `mime` <br>_required_ | `string` <br>MIME type |+ | `isProtected` <br>_required_ | `boolean` <br>Whether note is protected |+ | `blobId` | `string` <br>ID of content blob |+ | `dateCreated` | `string (date-time)` |+ | `dateModified` | `string (date-time)` |+ | `utcDateCreated` | `string (date-time)` |+ | `utcDateModified` | `string (date-time)` |++ </div>+ <div class="trilium-multicolumn-column">++ ```json+ {+ "noteId": "ur11rSfHkzeV",+ "title": "string",+ "type": "text",+ "mime": "text/html",+ "isProtected": true,+ "blobId": "string",+ "dateCreated": "2019-08-24T14:15:22Z",+ "dateModified": "2019-08-24T14:15:22Z",+ "utcDateCreated": "2019-08-24T14:15:22Z",+ "utcDateModified": "2019-08-24T14:15:22Z"+ }+ ```++ </div>+ </div>++### Get first day of week for date++`GET /api/special-notes/week-first-day/{date}` · `getWeekFirstDay`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `date` <br>_required_ | `string (date)` |++**Responses**++=== "200: First day of week"++ * `application/json`: `object`++ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+ <div class="trilium-multicolumn-column">++ | Property | Description |+ | --- | --- |+ | `date` | `string (date)` |++ </div>+ <div class="trilium-multicolumn-column">++ ```json+ {+ "date": "2019-08-24"+ }+ ```++ </div>+ </div>++### Reset launcher note++`POST /api/special-notes/launchers/{noteId}/reset` · `resetLauncher`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `noteId` <br>_required_ | `string` <br>12-character note ID |++**Responses**++=== "200: Launcher reset"++ * `application/json`: `Note`++ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+ <div class="trilium-multicolumn-column">++ | Property | Description |+ | --- | --- |+ | `noteId` <br>_required_ | `string` <br>12-character note ID |+ | `title` <br>_required_ | `string` <br>Note title |+ | `type` <br>_required_ | `NoteType` <br>One of `text`, `code`, `render`, `file`, `image`, `search`, `relationMap`, `book`, `noteMap`, `mermaid`, `canvas`, `webView`, `launcher`, `doc`, `contentWidget`, `mindMap`, `geoMap`. |+ | `mime` <br>_required_ | `string` <br>MIME type |+ | `isProtected` <br>_required_ | `boolean` <br>Whether note is protected |+ | `blobId` | `string` <br>ID of content blob |+ | `dateCreated` | `string (date-time)` |+ | `dateModified` | `string (date-time)` |+ | `utcDateCreated` | `string (date-time)` |+ | `utcDateModified` | `string (date-time)` |++ </div>+ <div class="trilium-multicolumn-column">++ ```json+ {+ "noteId": "ur11rSfHkzeV",+ "title": "string",+ "type": "text",+ "mime": "text/html",+ "isProtected": true,+ "blobId": "string",+ "dateCreated": "2019-08-24T14:15:22Z",+ "dateModified": "2019-08-24T14:15:22Z",+ "utcDateCreated": "2019-08-24T14:15:22Z",+ "utcDateModified": "2019-08-24T14:15:22Z"+ }+ ```++ </div>+ </div>++### Save search note++`POST /api/special-notes/save-search-note` · `saveSearchNote`++**Authorization**: `sessionAuth` or `tokenAuth`++**Request body** (required)++* `application/json`: `object`++<div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+<div class="trilium-multicolumn-column">++| Property | Description |+| --- | --- |+| `query` | `string` |+| `title` | `string` |++</div>+<div class="trilium-multicolumn-column">++```json+{+ "query": "string",+ "title": "string"+}+```++</div>+</div>++**Responses**++=== "201: Search note saved"++ * `application/json`: `Note`++ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+ <div class="trilium-multicolumn-column">++ | Property | Description |+ | --- | --- |+ | `noteId` <br>_required_ | `string` <br>12-character note ID |+ | `title` <br>_required_ | `string` <br>Note title |+ | `type` <br>_required_ | `NoteType` <br>One of `text`, `code`, `render`, `file`, `image`, `search`, `relationMap`, `book`, `noteMap`, `mermaid`, `canvas`, `webView`, `launcher`, `doc`, `contentWidget`, `mindMap`, `geoMap`. |+ | `mime` <br>_required_ | `string` <br>MIME type |+ | `isProtected` <br>_required_ | `boolean` <br>Whether note is protected |+ | `blobId` | `string` <br>ID of content blob |+ | `dateCreated` | `string (date-time)` |+ | `dateModified` | `string (date-time)` |+ | `utcDateCreated` | `string (date-time)` |+ | `utcDateModified` | `string (date-time)` |++ </div>+ <div class="trilium-multicolumn-column">++ ```json+ {+ "noteId": "ur11rSfHkzeV",+ "title": "string",+ "type": "text",+ "mime": "text/html",+ "isProtected": true,+ "blobId": "string",+ "dateCreated": "2019-08-24T14:15:22Z",+ "dateModified": "2019-08-24T14:15:22Z",+ "utcDateCreated": "2019-08-24T14:15:22Z",+ "utcDateModified": "2019-08-24T14:15:22Z"+ }+ ```++ </div>+ </div>++### Save SQL console note++`POST /api/special-notes/save-sql-console` · `saveSqlConsole`++**Authorization**: `sessionAuth` or `tokenAuth`++**Request body** (required)++* `application/json`: `object`++<div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+<div class="trilium-multicolumn-column">++| Property | Description |+| --- | --- |+| `sql` | `string` |+| `title` | `string` |++</div>+<div class="trilium-multicolumn-column">++```json+{+ "sql": "string",+ "title": "string"+}+```++</div>+</div>++**Responses**++=== "201: SQL console saved"++ * `application/json`: `Note`++ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+ <div class="trilium-multicolumn-column">++ | Property | Description |+ | --- | --- |+ | `noteId` <br>_required_ | `string` <br>12-character note ID |+ | `title` <br>_required_ | `string` <br>Note title |+ | `type` <br>_required_ | `NoteType` <br>One of `text`, `code`, `render`, `file`, `image`, `search`, `relationMap`, `book`, `noteMap`, `mermaid`, `canvas`, `webView`, `launcher`, `doc`, `contentWidget`, `mindMap`, `geoMap`. |+ | `mime` <br>_required_ | `string` <br>MIME type |+ | `isProtected` <br>_required_ | `boolean` <br>Whether note is protected |+ | `blobId` | `string` <br>ID of content blob |+ | `dateCreated` | `string (date-time)` |+ | `dateModified` | `string (date-time)` |+ | `utcDateCreated` | `string (date-time)` |+ | `utcDateModified` | `string (date-time)` |++ </div>+ <div class="trilium-multicolumn-column">++ ```json+ {+ "noteId": "ur11rSfHkzeV",+ "title": "string",+ "type": "text",+ "mime": "text/html",+ "isProtected": true,+ "blobId": "string",+ "dateCreated": "2019-08-24T14:15:22Z",+ "dateModified": "2019-08-24T14:15:22Z",+ "utcDateCreated": "2019-08-24T14:15:22Z",+ "utcDateModified": "2019-08-24T14:15:22Z"+ }+ ```++ </div>+ </div>++### Update API script launcher++`PUT /api/special-notes/api-script-launcher` · `updateApiScriptLauncher`++**Authorization**: `sessionAuth` or `tokenAuth`++**Request body** (required)++* `application/json`: `object`++<div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+<div class="trilium-multicolumn-column">++| Property | Description |+| --- | --- |+| `code` | `string` <br>Script code |++</div>+<div class="trilium-multicolumn-column">++```json+{+ "code": "string"+}+```++</div>+</div>++**Responses**++=== "200: API script launcher updated"++ * `application/json`: `Note`++ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+ <div class="trilium-multicolumn-column">++ | Property | Description |+ | --- | --- |+ | `noteId` <br>_required_ | `string` <br>12-character note ID |+ | `title` <br>_required_ | `string` <br>Note title |+ | `type` <br>_required_ | `NoteType` <br>One of `text`, `code`, `render`, `file`, `image`, `search`, `relationMap`, `book`, `noteMap`, `mermaid`, `canvas`, `webView`, `launcher`, `doc`, `contentWidget`, `mindMap`, `geoMap`. |+ | `mime` <br>_required_ | `string` <br>MIME type |+ | `isProtected` <br>_required_ | `boolean` <br>Whether note is protected |+ | `blobId` | `string` <br>ID of content blob |+ | `dateCreated` | `string (date-time)` |+ | `dateModified` | `string (date-time)` |+ | `utcDateCreated` | `string (date-time)` |+ | `utcDateModified` | `string (date-time)` |++ </div>+ <div class="trilium-multicolumn-column">++ ```json+ {+ "noteId": "ur11rSfHkzeV",+ "title": "string",+ "type": "text",+ "mime": "text/html",+ "isProtected": true,+ "blobId": "string",+ "dateCreated": "2019-08-24T14:15:22Z",+ "dateModified": "2019-08-24T14:15:22Z",+ "utcDateCreated": "2019-08-24T14:15:22Z",+ "utcDateModified": "2019-08-24T14:15:22Z"+ }+ ```++ </div>+ </div>++## Visualization++Maps and visualizations++### Get tree map++`POST /api/note-map/{noteId}/tree` · `getTreeMap`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `noteId` <br>_required_ | `string` <br>12-character note ID |++**Responses**++=== "200: Tree map data"++ * `application/json`: `object`++ ```json+ {}+ ```++### Get link map++`POST /api/note-map/{noteId}/link` · `getLinkMap`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `noteId` <br>_required_ | `string` <br>12-character note ID |++**Responses**++=== "200: Link map data"++ * `application/json`: `object`++ ```json+ {}+ ```++### Get backlinks++`GET /api/note-map/{noteId}/backlinks` · `getBacklinks`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `noteId` <br>_required_ | `string` <br>12-character note ID |++**Responses**++=== "200: Backlinks"++ * `application/json`: `array of object`++ ```json+ [+ {+ "noteId": "string",+ "title": "string"+ }+ ]+ ```++### Get backlink count for note++`GET /api/note-map/{noteId}/backlink-count` · `getBacklinkCount`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `noteId` <br>_required_ | `string` <br>12-character note ID |++**Responses**++=== "200: Backlink count"++ * `application/json`: `object`++ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+ <div class="trilium-multicolumn-column">++ | Property | Description |+ | --- | --- |+ | `count` | `integer` <br>Number of backlinks to this note |++ </div>+ <div class="trilium-multicolumn-column">++ ```json+ {+ "count": 0+ }+ ```++ </div>+ </div>++### Get relation map data++`POST /api/relation-map` · `getRelationMap`++**Authorization**: `sessionAuth` or `tokenAuth`++**Request body** (required)++* `application/json`: `object`++<div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+<div class="trilium-multicolumn-column">++| Property | Description |+| --- | --- |+| `noteId` | `string` |+| `maxDepth` | `integer` |+| `excludeArchived` | `boolean` |++</div>+<div class="trilium-multicolumn-column">++```json+{+ "noteId": "string",+ "maxDepth": 0,+ "excludeArchived": true+}+```++</div>+</div>++**Responses**++=== "200: Relation map data"++ * `application/json`: `object`++ ```json+ {}+ ```++## External++External integrations (clipper, sender)++### Clipper handshake++`GET /api/clipper/handshake` · `clipperHandshake`++**Authorization**: `sessionAuth` or `tokenAuth`++**Responses**++=== "200: Handshake successful"++ * `application/json`: `object`++ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+ <div class="trilium-multicolumn-column">++ | Property | Description |+ | --- | --- |+ | `protocolVersion` | `string` |++ </div>+ <div class="trilium-multicolumn-column">++ ```json+ {+ "protocolVersion": "string"+ }+ ```++ </div>+ </div>++### Add web clipping++`POST /api/clipper/clippings` · `addClipping`++**Authorization**: `sessionAuth` or `tokenAuth`++**Request body** (required)++* `application/json`: `object`++<div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+<div class="trilium-multicolumn-column">++| Property | Description |+| --- | --- |+| `title` | `string` |+| `content` | `string` |+| `url` | `string` |++</div>+<div class="trilium-multicolumn-column">++```json+{+ "title": "string",+ "content": "string",+ "url": "string"+}+```++</div>+</div>++**Responses**++=== "201: Clipping created"++ * `application/json`: `Note`++ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+ <div class="trilium-multicolumn-column">++ | Property | Description |+ | --- | --- |+ | `noteId` <br>_required_ | `string` <br>12-character note ID |+ | `title` <br>_required_ | `string` <br>Note title |+ | `type` <br>_required_ | `NoteType` <br>One of `text`, `code`, `render`, `file`, `image`, `search`, `relationMap`, `book`, `noteMap`, `mermaid`, `canvas`, `webView`, `launcher`, `doc`, `contentWidget`, `mindMap`, `geoMap`. |+ | `mime` <br>_required_ | `string` <br>MIME type |+ | `isProtected` <br>_required_ | `boolean` <br>Whether note is protected |+ | `blobId` | `string` <br>ID of content blob |+ | `dateCreated` | `string (date-time)` |+ | `dateModified` | `string (date-time)` |+ | `utcDateCreated` | `string (date-time)` |+ | `utcDateModified` | `string (date-time)` |++ </div>+ <div class="trilium-multicolumn-column">++ ```json+ {+ "noteId": "ur11rSfHkzeV",+ "title": "string",+ "type": "text",+ "mime": "text/html",+ "isProtected": true,+ "blobId": "string",+ "dateCreated": "2019-08-24T14:15:22Z",+ "dateModified": "2019-08-24T14:15:22Z",+ "utcDateCreated": "2019-08-24T14:15:22Z",+ "utcDateModified": "2019-08-24T14:15:22Z"+ }+ ```++ </div>+ </div>++### Create clipper note++`POST /api/clipper/notes` · `createClipperNote`++**Authorization**: `sessionAuth` or `tokenAuth`++**Request body** (required)++* `application/json`: `object`++<div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+<div class="trilium-multicolumn-column">++| Property | Description |+| --- | --- |+| `title` | `string` |+| `content` | `string` |+| `parentNoteId` | `string` |++</div>+<div class="trilium-multicolumn-column">++```json+{+ "title": "string",+ "content": "string",+ "parentNoteId": "string"+}+```++</div>+</div>++**Responses**++=== "201: Note created"++ * `application/json`: `Note`++ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+ <div class="trilium-multicolumn-column">++ | Property | Description |+ | --- | --- |+ | `noteId` <br>_required_ | `string` <br>12-character note ID |+ | `title` <br>_required_ | `string` <br>Note title |+ | `type` <br>_required_ | `NoteType` <br>One of `text`, `code`, `render`, `file`, `image`, `search`, `relationMap`, `book`, `noteMap`, `mermaid`, `canvas`, `webView`, `launcher`, `doc`, `contentWidget`, `mindMap`, `geoMap`. |+ | `mime` <br>_required_ | `string` <br>MIME type |+ | `isProtected` <br>_required_ | `boolean` <br>Whether note is protected |+ | `blobId` | `string` <br>ID of content blob |+ | `dateCreated` | `string (date-time)` |+ | `dateModified` | `string (date-time)` |+ | `utcDateCreated` | `string (date-time)` |+ | `utcDateModified` | `string (date-time)` |++ </div>+ <div class="trilium-multicolumn-column">++ ```json+ {+ "noteId": "ur11rSfHkzeV",+ "title": "string",+ "type": "text",+ "mime": "text/html",+ "isProtected": true,+ "blobId": "string",+ "dateCreated": "2019-08-24T14:15:22Z",+ "dateModified": "2019-08-24T14:15:22Z",+ "utcDateCreated": "2019-08-24T14:15:22Z",+ "utcDateModified": "2019-08-24T14:15:22Z"+ }+ ```++ </div>+ </div>++### Open note in clipper++`POST /api/clipper/open/{noteId}` · `openNoteInClipper`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `noteId` <br>_required_ | `string` <br>12-character note ID |++**Responses**++=== "200: Note opened in clipper"++ * `application/json`: `object`++ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+ <div class="trilium-multicolumn-column">++ | Property | Description |+ | --- | --- |+ | `success` | `boolean` |+ | `url` | `string` <br>URL to open in clipper |++ </div>+ <div class="trilium-multicolumn-column">++ ```json+ {+ "success": true,+ "url": "string"+ }+ ```++ </div>+ </div>++### Sender login++`POST /api/sender/login` · `senderLogin`++**Authorization**: none++**Request body** (required)++* `application/json`: `object`++<div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+<div class="trilium-multicolumn-column">++| Property | Description |+| --- | --- |+| `username` <br>_required_ | `string` |+| `password` <br>_required_ | `string` |++</div>+<div class="trilium-multicolumn-column">++```json+{+ "username": "string",+ "password": "string"+}+```++</div>+</div>++**Responses**++=== "200: Login successful"++ * `application/json`: `object`++ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+ <div class="trilium-multicolumn-column">++ | Property | Description |+ | --- | --- |+ | `token` | `string` |++ </div>+ <div class="trilium-multicolumn-column">++ ```json+ {+ "token": "string"+ }+ ```++ </div>+ </div>++### Upload image from sender++`POST /api/sender/image` · `uploadSenderImage`++**Authorization**: `sessionAuth` or `tokenAuth`++**Request body** (required)++* `multipart/form-data`: `object`++| Property | Description |+| --- | --- |+| `upload` | `string (binary)` |++**Responses**++=== "201: Image uploaded"++ * `application/json`: `Note`++ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+ <div class="trilium-multicolumn-column">++ | Property | Description |+ | --- | --- |+ | `noteId` <br>_required_ | `string` <br>12-character note ID |+ | `title` <br>_required_ | `string` <br>Note title |+ | `type` <br>_required_ | `NoteType` <br>One of `text`, `code`, `render`, `file`, `image`, `search`, `relationMap`, `book`, `noteMap`, `mermaid`, `canvas`, `webView`, `launcher`, `doc`, `contentWidget`, `mindMap`, `geoMap`. |+ | `mime` <br>_required_ | `string` <br>MIME type |+ | `isProtected` <br>_required_ | `boolean` <br>Whether note is protected |+ | `blobId` | `string` <br>ID of content blob |+ | `dateCreated` | `string (date-time)` |+ | `dateModified` | `string (date-time)` |+ | `utcDateCreated` | `string (date-time)` |+ | `utcDateModified` | `string (date-time)` |++ </div>+ <div class="trilium-multicolumn-column">++ ```json+ {+ "noteId": "ur11rSfHkzeV",+ "title": "string",+ "type": "text",+ "mime": "text/html",+ "isProtected": true,+ "blobId": "string",+ "dateCreated": "2019-08-24T14:15:22Z",+ "dateModified": "2019-08-24T14:15:22Z",+ "utcDateCreated": "2019-08-24T14:15:22Z",+ "utcDateModified": "2019-08-24T14:15:22Z"+ }+ ```++ </div>+ </div>++### Save note from sender++`POST /api/sender/note` · `saveSenderNote`++**Authorization**: `sessionAuth` or `tokenAuth`++**Request body** (required)++* `application/json`: `object`++<div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+<div class="trilium-multicolumn-column">++| Property | Description |+| --- | --- |+| `title` | `string` |+| `content` | `string` |++</div>+<div class="trilium-multicolumn-column">++```json+{+ "title": "string",+ "content": "string"+}+```++</div>+</div>++**Responses**++=== "201: Note saved"++ * `application/json`: `Note`++ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+ <div class="trilium-multicolumn-column">++ | Property | Description |+ | --- | --- |+ | `noteId` <br>_required_ | `string` <br>12-character note ID |+ | `title` <br>_required_ | `string` <br>Note title |+ | `type` <br>_required_ | `NoteType` <br>One of `text`, `code`, `render`, `file`, `image`, `search`, `relationMap`, `book`, `noteMap`, `mermaid`, `canvas`, `webView`, `launcher`, `doc`, `contentWidget`, `mindMap`, `geoMap`. |+ | `mime` <br>_required_ | `string` <br>MIME type |+ | `isProtected` <br>_required_ | `boolean` <br>Whether note is protected |+ | `blobId` | `string` <br>ID of content blob |+ | `dateCreated` | `string (date-time)` |+ | `dateModified` | `string (date-time)` |+ | `utcDateCreated` | `string (date-time)` |+ | `utcDateModified` | `string (date-time)` |++ </div>+ <div class="trilium-multicolumn-column">++ ```json+ {+ "noteId": "ur11rSfHkzeV",+ "title": "string",+ "type": "text",+ "mime": "text/html",+ "isProtected": true,+ "blobId": "string",+ "dateCreated": "2019-08-24T14:15:22Z",+ "dateModified": "2019-08-24T14:15:22Z",+ "utcDateCreated": "2019-08-24T14:15:22Z",+ "utcDateModified": "2019-08-24T14:15:22Z"+ }+ ```++ </div>+ </div>++## Utilities++Miscellaneous utilities++### Get system metrics++`GET /api/metrics` · `getMetrics`++**Authorization**: `sessionAuth` or `tokenAuth`++**Query parameters**++| Name | Description |+| --- | --- |+| `format` | `string` <br>One of `prometheus`, `json`. |++**Responses**++=== "200: System metrics"++ === "`application/json`: `object`"++ ```json+ {}+ ```++ === "`text/plain`: `string`"++### Run system diagnostics++`GET /api/system-checks` · `runSystemChecks`++**Authorization**: `sessionAuth` or `tokenAuth`++**Responses**++=== "200: System check results"++ * `application/json`: `array of object`++ ```json+ [+ {+ "name": "string",+ "status": "pass",+ "message": "string"+ }+ ]+ ```++### Health check endpoint++`GET /api/health-check` · `healthCheck`++**Authorization**: none++**Responses**++=== "200: Service is healthy"++ * `text/plain`: `string`++### Get backend log++`GET /api/backend-log` · `getBackendLog`++**Authorization**: `sessionAuth` or `tokenAuth`++**Responses**++=== "200: Backend log entries"++ * `application/json`: `array of object`++ ```json+ [+ {+ "timestamp": "2019-08-24T14:15:22Z",+ "level": "string",+ "message": "string"+ }+ ]+ ```++### Get note size++`GET /api/stats/note-size/{noteId}` · `getNoteSize`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `noteId` <br>_required_ | `string` <br>12-character note ID |++**Responses**++=== "200: Note size"++ * `application/json`: `object`++ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+ <div class="trilium-multicolumn-column">++ | Property | Description |+ | --- | --- |+ | `size` | `integer` |++ </div>+ <div class="trilium-multicolumn-column">++ ```json+ {+ "size": 0+ }+ ```++ </div>+ </div>++### Get subtree size++`GET /api/stats/subtree-size/{noteId}` · `getSubtreeSize`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `noteId` <br>_required_ | `string` <br>12-character note ID |++**Responses**++=== "200: Subtree size"++ * `application/json`: `object`++ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+ <div class="trilium-multicolumn-column">++ | Property | Description |+ | --- | --- |+ | `size` | `integer` |++ </div>+ <div class="trilium-multicolumn-column">++ ```json+ {+ "size": 0+ }+ ```++ </div>+ </div>++### Get keyboard actions++`GET /api/keyboard-actions` · `getKeyboardActions`++**Authorization**: `sessionAuth` or `tokenAuth`++**Responses**++=== "200: Keyboard actions"++ * `application/json`: `array of object`++ ```json+ [+ {+ "actionName": "string",+ "shortcut": "string",+ "description": "string"+ }+ ]+ ```++### Get keyboard shortcuts for notes++`GET /api/keyboard-shortcuts-for-notes` · `getKeyboardShortcutsForNotes`++**Authorization**: `sessionAuth` or `tokenAuth`++**Responses**++=== "200: Keyboard shortcuts for notes"++ * `application/json`: `array of object`++ ```json+ [+ {+ "noteId": "string",+ "shortcut": "string",+ "title": "string"+ }+ ]+ ```++### Get font CSS++`GET /api/fonts` · `getFonts`++**Authorization**: `sessionAuth` or `tokenAuth`++**Responses**++=== "200: Font CSS"++ * `text/css`: `string`++### Add recent note++`POST /api/recent-notes` · `addRecentNote`++**Authorization**: `sessionAuth` or `tokenAuth`++**Request body** (required)++* `application/json`: `object`++<div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+<div class="trilium-multicolumn-column">++| Property | Description |+| --- | --- |+| `noteId` <br>_required_ | `string` |++</div>+<div class="trilium-multicolumn-column">++```json+{+ "noteId": "string"+}+```++</div>+</div>++**Responses**++=== "204: Note added to recent"++ No content.++### Get recent changes++`GET /api/recent-changes/{ancestorNoteId}` · `getRecentChanges`++**Authorization**: `sessionAuth` or `tokenAuth`++**Path parameters**++| Name | Description |+| --- | --- |+| `ancestorNoteId` <br>_required_ | `string` |++**Responses**++=== "200: Recent changes"++ * `application/json`: `array of object`++ ```json+ [+ {+ "noteId": "string",+ "title": "string",+ "dateModified": "2019-08-24T14:15:22Z"+ }+ ]+ ```++### Get icon usage statistics++`GET /api/other/icon-usage` · `getIconUsage`++**Authorization**: `sessionAuth` or `tokenAuth`++**Responses**++=== "200: Icon usage stats"++ * `application/json`: `object`++ ```json+ {}+ ```++### Render markdown to HTML++`POST /api/other/render-markdown` · `renderMarkdown`++**Authorization**: `sessionAuth` or `tokenAuth`++**Request body** (required)++* `application/json`: `object`++<div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+<div class="trilium-multicolumn-column">++| Property | Description |+| --- | --- |+| `markdownContent` <br>_required_ | `string` |++</div>+<div class="trilium-multicolumn-column">++```json+{+ "markdownContent": "string"+}+```++</div>+</div>++**Responses**++=== "200: Rendered HTML"++ * `text/html`: `string`++### Renders given HTML to Markdown++`POST /api/other/to-markdown` · `toMarkdown`++**Authorization**: `sessionAuth` or `tokenAuth`++**Request body** (required)++* `application/json`: `object`++<div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">+<div class="trilium-multicolumn-column">++| Property | Description |+| --- | --- |+| `htmlContent` <br>_required_ | `string` |++</div>+<div class="trilium-multicolumn-column">++```json+{+ "htmlContent": "string"+}+```++</div>+</div>++**Responses**++=== "200: The input text rendered as Markdown"++ * `text/plain`: `string`++## Schemas++### `Note`++| Property | Description |+| --- | --- |+| `noteId` <br>_required_ | `string` <br>12-character note ID |+| `title` <br>_required_ | `string` <br>Note title |+| `type` <br>_required_ | `NoteType` <br>One of `text`, `code`, `render`, `file`, `image`, `search`, `relationMap`, `book`, `noteMap`, `mermaid`, `canvas`, `webView`, `launcher`, `doc`, `contentWidget`, `mindMap`, `geoMap`. |+| `mime` <br>_required_ | `string` <br>MIME type |+| `isProtected` <br>_required_ | `boolean` <br>Whether note is protected |+| `blobId` | `string` <br>ID of content blob |+| `dateCreated` | `string (date-time)` |+| `dateModified` | `string (date-time)` |+| `utcDateCreated` | `string (date-time)` |+| `utcDateModified` | `string (date-time)` |++### `NoteType`++Type: `string`++### `Branch`++| Property | Description |+| --- | --- |+| `branchId` <br>_required_ | `string` <br>Branch ID (parentNoteId\_noteId) |+| `noteId` <br>_required_ | `string` |+| `parentNoteId` <br>_required_ | `string` |+| `notePosition` <br>_required_ | `integer` |+| `prefix` | `string \| null` |+| `isExpanded` | `boolean` |++### `Attribute`++| Property | Description |+| --- | --- |+| `attributeId` <br>_required_ | `string` |+| `noteId` <br>_required_ | `string` |+| `type` <br>_required_ | `string` <br>One of `label`, `relation`. |+| `name` <br>_required_ | `string` |+| `value` <br>_required_ | `string` |+| `position` | `integer` |+| `isInheritable` | `boolean` |++### `Attachment`++| Property | Description |+| --- | --- |+| `attachmentId` <br>_required_ | `string` |+| `ownerId` <br>_required_ | `string` |+| `role` <br>_required_ | `string` <br>One of `image`, `file`. |+| `mime` <br>_required_ | `string` |+| `title` <br>_required_ | `string` |+| `blobId` | `string` |+| `dateModified` | `string (date-time)` |+| `utcDateModified` | `string (date-time)` |++### `Revision`++| Property | Description |+| --- | --- |+| `revisionId` | `string` |+| `noteId` | `string` |+| `title` | `string` |+| `type` | `NoteType` <br>One of `text`, `code`, `render`, `file`, `image`, `search`, `relationMap`, `book`, `noteMap`, `mermaid`, `canvas`, `webView`, `launcher`, `doc`, `contentWidget`, `mindMap`, `geoMap`. |+| `mime` | `string` |+| `dateCreated` | `string (date-time)` |+| `utcDateCreated` | `string (date-time)` |++### `SearchResult`++| Property | Description |+| --- | --- |+| `noteId` | `string` |+| `title` | `string` |+| `path` | `string` |+| `score` | `number` |+| `highlights` | `array of string` |++### `EntityChange`++| Property | Description |+| --- | --- |+| `entityChange` | `object` |+| `entity` | `object` |++### `Timestamps`++| Property | Description |+| --- | --- |+| `dateCreated` | `string (date-time)` |+| `dateModified` | `string (date-time)` |+| `utcDateCreated` | `string (date-time)` |+| `utcDateModified` | `string (date-time)` |++### `CreateNoteRequest`++| Property | Description |+| --- | --- |+| `title` <br>_required_ | `string` |+| `content` | `string` |+| `type` <br>_required_ | `NoteType` <br>One of `text`, `code`, `render`, `file`, `image`, `search`, `relationMap`, `book`, `noteMap`, `mermaid`, `canvas`, `webView`, `launcher`, `doc`, `contentWidget`, `mindMap`, `geoMap`. |+| `mime` | `string` |+| `isProtected` | `boolean` |+| `isExpanded` | `boolean` |+| `notePosition` | `integer` |+| `prefix` | `string` |+| `parentNoteId` | `string` |+| `templateNoteId` | `string` |++### `ScriptBundle`++| Property | Description |+| --- | --- |+| `noteId` | `string` |+| `script` | `string` |+| `html` | `string` |+| `css` | `string` |++### `AppInfo`++| Property | Description |+| --- | --- |+| `appVersion` | `string` |+| `dbVersion` | `integer` |+| `nodeVersion` | `string` |+| `syncVersion` | `integer` |+| `buildDate` | `string (date-time)` |+| `buildRevision` | `string` |+| `dataDirectory` | `string` |+| `clipperProtocolVersion` | `string` |+| `utcDateTime` | `string (date-time)` |++### `ChatSession`++| Property | Description |+| --- | --- |+| `sessionId` | `string` |+| `title` | `string` |+| `messages` | `array of object` |+| `createdAt` | `string (date-time)` |+| `lastActive` | `string (date-time)` |+| `messageCount` | `integer` |++### `EtapiToken`++| Property | Description |+| --- | --- |+| `etapiTokenId` | `string` |+| `name` | `string` |+| `token` | `string` |+| `dateCreated` | `string (date-time)` |+| `isDeleted` | `boolean` |\ No newline at end of filediff --git a/edit-docs-config.yaml b/edit-docs-config.yamlindex 22ce46c0b4..319e57aedf 100644--- a/edit-docs-config.yaml+++ b/edit-docs-config.yaml@@ -12,6 +12,8 @@ noteMappings:openApiPages:- noteId: "9qPsTWBorUhQ" # ETAPI (REST API) › API Referencespec: "apps/server/src/assets/etapi.openapi.yaml"+ - noteId: "z8O2VG4ZZJD7" # Internal API › API Reference+ spec: "apps/server/internal.openapi.yaml"- rootNoteId: "jdjRLhLV3TtI"path: "docs/Developer Guide"