Skip to content

Build your personal knowledge base with Trilium Notes

feat(docs): list response headers in the API reference

Elian Doran85aefe356642
diff --git a/apps/edit-docs/src/openapi_markdown.spec.ts b/apps/edit-docs/src/openapi_markdown.spec.ts
index 29496ec643..b69404dee4 100644
--- a/apps/edit-docs/src/openapi_markdown.spec.ts
+++ b/apps/edit-docs/src/openapi_markdown.spec.ts
@@ -137,6 +137,70 @@ describe("openApiToMarkdown", () => {
].join("\n"));
});
+ it("lists a response's headers ahead of its body", () => {
+ const markdown = openApiToMarkdown({
+ info: { title: "Internal API" },
+ paths: {
+ "/login": {
+ post: {
+ operationId: "login",
+ responses: {
+ "200": {
+ description: "Login successful",
+ headers: {
+ "Set-Cookie": { schema: { type: "string", example: "trilium.sid=s%3A..." } }
+ }
+ }
+ }
+ }
+ },
+ "/download": {
+ get: {
+ operationId: "download",
+ responses: {
+ "200": {
+ description: "File",
+ headers: {
+ "Content-Disposition": { $ref: "#/components/headers/Disposition" }
+ },
+ content: { "application/octet-stream": { schema: { type: "string", format: "binary" } } }
+ }
+ }
+ }
+ }
+ },
+ components: {
+ headers: {
+ Disposition: { description: "How to save the file.", required: true, schema: { type: "string" } }
+ }
+ }
+ });
+
+ // A response without a body still says so below its headers.
+ expect(markdown).toContain([
+ "=== \"200: Login successful\"",
+ "",
+ " **Response headers**",
+ "",
+ " | Name | Description |",
+ " | --- | --- |",
+ " | `Set-Cookie` | `string`<br>Example: `trilium.sid=s%3A...` |",
+ "",
+ " No content."
+ ].join("\n"));
+ expect(markdown).toContain([
+ "=== \"200: File\"",
+ "",
+ " **Response headers**",
+ "",
+ " | Name | Description |",
+ " | --- | --- |",
+ " | `Content-Disposition`<br>*required* | `string`<br>How to save the file. |",
+ "",
+ " * `application/octet-stream`: `string (binary)`"
+ ].join("\n"));
+ });
+
it("groups operations by their first tag when the spec has tags", () => {
const spec: OpenApiSpec = {
info: { title: "Internal" },
@@ -220,6 +284,7 @@ describe("openApiToMarkdown", () => {
].join("\n"));
});
+
it("renders JSON samples of request and response bodies", () => {
const note = { $ref: "#/components/schemas/Note" };
const spec: OpenApiSpec = {
diff --git a/apps/edit-docs/src/openapi_markdown.ts b/apps/edit-docs/src/openapi_markdown.ts
index b4150388b9..c5418c42e8 100644
--- a/apps/edit-docs/src/openapi_markdown.ts
+++ b/apps/edit-docs/src/openapi_markdown.ts
@@ -18,6 +18,7 @@ export interface OpenApiSpec {
parameters?: Record<string, Parameter>;
requestBodies?: Record<string, RequestBody>;
responses?: Record<string, Response>;
+ headers?: Record<string, Header>;
securitySchemes?: Record<string, SecurityScheme>;
};
}
@@ -81,8 +82,16 @@ interface RequestBody extends MediaTypes {
required?: boolean;
}
+interface Header {
+ description?: string;
+ required?: boolean;
+ schema?: Schema;
+ example?: unknown;
+}
+
interface Response extends MediaTypes {
description?: string;
+ headers?: Record<string, Header | Reference>;
}
interface Operation {
@@ -224,12 +233,10 @@ function renderOperation(spec: OpenApiSpec, { method, path, pathItem, operation
}
// One tab per status; consecutive tabs form a single tab block.
for (const [ status, response ] of responses) {
- const { description, content } = resolve<Response>(spec, response);
+ const { description, headers, content } = resolve<Response>(spec, response);
- const panel = renderContent(spec, content ?? {}, "response");
- if (!panel.length) {
- panel.push("No content.");
- }
+ const body = renderContent(spec, content ?? {}, "response");
+ const panel = [ ...renderHeaders(spec, headers ?? {}), ...body.length ? body : [ "No content." ] ];
// A tab's title is one line.
const title = [ status, description?.replace(/\s+/g, " ").trim() ].filter(Boolean).join(": ");
@@ -239,6 +246,20 @@ function renderOperation(spec: OpenApiSpec, { method, path, pathItem, operation
return blocks;
}
+/** The table of a response's headers, each described by its example when it has no description. */
+function renderHeaders(spec: OpenApiSpec, headers: Record<string, Header | Reference>) {
+ const rows = Object.entries(headers).map(([ name, header ]) => {
+ const { description, required, schema, example } = resolve<Header>(spec, header);
+ const sample = example ?? schema?.example;
+ const text = description ?? (sample === undefined ? "" : `Example: ${code(String(sample))}`);
+ return [
+ nameCell(name, required),
+ detailsCell(typeMarkdown(spec, schema), describe({ description: text, schema }))
+ ];
+ });
+ return rows.length ? [ "**Response headers**", table([ "Name", "Description" ], rows) ] : [];
+}
+
/** Indents a block into the panel of a tab, which holds the lines indented by four spaces. */
function indent(block: string) {
return block.split("\n").map((line) => line ? ` ${line}` : line).join("\n");
diff --git a/apps/server/src/assets/help/help_content.json b/apps/server/src/assets/help/help_content.json
index e43cf733b8..d08d8f0711 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&nbsp;<a href=\"#root/_help_KSZ04uQ2D1St\">Note Types</a>&nbsp;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&nbsp;<a class=\"reference-link\" href=\"#root/_help_iPIMuisry3hd\">Text</a>&nbsp;notes, as well as integrated in various facets of the application such as the attribute editor in the&nbsp;<a class=\"reference-link\" href=\"#root/_help_AlJ73vBCjWDw\">Status bar</a>&nbsp;or the chat box in the&nbsp;<a class=\"reference-link\" href=\"#root/_help_GBBMSlVSOIGP\">AI</a>&nbsp;sidebar or notes.</p><p>For more information see&nbsp;<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&nbsp;<a class=\"reference-link\" href=\"#root/_help_grjYqerjn243\">Canvas</a>&nbsp;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&nbsp;<a class=\"reference-link\" href=\"#root/_help_81SGnPGMk7Xc\">Geo Map</a>&nbsp;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&nbsp;<a class=\"reference-link\" href=\"#root/_help_gBbsAeiuUxI5\">Mind Map</a>&nbsp;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&nbsp;<a class=\"reference-link\" href=\"#root/_help_xWbu3jpNWapp\">Calendar</a>&nbsp;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&nbsp;<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&nbsp;<a href=\"#root/_help_iPIMuisry3hd\">Text</a>&nbsp;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>&lt;kbd&gt;</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&nbsp;<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&nbsp;<span class=\"math-tex\">\\(62^{12}\\)</span>&nbsp;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&amp;size=12&amp;speed=1000&amp;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>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><span class=\"tn-icon bx bx-lock-alt\"></span> 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><span class=\"tn-icon bx bx-log-in\"></span> 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>Responds with 401 when the password is wrong or, with two-factor authentication enabled, the TOTP token is missing or wrong.</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</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><span class=\"tn-icon bx bx-note\"></span> 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>: <a href=\"#schema-Note\"><code>Note</code></a></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-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><a href=\"#schema-NoteType\"><code>NoteType</code></a> <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>&nbsp;</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>&nbsp;</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>&nbsp;</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>array of <a href=\"#schema-Attachment\"><code>Attachment</code></a></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>: <a href=\"#schema-Timestamps\"><code>Timestamps</code></a></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-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><a href=\"#schema-NoteType\"><code>NoteType</code></a> <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>: <a href=\"#schema-CreateNoteRequest\"><code>CreateNoteRequest</code></a></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-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><a href=\"#schema-NoteType\"><code>NoteType</code></a> <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><a href=\"#schema-Note\"><code>Note</code></a></td></tr><tr><td><code>branch</code></td><td><a href=\"#schema-Branch\"><code>Branch</code></a></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>: <a href=\"#schema-Note\"><code>Note</code></a></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-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><a href=\"#schema-NoteType\"><code>NoteType</code></a> <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>: <a href=\"#schema-Revision\"><code>Revision</code></a></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-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><a href=\"#schema-NoteType\"><code>NoteType</code></a> <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>: <a href=\"#schema-Attachment\"><code>Attachment</code></a></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-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><span class=\"tn-icon bx bx-sitemap\"></span> 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>array of <a href=\"#schema-Note\"><code>Note</code></a></td></tr><tr><td><code>branches</code></td><td>array of <a href=\"#schema-Branch\"><code>Branch</code></a></td></tr><tr><td><code>attributes</code></td><td>array of <a href=\"#schema-Attribute\"><code>Attribute</code></a></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>array of <a href=\"#schema-Note\"><code>Note</code></a></td></tr><tr><td><code>branches</code></td><td>array of <a href=\"#schema-Branch\"><code>Branch</code></a></td></tr><tr><td><code>attributes</code></td><td>array of <a href=\"#schema-Attribute\"><code>Attribute</code></a></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>: <a href=\"#schema-Branch\"><code>Branch</code></a></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-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>: <a href=\"#schema-Branch\"><code>Branch</code></a></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-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>: <a href=\"#schema-Branch\"><code>Branch</code></a></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-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><span class=\"tn-icon bx bx-purchase-tag\"></span> 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>: array of <a href=\"#schema-Attribute\"><code>Attribute</code></a></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>: array of <a href=\"#schema-Attribute\"><code>Attribute</code></a></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>: <a href=\"#schema-Attribute\"><code>Attribute</code></a></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-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>: <a href=\"#schema-Attribute\"><code>Attribute</code></a></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-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>: <a href=\"#schema-Attribute\"><code>Attribute</code></a></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-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><span class=\"tn-icon bx bx-paperclip\"></span> 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>: array of <a href=\"#schema-Attachment\"><code>Attachment</code></a></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>: <a href=\"#schema-Attachment\"><code>Attachment</code></a></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-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>: <a href=\"#schema-Attachment\"><code>Attachment</code></a></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-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>: <a href=\"#schema-Attachment\"><code>Attachment</code></a></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-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>: <a href=\"#schema-Attachment\"><code>Attachment</code></a></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-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>: <a href=\"#schema-Note\"><code>Note</code></a></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-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><a href=\"#schema-NoteType\"><code>NoteType</code></a> <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: 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</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><span class=\"tn-icon bx bx-history\"></span> 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>: array of <a href=\"#schema-Revision\"><code>Revision</code></a></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>: <a href=\"#schema-Revision\"><code>Revision</code></a></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-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><a href=\"#schema-NoteType\"><code>NoteType</code></a> <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>: <a href=\"#schema-Note\"><code>Note</code></a></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-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><a href=\"#schema-NoteType\"><code>NoteType</code></a> <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>: array of <a href=\"#schema-Note\"><code>Note</code></a></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><span class=\"tn-icon bx bx-search\"></span> 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>: array of <a href=\"#schema-SearchResult\"><code>SearchResult</code></a></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>: array of <a href=\"#schema-SearchResult\"><code>SearchResult</code></a></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>: array of <a href=\"#schema-SearchResult\"><code>SearchResult</code></a></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>: <a href=\"#schema-Attribute\"><code>Attribute</code></a></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-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>: array of <a href=\"#schema-Note\"><code>Note</code></a></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><span class=\"tn-icon bx bx-transfer\"></span> 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><a href=\"#schema-Note\"><code>Note</code></a></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><span class=\"tn-icon bx bx-sync\"></span> 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>array of <a href=\"#schema-EntityChange\"><code>EntityChange</code></a></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>array of <a href=\"#schema-EntityChange\"><code>EntityChange</code></a></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><span class=\"tn-icon bx bx-code-alt\"></span> 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>: array of <a href=\"#schema-ScriptBundle\"><code>ScriptBundle</code></a></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>: array of <a href=\"#schema-ScriptBundle\"><code>ScriptBundle</code></a></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>: <a href=\"#schema-ScriptBundle\"><code>ScriptBundle</code></a></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-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>: array of <a href=\"#schema-ScriptBundle\"><code>ScriptBundle</code></a></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><span class=\"tn-icon bx bx-cog\"></span> 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>: <a href=\"#schema-AppInfo\"><code>AppInfo</code></a></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-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><span class=\"tn-icon bx bx-data\"></span> 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>Only files inside the anonymized database directory can be downloaded; any other path is refused with 403.</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 not allowed</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><span class=\"tn-icon bx bx-bot\"></span> 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>: array of <a href=\"#schema-ChatSession\"><code>ChatSession</code></a></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>: <a href=\"#schema-ChatSession\"><code>ChatSession</code></a></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-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>: <a href=\"#schema-ChatSession\"><code>ChatSession</code></a></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-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>: <a href=\"#schema-ChatSession\"><code>ChatSession</code></a></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-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><span class=\"tn-icon bx bx-shield-quarter\"></span> 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>Returns <code>null</code> when no 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: TOTP secret</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>Returns an empty array if no recovery codes are set, otherwise an object listing each code's status.</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: Recovery code 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>: array of <a href=\"#schema-EtapiToken\"><code>EtapiToken</code></a></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>: <a href=\"#schema-EtapiToken\"><code>EtapiToken</code></a></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-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>: <a href=\"#schema-EtapiToken\"><code>EtapiToken</code></a></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-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><span class=\"tn-icon bx bx-star\"></span> 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>: <a href=\"#schema-Note\"><code>Note</code></a></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-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><a href=\"#schema-NoteType\"><code>NoteType</code></a> <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>: <a href=\"#schema-Note\"><code>Note</code></a></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-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><a href=\"#schema-NoteType\"><code>NoteType</code></a> <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>: <a href=\"#schema-Note\"><code>Note</code></a></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-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><a href=\"#schema-NoteType\"><code>NoteType</code></a> <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>: <a href=\"#schema-Note\"><code>Note</code></a></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-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><a href=\"#schema-NoteType\"><code>NoteType</code></a> <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>: <a href=\"#schema-Note\"><code>Note</code></a></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-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><a href=\"#schema-NoteType\"><code>NoteType</code></a> <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>: <a href=\"#schema-Note\"><code>Note</code></a></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-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><a href=\"#schema-NoteType\"><code>NoteType</code></a> <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>: <a href=\"#schema-Note\"><code>Note</code></a></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-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><a href=\"#schema-NoteType\"><code>NoteType</code></a> <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>: <a href=\"#schema-Note\"><code>Note</code></a></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-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><a href=\"#schema-NoteType\"><code>NoteType</code></a> <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>: array of <a href=\"#schema-Note\"><code>Note</code></a></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>: <a href=\"#schema-Note\"><code>Note</code></a></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-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><a href=\"#schema-NoteType\"><code>NoteType</code></a> <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>: <a href=\"#schema-Note\"><code>Note</code></a></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-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><a href=\"#schema-NoteType\"><code>NoteType</code></a> <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>: <a href=\"#schema-Note\"><code>Note</code></a></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-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><a href=\"#schema-NoteType\"><code>NoteType</code></a> <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>: <a href=\"#schema-Note\"><code>Note</code></a></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-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><a href=\"#schema-NoteType\"><code>NoteType</code></a> <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>: <a href=\"#schema-Note\"><code>Note</code></a></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-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><a href=\"#schema-NoteType\"><code>NoteType</code></a> <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><span class=\"tn-icon bx bx-map-alt\"></span> 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><span class=\"tn-icon bx bx-globe\"></span> 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>: <a href=\"#schema-Note\"><code>Note</code></a></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-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><a href=\"#schema-NoteType\"><code>NoteType</code></a> <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>: <a href=\"#schema-Note\"><code>Note</code></a></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-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><a href=\"#schema-NoteType\"><code>NoteType</code></a> <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>: <a href=\"#schema-Note\"><code>Note</code></a></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-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><a href=\"#schema-NoteType\"><code>NoteType</code></a> <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>: <a href=\"#schema-Note\"><code>Note</code></a></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-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><a href=\"#schema-NoteType\"><code>NoteType</code></a> <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><span class=\"tn-icon bx bx-wrench\"></span> 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>&nbsp;</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: Rendered Markdown</p><div class=\"trilium-tab-panel\"><ul><li><code>text/plain</code>: <code>string</code></li></ul></div></section></div><h2><span class=\"tn-icon bx bx-cube\"></span> Schemas</h2><h3><a id=\"schema-Note\"></a><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><a href=\"#schema-NoteType\"><code>NoteType</code></a> <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><a id=\"schema-NoteType\"></a><code>NoteType</code></h3><p>Type: <code>string</code></p><h3><a id=\"schema-Branch\"></a><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><a id=\"schema-Attribute\"></a><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><a id=\"schema-Attachment\"></a><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><a id=\"schema-Revision\"></a><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><a href=\"#schema-NoteType\"><code>NoteType</code></a> <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><a id=\"schema-SearchResult\"></a><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><a id=\"schema-EntityChange\"></a><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><a id=\"schema-Timestamps\"></a><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><a id=\"schema-CreateNoteRequest\"></a><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><a href=\"#schema-NoteType\"><code>NoteType</code></a> <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><a id=\"schema-ScriptBundle\"></a><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><a id=\"schema-AppInfo\"></a><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><a id=\"schema-ChatSession\"></a><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><a id=\"schema-EtapiToken\"></a><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><span class=\"tn-icon bx bx-lock-alt\"></span> 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><span class=\"tn-icon bx bx-log-in\"></span> 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>Responds with 401 when the password is wrong or, with two-factor authentication enabled, the TOTP token is missing or wrong.</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><strong>Response headers</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>Set-Cookie</code></td><td><code>string</code> <br>Example: <code>trilium.sid=s%3A...</code></td></tr></tbody></table></figure><p>No content.</p></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">401: Invalid credentials</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><span class=\"tn-icon bx bx-note\"></span> 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>: <a href=\"#schema-Note\"><code>Note</code></a></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-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><a href=\"#schema-NoteType\"><code>NoteType</code></a> <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>&nbsp;</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>&nbsp;</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>&nbsp;</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>array of <a href=\"#schema-Attachment\"><code>Attachment</code></a></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>: <a href=\"#schema-Timestamps\"><code>Timestamps</code></a></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-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><a href=\"#schema-NoteType\"><code>NoteType</code></a> <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>: <a href=\"#schema-CreateNoteRequest\"><code>CreateNoteRequest</code></a></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-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><a href=\"#schema-NoteType\"><code>NoteType</code></a> <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><a href=\"#schema-Note\"><code>Note</code></a></td></tr><tr><td><code>branch</code></td><td><a href=\"#schema-Branch\"><code>Branch</code></a></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>: <a href=\"#schema-Note\"><code>Note</code></a></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-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><a href=\"#schema-NoteType\"><code>NoteType</code></a> <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>: <a href=\"#schema-Revision\"><code>Revision</code></a></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-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><a href=\"#schema-NoteType\"><code>NoteType</code></a> <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>: <a href=\"#schema-Attachment\"><code>Attachment</code></a></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-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\"><p><strong>Response headers</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>Content-Disposition</code></td><td><code>string</code> <br>Example: <code>attachment; filename=\"document.pdf\"</code></td></tr></tbody></table></figure><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\"><p><strong>Response headers</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>Content-Disposition</code></td><td><code>string</code> <br>Example: <code>attachment; filename=\"document.pdf\"</code></td></tr></tbody></table></figure><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><span class=\"tn-icon bx bx-sitemap\"></span> 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>array of <a href=\"#schema-Note\"><code>Note</code></a></td></tr><tr><td><code>branches</code></td><td>array of <a href=\"#schema-Branch\"><code>Branch</code></a></td></tr><tr><td><code>attributes</code></td><td>array of <a href=\"#schema-Attribute\"><code>Attribute</code></a></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>array of <a href=\"#schema-Note\"><code>Note</code></a></td></tr><tr><td><code>branches</code></td><td>array of <a href=\"#schema-Branch\"><code>Branch</code></a></td></tr><tr><td><code>attributes</code></td><td>array of <a href=\"#schema-Attribute\"><code>Attribute</code></a></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>: <a href=\"#schema-Branch\"><code>Branch</code></a></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-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>: <a href=\"#schema-Branch\"><code>Branch</code></a></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-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>: <a href=\"#schema-Branch\"><code>Branch</code></a></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-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><span class=\"tn-icon bx bx-purchase-tag\"></span> 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>: array of <a href=\"#schema-Attribute\"><code>Attribute</code></a></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>: array of <a href=\"#schema-Attribute\"><code>Attribute</code></a></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>: <a href=\"#schema-Attribute\"><code>Attribute</code></a></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-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>: <a href=\"#schema-Attribute\"><code>Attribute</code></a></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-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>: <a href=\"#schema-Attribute\"><code>Attribute</code></a></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-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><span class=\"tn-icon bx bx-paperclip\"></span> 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\"><p><strong>Response headers</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>Content-Range</code></td><td><code>string</code> <br>Example: <code>bytes 0-1023/146515</code></td></tr></tbody></table></figure><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>: array of <a href=\"#schema-Attachment\"><code>Attachment</code></a></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>: <a href=\"#schema-Attachment\"><code>Attachment</code></a></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-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>: <a href=\"#schema-Attachment\"><code>Attachment</code></a></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-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>: <a href=\"#schema-Attachment\"><code>Attachment</code></a></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-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>: <a href=\"#schema-Attachment\"><code>Attachment</code></a></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-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>: <a href=\"#schema-Note\"><code>Note</code></a></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-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><a href=\"#schema-NoteType\"><code>NoteType</code></a> <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\"><p><strong>Response headers</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>Content-Disposition</code></td><td><code>string</code> <br>Example: <code>attachment; filename=\"document.pdf\"</code></td></tr></tbody></table></figure><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\"><p><strong>Response headers</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>Content-Disposition</code></td><td><code>string</code> <br>Example: <code>attachment; filename=\"document.pdf\"</code></td></tr></tbody></table></figure><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: 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</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><span class=\"tn-icon bx bx-history\"></span> 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>: array of <a href=\"#schema-Revision\"><code>Revision</code></a></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>: <a href=\"#schema-Revision\"><code>Revision</code></a></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-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><a href=\"#schema-NoteType\"><code>NoteType</code></a> <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>: <a href=\"#schema-Note\"><code>Note</code></a></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-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><a href=\"#schema-NoteType\"><code>NoteType</code></a> <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\"><p><strong>Response headers</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>Content-Disposition</code></td><td><code>string</code></td></tr></tbody></table></figure><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>: array of <a href=\"#schema-Note\"><code>Note</code></a></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><span class=\"tn-icon bx bx-search\"></span> 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>: array of <a href=\"#schema-SearchResult\"><code>SearchResult</code></a></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>: array of <a href=\"#schema-SearchResult\"><code>SearchResult</code></a></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>: array of <a href=\"#schema-SearchResult\"><code>SearchResult</code></a></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>: <a href=\"#schema-Attribute\"><code>Attribute</code></a></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-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>: array of <a href=\"#schema-Note\"><code>Note</code></a></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><span class=\"tn-icon bx bx-transfer\"></span> 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><a href=\"#schema-Note\"><code>Note</code></a></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><span class=\"tn-icon bx bx-sync\"></span> 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>array of <a href=\"#schema-EntityChange\"><code>EntityChange</code></a></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>array of <a href=\"#schema-EntityChange\"><code>EntityChange</code></a></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><span class=\"tn-icon bx bx-code-alt\"></span> 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>: array of <a href=\"#schema-ScriptBundle\"><code>ScriptBundle</code></a></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>: array of <a href=\"#schema-ScriptBundle\"><code>ScriptBundle</code></a></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>: <a href=\"#schema-ScriptBundle\"><code>ScriptBundle</code></a></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-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>: array of <a href=\"#schema-ScriptBundle\"><code>ScriptBundle</code></a></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><span class=\"tn-icon bx bx-cog\"></span> 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>: <a href=\"#schema-AppInfo\"><code>AppInfo</code></a></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-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><span class=\"tn-icon bx bx-data\"></span> 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>Only files inside the anonymized database directory can be downloaded; any other path is refused with 403.</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 not allowed</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><span class=\"tn-icon bx bx-bot\"></span> 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>: array of <a href=\"#schema-ChatSession\"><code>ChatSession</code></a></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>: <a href=\"#schema-ChatSession\"><code>ChatSession</code></a></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-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>: <a href=\"#schema-ChatSession\"><code>ChatSession</code></a></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-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>: <a href=\"#schema-ChatSession\"><code>ChatSession</code></a></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-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><span class=\"tn-icon bx bx-shield-quarter\"></span> 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>Returns <code>null</code> when no 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: TOTP secret</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>Returns an empty array if no recovery codes are set, otherwise an object listing each code's status.</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: Recovery code 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>: array of <a href=\"#schema-EtapiToken\"><code>EtapiToken</code></a></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>: <a href=\"#schema-EtapiToken\"><code>EtapiToken</code></a></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-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>: <a href=\"#schema-EtapiToken\"><code>EtapiToken</code></a></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-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><span class=\"tn-icon bx bx-star\"></span> 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>: <a href=\"#schema-Note\"><code>Note</code></a></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-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><a href=\"#schema-NoteType\"><code>NoteType</code></a> <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>: <a href=\"#schema-Note\"><code>Note</code></a></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-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><a href=\"#schema-NoteType\"><code>NoteType</code></a> <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>: <a href=\"#schema-Note\"><code>Note</code></a></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-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><a href=\"#schema-NoteType\"><code>NoteType</code></a> <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>: <a href=\"#schema-Note\"><code>Note</code></a></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-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><a href=\"#schema-NoteType\"><code>NoteType</code></a> <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>: <a href=\"#schema-Note\"><code>Note</code></a></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-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><a href=\"#schema-NoteType\"><code>NoteType</code></a> <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>: <a href=\"#schema-Note\"><code>Note</code></a></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-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><a href=\"#schema-NoteType\"><code>NoteType</code></a> <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>: <a href=\"#schema-Note\"><code>Note</code></a></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-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><a href=\"#schema-NoteType\"><code>NoteType</code></a> <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>: <a href=\"#schema-Note\"><code>Note</code></a></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-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><a href=\"#schema-NoteType\"><code>NoteType</code></a> <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>: array of <a href=\"#schema-Note\"><code>Note</code></a></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>: <a href=\"#schema-Note\"><code>Note</code></a></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-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><a href=\"#schema-NoteType\"><code>NoteType</code></a> <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>: <a href=\"#schema-Note\"><code>Note</code></a></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-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><a href=\"#schema-NoteType\"><code>NoteType</code></a> <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>: <a href=\"#schema-Note\"><code>Note</code></a></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-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><a href=\"#schema-NoteType\"><code>NoteType</code></a> <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>: <a href=\"#schema-Note\"><code>Note</code></a></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-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><a href=\"#schema-NoteType\"><code>NoteType</code></a> <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>: <a href=\"#schema-Note\"><code>Note</code></a></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-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><a href=\"#schema-NoteType\"><code>NoteType</code></a> <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><span class=\"tn-icon bx bx-map-alt\"></span> 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><span class=\"tn-icon bx bx-globe\"></span> 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>: <a href=\"#schema-Note\"><code>Note</code></a></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-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><a href=\"#schema-NoteType\"><code>NoteType</code></a> <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>: <a href=\"#schema-Note\"><code>Note</code></a></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-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><a href=\"#schema-NoteType\"><code>NoteType</code></a> <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>: <a href=\"#schema-Note\"><code>Note</code></a></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-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><a href=\"#schema-NoteType\"><code>NoteType</code></a> <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>: <a href=\"#schema-Note\"><code>Note</code></a></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-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><a href=\"#schema-NoteType\"><code>NoteType</code></a> <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><span class=\"tn-icon bx bx-wrench\"></span> 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>&nbsp;</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: Rendered Markdown</p><div class=\"trilium-tab-panel\"><ul><li><code>text/plain</code>: <code>string</code></li></ul></div></section></div><h2><span class=\"tn-icon bx bx-cube\"></span> Schemas</h2><h3><a id=\"schema-Note\"></a><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><a href=\"#schema-NoteType\"><code>NoteType</code></a> <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><a id=\"schema-NoteType\"></a><code>NoteType</code></h3><p>Type: <code>string</code></p><h3><a id=\"schema-Branch\"></a><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><a id=\"schema-Attribute\"></a><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><a id=\"schema-Attachment\"></a><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><a id=\"schema-Revision\"></a><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><a href=\"#schema-NoteType\"><code>NoteType</code></a> <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><a id=\"schema-SearchResult\"></a><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><a id=\"schema-EntityChange\"></a><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><a id=\"schema-Timestamps\"></a><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><a id=\"schema-CreateNoteRequest\"></a><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><a href=\"#schema-NoteType\"><code>NoteType</code></a> <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><a id=\"schema-ScriptBundle\"></a><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><a id=\"schema-AppInfo\"></a><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><a id=\"schema-ChatSession\"></a><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><a id=\"schema-EtapiToken\"></a><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&nbsp;<a class=\"reference-link\" href=\"#root/_help_zEY4DaJG4YT5\">Attributes</a>,&nbsp;<a class=\"reference-link\" href=\"#root/_help_Cq5X6iKQop6R\">Relations</a>&nbsp;or even&nbsp;<a class=\"reference-link\" href=\"#root/_help_eIg8jdvaoNNd\">Search</a>&nbsp;and&nbsp;<a class=\"reference-link\" href=\"#root/_help_QEAPj01N5f7w\">Links</a>&nbsp;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&nbsp;<a class=\"reference-link\" href=\"#root/_help_wX4HbRucYSDD\">Database</a>&nbsp;just like normal notes, but they have a unique&nbsp;<a class=\"reference-link\" href=\"#root/_help_m1lbrzyKDaRB\">Note ID</a>&nbsp;which allows them to be distinguished from the normal ones.</p><h2>Accessing the hidden note tree</h2><p>From the&nbsp;<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&nbsp;<a class=\"reference-link\" href=\"#root/_help_bdUJEHsAPYQR\">Note Map</a>&nbsp;feature that is accessed from the&nbsp;<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&nbsp;<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&nbsp;<a class=\"reference-link\" href=\"#root/_help_x3i7MxGccDuM\">Global menu</a>&nbsp;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&nbsp;<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&nbsp;<a class=\"reference-link\" href=\"#root/_help_x3i7MxGccDuM\">Global menu</a>&nbsp;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&nbsp;<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&nbsp;<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&nbsp;<a class=\"reference-link\" href=\"#root/_help_x3i7MxGccDuM\">Global menu</a>&nbsp;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&nbsp;<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&nbsp;<a class=\"reference-link\" href=\"#root/_help_x3i7MxGccDuM\">Global menu</a>&nbsp;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&nbsp;<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&nbsp;<a class=\"reference-link\" href=\"#root/_help_x3i7MxGccDuM\">Global menu</a>&nbsp;and selecting <em>Configure launch bar…</em>.</li><li>Right-clicking an empty space on the&nbsp;<a class=\"reference-link\" href=\"#root/_help_xYmIYSP6wE3F\">Launch Bar</a>&nbsp;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&nbsp;<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&nbsp;<a class=\"reference-link\" href=\"#root/_help_x3i7MxGccDuM\">Global menu</a>&nbsp;and selecting <em>Options</em>.</li><li>Pressing the dedicated Options icon in the&nbsp;<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&nbsp;<a class=\"reference-link\" href=\"#root/_help_bOP3TB56fL1V\">grafana-dashboard.json</a>&nbsp;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/docs/User Guide/User Guide/Advanced Usage/Internal API/API Reference.md b/docs/User Guide/User Guide/Advanced Usage/Internal API/API Reference.md
index bb6a6bd7a7..e97ac626ba 100644
--- 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.md
@@ -58,6 +58,12 @@ Responds with 401 when the password is wrong or, with two-factor authentication
=== "200: Login successful"
+ **Response headers**
+
+ | Name | Description |
+ | --- | --- |
+ | `Set-Cookie` | `string` <br>Example: `trilium.sid=s%3A...` |
+
No content.
=== "401: Invalid credentials"
@@ -1058,6 +1064,12 @@ Core note operations
=== "200: File content"
+ **Response headers**
+
+ | Name | Description |
+ | --- | --- |
+ | `Content-Disposition` | `string` <br>Example: `attachment; filename="document.pdf"` |
+
* `application/octet-stream`: `string (binary)`
### Download file note (alternative path)
@@ -1076,6 +1088,12 @@ Core note operations
=== "200: File content"
+ **Response headers**
+
+ | Name | Description |
+ | --- | --- |
+ | `Content-Disposition` | `string` <br>Example: `attachment; filename="document.pdf"` |
+
* `application/octet-stream`: `string (binary)`
### Save note to temp directory
@@ -2272,6 +2290,12 @@ File attachments
=== "206: Partial content"
+ **Response headers**
+
+ | Name | Description |
+ | --- | --- |
+ | `Content-Range` | `string` <br>Example: `bytes 0-1023/146515` |
+
* `application/octet-stream`: `string (binary)`
### Get note attachments
@@ -2715,6 +2739,12 @@ File attachments
=== "200: Attachment content"
+ **Response headers**
+
+ | Name | Description |
+ | --- | --- |
+ | `Content-Disposition` | `string` <br>Example: `attachment; filename="document.pdf"` |
+
* `application/octet-stream`: `string (binary)`
### Download attachment (alternative path)
@@ -2733,6 +2763,12 @@ File attachments
=== "200: Attachment content"
+ **Response headers**
+
+ | Name | Description |
+ | --- | --- |
+ | `Content-Disposition` | `string` <br>Example: `attachment; filename="document.pdf"` |
+
* `application/octet-stream`: `string (binary)`
### Get all attachment information
@@ -3121,6 +3157,12 @@ Note revision history
=== "200: Revision content"
+ **Response headers**
+
+ | Name | Description |
+ | --- | --- |
+ | `Content-Disposition` | `string` |
+
* `application/octet-stream`: `string (binary)`
### Cleanup old revisions