Skip to content

Build your personal knowledge base with Trilium Notes

feat(docs): show API samples beside their property tables

Elian Doran50bf28ee666d
diff --git a/apps/edit-docs/src/openapi_markdown.spec.ts b/apps/edit-docs/src/openapi_markdown.spec.ts
index c7e923aa17..300a2dad1b 100644
--- a/apps/edit-docs/src/openapi_markdown.spec.ts
+++ b/apps/edit-docs/src/openapi_markdown.spec.ts
@@ -81,22 +81,35 @@ describe("openApiToMarkdown", () => {
"| `noteId`<br>*required* | path | `EntityId` | |",
"| `force` | query | `boolean` | skip checks |"
].join("\n"));
- // The body's properties are listed in place, even when its schema is a reference.
- expect(markdown).toContain([
- "**Request body** (required)",
- "",
- "* `application/json`: `Note`",
+ // The body's properties are listed in place, even when its schema is a reference, in a
+ // column beside its sample, written as the Markdown export writes a multicolumn layout.
+ const columns = [
+ "<div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\">",
+ "<div class=\"trilium-multicolumn-column\">",
"",
"| Property | Type | Description |",
"| --- | --- | --- |",
"| `title`<br>*required* | `string` | |",
"",
+ "</div>",
+ "<div class=\"trilium-multicolumn-column\">",
+ "",
"```json",
"{",
" \"title\": \"string\"",
"}",
"```",
"",
+ "</div>",
+ "</div>"
+ ];
+ expect(markdown).toContain([
+ "**Request body** (required)",
+ "",
+ "* `application/json`: `Note`",
+ "",
+ ...columns,
+ "",
"**Responses**"
].join("\n"));
// A response with a body is followed by the properties of its schema, like the request body.
@@ -107,15 +120,7 @@ describe("openApiToMarkdown", () => {
"",
" * `application/json`: `Note`",
"",
- " | Property | Type | Description |",
- " | --- | --- | --- |",
- " | `title`<br>*required* | `string` | |",
- "",
- " ```json",
- " {",
- " \"title\": \"string\"",
- " }",
- " ```",
+ ...columns.map((line) => line && ` ${line}`),
"",
"=== \"default: unexpected error\"",
"",
diff --git a/apps/edit-docs/src/openapi_markdown.ts b/apps/edit-docs/src/openapi_markdown.ts
index 5b075df148..135c7aa70f 100644
--- a/apps/edit-docs/src/openapi_markdown.ts
+++ b/apps/edit-docs/src/openapi_markdown.ts
@@ -2,6 +2,7 @@
* Renders an OpenAPI 3.x document as the Markdown body of a User Guide page. The page's title
* comes from its note, so the output starts with the API's description rather than an H1.
*/
+import { MULTICOLUMN_COLUMN_CLASS, MULTICOLUMN_LAYOUT_CLASS } from "../../../packages/commons/src/index.js";
export interface OpenApiSpec {
info: { title: string; description?: string };
@@ -242,7 +243,7 @@ function mediaLine(mime: string, { schema }: MediaType) {
type Direction = "request" | "response";
-/** The property table of a body's schema, then a JSON sample of the body. */
+/** The property table of a body's schema and a JSON sample of the body, side by side when both exist. */
function renderBody(spec: OpenApiSpec, mime: string, { schema, example, examples }: MediaType, direction: Direction) {
const blocks: string[] = [];
const resolved = schema && resolve(spec, schema);
@@ -257,7 +258,14 @@ function renderBody(spec: OpenApiSpec, mime: string, { schema, example, examples
}
}
- return blocks;
+ return blocks.length > 1 ? [ columns(blocks) ] : blocks;
+}
+
+/** A multicolumn layout of equal columns, in the shape the Markdown export writes it. */
+function columns(blocks: string[]) {
+ const layout = `<div class="${MULTICOLUMN_LAYOUT_CLASS}" data-trilium-column-ratios="${blocks.map(() => 1).join("-")}">`;
+ const content = blocks.map((block) => `<div class="${MULTICOLUMN_COLUMN_CLASS}">\n\n${block}\n\n</div>`);
+ return [ layout, ...content, "</div>" ].join("\n");
}
/**
diff --git a/apps/server/src/assets/help/help_content.json b/apps/server/src/assets/help/help_content.json
index 4e27d64897..3416802619 100644
--- a/apps/server/src/assets/help/help_content.json
+++ b/apps/server/src/assets/help/help_content.json
@@ -220,7 +220,7 @@
"_help_J5Ex1ZrMbyJ6": "<p>Trilium provides a mechanism for <a href=\"#root/_help_CdNpE2pqjmI6\">scripts</a> to open a public REST endpoint. This opens a way for various integrations with other services - a simple example would be creating new note from Slack by issuing a slash command (e.g. <code>/trilium buy milk</code>).</p><h2>Create note from outside Trilium</h2><p>Let's take a look at an example. The goal is to provide a REST endpoint to which we can send title and content and Trilium will create a note.</p><p>We'll start with creating a JavaScript backend <a href=\"#root/_help_6f9hih2hXXZk\">code note</a> containing:</p><pre><code class=\"language-text-x-trilium-auto\">const {req, res} = api;\nconst {secret, title, content} = req.body;\n\nif (req.method == 'POST' &amp;&amp; secret === 'secret-password') {\n // notes must be saved somewhere in the tree hierarchy specified by a parent note. \n // This is defined by a relation from this code note to the \"target\" parent note\n // alternatively you can just use constant noteId for simplicity (get that from \"Note info\" dialog of the desired parent note)\n const targetParentNoteId = api.currentNote.getRelationValue('targetNote');\n \n const {note} = api.createTextNote(targetParentNoteId, title, content);\n const notePojo = note.getPojo();\n\n res.status(201).json(notePojo);\n}\nelse {\n res.send(400);\n}</code></pre><p>This script note has also following two attributes:</p><ul><li>label <code>#customRequestHandler</code> with value <code>create-note</code></li><li>relation <code>~targetNote</code> pointing to a note where new notes should be saved</li></ul><h3>Explanation</h3><p>Let's test this by using an HTTP client to send a request:</p><pre><code class=\"language-text-x-trilium-auto\">POST http://your-trilium-server/custom/create-note\nContent-Type: application/json\n\n{\n \"secret\": \"secret-password\",\n \"title\": \"hello\",\n \"content\": \"world\"\n}+++++++++++++++++++++++++++++++++++++++++++++++</code></pre><p>Notice the <code>/custom</code> part in the request path - Trilium considers any request with this prefix as \"custom\" and tries to find a matching handler by looking at all notes which have <code>customRequestHandler</code> <a href=\"#root/_help_zEY4DaJG4YT5\">label</a>. Value of this label then contains a regular expression which will match the request path (in our case trivial regex \"create-note\").</p><p>Trilium will then find our code note created above and execute it. <code>api.req</code>, <code>api.res</code> are set to <a href=\"https://expressjs.com/en/api.html#req\">request</a> and <a href=\"https://expressjs.com/en/api.html#res\">response</a>objects from which we can get details of the request and also respond.</p><p>In the code note we check the request method and then use trivial authentication - keep in mind that these endpoints are by default totally unauthenticated, and you need to take care of this yourself.</p><p>Once we pass these checks we will just create the desired note using <a href=\"#root/_help_GLks18SNjxmC\">Script API</a>.</p><h2>Custom resource provider</h2><p>Another common use case is that you want to just expose a file note - in such case you create label <code>customResourceProvider</code> (value is again path regex).</p><p>For more information, see&nbsp;<a href=\"#root/_help_d3fAXQ2diepH\">Custom Resource Providers</a>.</p><h2>Advanced concepts</h2><p><code>api.req</code> and <code>api.res</code> are Express.js objects - you can always look into its <a href=\"https://expressjs.com/en/api.html\">documentation</a> for details.</p><h3>Parameters</h3><p>REST request paths often contain parameters in the URL, e.g.:</p><pre><code class=\"language-text-x-trilium-auto\">http://your-trilium-server/custom/notes/123</code></pre><p>The last part is dynamic so the matching of the URL must also be dynamic - for this reason the matching is done with regular expressions. Following <code>customRequestHandler</code> value would match it:</p><pre><code class=\"language-text-x-trilium-auto\">notes/([0-9]+)</code></pre><p>Additionally, this also defines a matching group with the use of parenthesis which then makes it easier to extract the value. The matched groups are available in <code>api.pathParams</code>:</p><pre><code class=\"language-text-x-trilium-auto\">const noteId = api.pathParams[0];</code></pre><p>Often you also need query params (as in e.g. <code>http://your-trilium-server/custom/notes?noteId=123</code>), you can get those with standard express <code>req.query.noteId</code>.</p>",
"_help_d3fAXQ2diepH": "<p>A custom resource provider allows any file imported into Trilium (images, fonts, stylesheets) to be publicly accessible via a URL.</p><p>A potential use case for this is to add embed a custom font alongside a theme.</p><h2>Steps for creating a custom resource provider</h2><ol><li>Import a file such as an image or a font into Trilium by drag &amp; drop.</li><li>Set the <a href=\"#root/_help_HI6GBBIduIgv\">label</a> <code>#customResourceProvider</code> to <code>hello</code>.</li><li>To test if it is working, use a browser to navigate to <code>&lt;protocol&gt;://&lt;host&gt;/custom/hello</code> (where <code>&lt;protocol&gt;</code> is either <code>http</code> or <code>https</code> based on your setup, and <code>&lt;host&gt;</code> is the host or IP to your Trilium server instance). If you are running the TriliumNext application without a server, use <code>http://localhost:37840</code> as the base URL.</li><li>If everything went well, at the previous step the browser should have downloaded the file uploaded in the first step.</li></ol><p>Instead of <code>hello</code>, the name can be:</p><ul><li>A path, such as <code>fonts/Roboto.ttf</code>, which would be accessible via <code>&lt;host&gt;/custom/fonts/Roboto.ttf</code>.</li><li>As a more advanced use case, a regular expression to match multiple routes, such as <code>hello/.*</code> which will be accessible via <code>/custom/hello/1</code>, <code>/custom/hello/2</code>, <code>/custom/hello/world</code>, etc.</li></ul><h2>Using it in a theme</h2><p>For example, if you have a custom font to be imported by the theme, first upload a font file into Trilium and assign it the <code>#customResourceProvider=fonts/myfont.ttf</code> attribute.</p><p>Then modify the theme CSS to point to:</p><pre><code class=\"language-text-css\">@font-face {\n\tfont-family: customFont;\n\tsrc: url(\"/custom/fonts/myfont.ttf\");\n}\n\ndiv {\n\tfont-family: customFont;\n}</code></pre>",
"_help_pgxEVkzLl1OP": "<aside class=\"admonition tip\"><p>For a quick start, consult the&nbsp;<a class=\"reference-link\" href=\"#root/_help_9qPsTWBorUhQ\">API Reference</a>.</p></aside><p>ETAPI is Trilium's public/external REST API. It is available since Trilium v0.50.</p><h2>API clients</h2><p>As an alternative to calling the API directly, there are client libraries to simplify this</p><ul><li><a href=\"https://github.com/Nriver/trilium-py\">trilium-py</a>, you can use Python to communicate with Trilium.</li></ul><h2>Obtaining a token</h2><p>All operations with the REST API have to be authenticated using a token. You can get this token either from Options -&gt; ETAPI or programmatically using the <code>/auth/login</code> REST call (see the <a href=\"https://github.com/TriliumNext/Trilium/blob/master/src/etapi/etapi.openapi.yaml\">spec</a>).</p><h2>Authentication</h2><h3>Via the <code>Authorization</code> header</h3><pre><code class=\"language-text-x-trilium-auto\">GET https://myserver.com/etapi/app-info\nAuthorization: ETAPITOKEN</code></pre><p>where <code>ETAPITOKEN</code> is the token obtained in the previous step.</p><p>For compatibility with various tools, it's also possible to specify the value of the <code>Authorization</code> header in the format <code>Bearer ETAPITOKEN</code> (since 0.93.0).</p><h3>Basic authentication</h3><p>Since v0.56 you can also use basic auth format:</p><pre><code class=\"language-text-x-trilium-auto\">GET https://myserver.com/etapi/app-info\nAuthorization: Basic BATOKEN</code></pre><ul><li>Where <code>BATOKEN = BASE64(username + ':' + password)</code> - this is a standard Basic Auth serialization</li><li>Where <code>username</code> is \"etapi\"</li><li>And <code>password</code> is the generated ETAPI token described above.</li></ul><p>Basic Auth is meant to be used with tools which support only basic auth.</p><h2>Interaction using Bash scripts</h2><p>It is possible to write simple Bash scripts to interact with Trilium. As an example, here's how to obtain the HTML content of a note:</p><pre><code class=\"language-text-x-trilium-auto\">#!/usr/bin/env bash\n\n# Configuration\nTOKEN=z1vA4fkGxjOR_ZXLrZeqHEFOv65yV3882iFCRtNIK9k9iWrHliITNSLQ=\nSERVER=http://localhost:8080\n\n# Download a note by ID\nNOTE_ID=\"i6ra4ZshJhgN\"\ncurl \"$SERVER/etapi/notes/$NOTE_ID/content\" -H \"Authorization: $TOKEN\" </code></pre><p>Make sure to replace the values of:</p><ul><li><code>TOKEN</code> with your ETAPI token.</li><li><code>SERVER</code> with the correct protocol, host name and port to your Trilium instance.</li><li><code>NOTE_ID</code> with an existing note ID to download.</li></ul><p>As another example, to obtain a .zip export of a note and place it in a directory called <code>out</code>, simply replace the last statement in the script with:</p><pre><code class=\"language-text-x-trilium-auto\">curl -H \"Authorization: $TOKEN\" \\\n\t-X GET \"$SERVER/etapi/notes/$NOTE_ID/export\" \\\n --output \"out/$NOTE_ID.zip\"</code></pre><h2>Uploading binary content</h2><p>A JSON request body can only carry text, so the <code>content</code> field of <code>POST /etapi/attachments</code> stores exactly the string it receives. To upload an image, a PDF or any other binary file, send the raw bytes to the content endpoint with the <code>application/octet-stream</code> content type. The same applies to the content of a note (<code>PUT /etapi/notes/{noteId}/content</code>).</p><p>To attach a file to a note, create the attachment without content, then upload the file to it:</p><pre><code class=\"language-text-x-trilium-auto\">ATTACHMENT_ID=$(curl -s -X POST \"$SERVER/etapi/attachments\" \\\n -H \"Authorization: $TOKEN\" \\\n -H \"Content-Type: application/json\" \\\n -d \"{\\\"ownerId\\\": \\\"$NOTE_ID\\\", \\\"role\\\": \\\"file\\\", \\\"mime\\\": \\\"application/pdf\\\", \\\"title\\\": \\\"report.pdf\\\", \\\"position\\\": 10}\" \\\n | jq -r .attachmentId)\n\ncurl -X PUT \"$SERVER/etapi/attachments/$ATTACHMENT_ID/content\" \\\n -H \"Authorization: $TOKEN\" \\\n -H \"Content-Type: application/octet-stream\" \\\n --data-binary @report.pdf</code></pre><p>Use <code>--data-binary</code> rather than <code>-d</code>, which strips line breaks from the file. For an image, set <code>role</code> to <code>image</code> and <code>mime</code> to the image's type, such as <code>image/png</code>.</p>",
- "_help_9qPsTWBorUhQ": "<p>External Trilium API</p><h2>Authentication</h2><h3><code>EtapiTokenAuth</code></h3><p>API key in the <code>Authorization</code> header.</p><h3><code>EtapiBasicAuth</code></h3><p>HTTP <code>basic</code> authentication.</p><p>Basic Auth where username is arbitrary string (e.g. \"trilium\", not checked), username is the ETAPI token. To emphasize, do not use Trilium password here (won't work), only the generated ETAPI token (from Options -&gt; ETAPI)</p><h2>Notes</h2><p>Notes and their content, and the import and export of whole subtrees.</p><h3>Create a note</h3><p><code>POST /create-note</code> · <code>createNote</code></p><p>Create a note and place it into the note tree</p><p><strong>Authorization</strong>: <code>EtapiTokenAuth</code> or <code>EtapiBasicAuth</code></p><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>CreateNoteDef</code></li></ul><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>parentNoteId</code> <br><em>required</em></td><td><code>EntityId</code></td><td>Note ID of the parent note in the tree</td></tr><tr><td><code>title</code> <br><em>required</em></td><td><code>string</code></td><td></td></tr><tr><td><code>type</code> <br><em>required</em></td><td><code>string</code></td><td>One of <code>text</code>, <code>code</code>, <code>file</code>, <code>image</code>, <code>search</code>, <code>book</code>, <code>relationMap</code>, <code>render</code>.</td></tr><tr><td><code>mime</code></td><td><code>string</code></td><td>this needs to be specified only for note types 'code', 'file', 'image'.</td></tr><tr><td><code>content</code> <br><em>required</em></td><td><code>string</code></td><td></td></tr><tr><td><code>notePosition</code></td><td><code>integer</code></td><td>Position of the note in the parent. Normal ordering is 10, 20, 30 ... So if you want to create a note on the first position, use e.g. 5, for second position 15, for last e.g. 1000000</td></tr><tr><td><code>prefix</code></td><td><code>string</code></td><td>Prefix is branch (placement) specific title prefix for the note. Let's say you have your note placed into two different places in the tree, but you want to change the title a bit in one of the placements. For this you can use prefix.</td></tr><tr><td><code>isExpanded</code></td><td><code>boolean</code></td><td>true if this note (as a folder) should appear expanded</td></tr><tr><td><code>noteId</code></td><td><code>EntityId</code></td><td>DON'T specify unless you want to force a specific noteId</td></tr><tr><td><code>branchId</code></td><td><code>EntityId</code></td><td>DON'T specify unless you want to force a specific branchId</td></tr><tr><td><code>dateCreated</code></td><td><code>LocalDateTime</code></td><td>Local timestap of the note creation. Specify only if you want to override the default (current datetime in the current timezone/offset).</td></tr><tr><td><code>utcDateCreated</code></td><td><code>UtcDateTime</code></td><td>UTC timestap of the note creation. Specify only if you want to override the default (current datetime).</td></tr><tr><td><code>utcDateModified</code></td><td><code>UtcDateTime</code></td><td>UTC timestamp of the note's last modification, e.g. to keep the date of a note being migrated from another application. The local dateModified is derived from it. Specify only if you want to override the default (current datetime).</td></tr></tbody></table></figure><pre><code class=\"language-application-json\">{\n \"parentNoteId\": \"evnnmvHTCgIn\",\n \"title\": \"string\",\n \"type\": \"text\",\n \"mime\": \"application/json\",\n \"content\": \"string\",\n \"notePosition\": 0,\n \"prefix\": \"string\",\n \"isExpanded\": true,\n \"noteId\": \"evnnmvHTCgIn\",\n \"branchId\": \"evnnmvHTCgIn\",\n \"dateCreated\": \"2021-12-31 20:18:11.930+0100\",\n \"utcDateCreated\": \"2021-12-31 19:18:11.930Z\",\n \"utcDateModified\": \"2021-12-31 19:18:11.930Z\"\n}</code></pre><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; charset=utf-8</code>: <code>NoteWithBranch</code></li></ul><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>note</code></td><td><code>Note</code></td><td></td></tr><tr><td><code>branch</code></td><td><code>Branch</code></td><td>Branch places the note into the tree, it represents the relationship between a parent note and child note</td></tr></tbody></table></figure><pre><code class=\"language-application-json\">{\n \"note\": {\n \"noteId\": \"evnnmvHTCgIn\",\n \"title\": \"string\",\n \"type\": \"text\",\n \"mime\": \"string\",\n \"isProtected\": true,\n \"blobId\": \"string\",\n \"attributes\": [\n {\n \"attributeId\": \"evnnmvHTCgIn\",\n \"noteId\": \"evnnmvHTCgIn\",\n \"type\": \"label\",\n \"name\": \"shareCss\",\n \"value\": \"string\",\n \"position\": 0,\n \"isInheritable\": true,\n \"utcDateModified\": \"2021-12-31 19:18:11.930Z\"\n }\n ],\n \"parentNoteIds\": [\n \"evnnmvHTCgIn\"\n ],\n \"childNoteIds\": [\n \"evnnmvHTCgIn\"\n ],\n \"parentBranchIds\": [\n \"evnnmvHTCgIn\"\n ],\n \"childBranchIds\": [\n \"evnnmvHTCgIn\"\n ],\n \"dateCreated\": \"2021-12-31 20:18:11.930+0100\",\n \"dateModified\": \"2021-12-31 20:18:11.930+0100\",\n \"utcDateCreated\": \"2021-12-31 19:18:11.930Z\",\n \"utcDateModified\": \"2021-12-31 19:18:11.930Z\"\n },\n \"branch\": {\n \"branchId\": \"evnnmvHTCgIn\",\n \"noteId\": \"evnnmvHTCgIn\",\n \"parentNoteId\": \"evnnmvHTCgIn\",\n \"prefix\": \"string\",\n \"notePosition\": 0,\n \"isExpanded\": true,\n \"utcDateModified\": \"2021-12-31 19:18:11.930Z\"\n }\n}</code></pre></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">default: unexpected error</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Error</code></li></ul><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>status</code> <br><em>required</em></td><td><code>integer (int32)</code></td><td>HTTP status, identical to the one given in HTTP response</td></tr><tr><td><code>code</code> <br><em>required</em></td><td><code>string</code></td><td>stable string constant</td></tr><tr><td><code>message</code> <br><em>required</em></td><td><code>string</code></td><td>Human readable error, potentially with more details,</td></tr></tbody></table></figure><pre><code class=\"language-application-json\">{\n \"status\": 400,\n \"code\": \"NOTE_IS_PROTECTED\",\n \"message\": \"Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI\"\n}</code></pre></div></section></div><h3>Search notes</h3><p><code>GET /notes</code> · <code>searchNotes</code></p><p>Search notes</p><p><strong>Authorization</strong>: <code>EtapiTokenAuth</code> or <code>EtapiBasicAuth</code></p><p><strong>Parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>In</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>search</code> <br><em>required</em></td><td>query</td><td><code>string</code></td><td>search query string as described in <a href=\"https://triliumnext.github.io/Docs/Wiki/search.html\">https://triliumnext.github.io/Docs/Wiki/search.html</a></td></tr><tr><td><code>fastSearch</code></td><td>query</td><td><code>boolean</code></td><td>enable fast search (fulltext doesn't look into content)</td></tr><tr><td><code>includeArchivedNotes</code></td><td>query</td><td><code>boolean</code></td><td>search by default ignores archived notes. Set to 'true' to includes archived notes into search results.</td></tr><tr><td><code>ancestorNoteId</code></td><td>query</td><td><code>EntityId</code></td><td>search only in a subtree identified by the subtree noteId. By default whole tree is searched.</td></tr><tr><td><code>ancestorDepth</code></td><td>query</td><td><code>string</code></td><td>define how deep in the tree should the notes be searched</td></tr><tr><td><code>orderBy</code></td><td>query</td><td><code>string</code></td><td>name of the property/label to order search results by</td></tr><tr><td><code>orderDirection</code></td><td>query</td><td><code>string</code></td><td>order direction, ascending or descending. One of <code>asc</code>, <code>desc</code>.</td></tr><tr><td><code>limit</code></td><td>query</td><td><code>integer</code></td><td>limit the number of results you want to receive</td></tr><tr><td><code>debug</code></td><td>query</td><td><code>boolean</code></td><td>set to true to get debug information in the response (search query parsing)</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 response</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>SearchResponse</code></li></ul><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>results</code> <br><em>required</em></td><td><code>array of Note</code></td><td></td></tr><tr><td><code>debugInfo</code></td><td><code>object</code></td><td>debugging info on parsing the search query enabled with &amp;debug=true parameter</td></tr></tbody></table></figure><pre><code class=\"language-application-json\">{\n \"results\": [\n {\n \"noteId\": \"evnnmvHTCgIn\",\n \"title\": \"string\",\n \"type\": \"text\",\n \"mime\": \"string\",\n \"isProtected\": true,\n \"blobId\": \"string\",\n \"attributes\": [\n {\n \"attributeId\": \"evnnmvHTCgIn\",\n \"noteId\": \"evnnmvHTCgIn\",\n \"type\": \"label\",\n \"name\": \"shareCss\",\n \"value\": \"string\",\n \"position\": 0,\n \"isInheritable\": true,\n \"utcDateModified\": \"2021-12-31 19:18:11.930Z\"\n }\n ],\n \"parentNoteIds\": [\n \"evnnmvHTCgIn\"\n ],\n \"childNoteIds\": [\n \"evnnmvHTCgIn\"\n ],\n \"parentBranchIds\": [\n \"evnnmvHTCgIn\"\n ],\n \"childBranchIds\": [\n \"evnnmvHTCgIn\"\n ],\n \"dateCreated\": \"2021-12-31 20:18:11.930+0100\",\n \"dateModified\": \"2021-12-31 20:18:11.930+0100\",\n \"utcDateCreated\": \"2021-12-31 19:18:11.930Z\",\n \"utcDateModified\": \"2021-12-31 19:18:11.930Z\"\n }\n ],\n \"debugInfo\": {}\n}</code></pre></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">default: unexpected error</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Error</code></li></ul><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>status</code> <br><em>required</em></td><td><code>integer (int32)</code></td><td>HTTP status, identical to the one given in HTTP response</td></tr><tr><td><code>code</code> <br><em>required</em></td><td><code>string</code></td><td>stable string constant</td></tr><tr><td><code>message</code> <br><em>required</em></td><td><code>string</code></td><td>Human readable error, potentially with more details,</td></tr></tbody></table></figure><pre><code class=\"language-application-json\">{\n \"status\": 400,\n \"code\": \"NOTE_IS_PROTECTED\",\n \"message\": \"Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI\"\n}</code></pre></div></section></div><h3>Get a note</h3><p><code>GET /notes/{noteId}</code> · <code>getNoteById</code></p><p>Returns a note identified by its ID</p><p><strong>Authorization</strong>: <code>EtapiTokenAuth</code> or <code>EtapiBasicAuth</code></p><p><strong>Parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>In</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td>path</td><td><code>EntityId</code></td><td></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 response</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Note</code></li></ul><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code></td><td><code>EntityId</code></td><td></td></tr><tr><td><code>title</code></td><td><code>string</code></td><td>Title of the note. Returned as \"[protected]\" for protected notes, since ETAPI cannot open a protected session.</td></tr><tr><td><code>type</code></td><td><code>string</code></td><td>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>webView</code>, <code>shortcut</code>, <code>doc</code>, <code>contentWidget</code>, <code>launcher</code>.</td></tr><tr><td><code>mime</code></td><td><code>string</code></td><td></td></tr><tr><td><code>isProtected</code></td><td><code>boolean</code></td><td></td></tr><tr><td><code>blobId</code></td><td><code>string</code></td><td>ID of the blob object which effectively serves as a content hash</td></tr><tr><td><code>attributes</code></td><td><code>AttributeList</code></td><td></td></tr><tr><td><code>parentNoteIds</code></td><td><code>EntityIdList</code></td><td></td></tr><tr><td><code>childNoteIds</code></td><td><code>EntityIdList</code></td><td></td></tr><tr><td><code>parentBranchIds</code></td><td><code>EntityIdList</code></td><td></td></tr><tr><td><code>childBranchIds</code></td><td><code>EntityIdList</code></td><td></td></tr><tr><td><code>dateCreated</code></td><td><code>LocalDateTime</code></td><td></td></tr><tr><td><code>dateModified</code></td><td><code>LocalDateTime</code></td><td></td></tr><tr><td><code>utcDateCreated</code></td><td><code>UtcDateTime</code></td><td></td></tr><tr><td><code>utcDateModified</code></td><td><code>UtcDateTime</code></td><td>Writable through PATCH, e.g. to restore a migrated note's date after its content was rewritten. The local dateModified is derived from it.</td></tr></tbody></table></figure><pre><code class=\"language-application-json\">{\n \"noteId\": \"evnnmvHTCgIn\",\n \"title\": \"string\",\n \"type\": \"text\",\n \"mime\": \"string\",\n \"isProtected\": true,\n \"blobId\": \"string\",\n \"attributes\": [\n {\n \"attributeId\": \"evnnmvHTCgIn\",\n \"noteId\": \"evnnmvHTCgIn\",\n \"type\": \"label\",\n \"name\": \"shareCss\",\n \"value\": \"string\",\n \"position\": 0,\n \"isInheritable\": true,\n \"utcDateModified\": \"2021-12-31 19:18:11.930Z\"\n }\n ],\n \"parentNoteIds\": [\n \"evnnmvHTCgIn\"\n ],\n \"childNoteIds\": [\n \"evnnmvHTCgIn\"\n ],\n \"parentBranchIds\": [\n \"evnnmvHTCgIn\"\n ],\n \"childBranchIds\": [\n \"evnnmvHTCgIn\"\n ],\n \"dateCreated\": \"2021-12-31 20:18:11.930+0100\",\n \"dateModified\": \"2021-12-31 20:18:11.930+0100\",\n \"utcDateCreated\": \"2021-12-31 19:18:11.930Z\",\n \"utcDateModified\": \"2021-12-31 19:18:11.930Z\"\n}</code></pre></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">default: unexpected error</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Error</code></li></ul><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>status</code> <br><em>required</em></td><td><code>integer (int32)</code></td><td>HTTP status, identical to the one given in HTTP response</td></tr><tr><td><code>code</code> <br><em>required</em></td><td><code>string</code></td><td>stable string constant</td></tr><tr><td><code>message</code> <br><em>required</em></td><td><code>string</code></td><td>Human readable error, potentially with more details,</td></tr></tbody></table></figure><pre><code class=\"language-application-json\">{\n \"status\": 400,\n \"code\": \"NOTE_IS_PROTECTED\",\n \"message\": \"Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI\"\n}</code></pre></div></section></div><h3>Delete a note</h3><p><code>DELETE /notes/{noteId}</code> · <code>deleteNoteById</code></p><p>deletes a single note based on the noteId supplied</p><p><strong>Authorization</strong>: <code>EtapiTokenAuth</code> or <code>EtapiBasicAuth</code></p><p><strong>Parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>In</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td>path</td><td><code>EntityId</code></td><td></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\">default: unexpected error</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Error</code></li></ul><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>status</code> <br><em>required</em></td><td><code>integer (int32)</code></td><td>HTTP status, identical to the one given in HTTP response</td></tr><tr><td><code>code</code> <br><em>required</em></td><td><code>string</code></td><td>stable string constant</td></tr><tr><td><code>message</code> <br><em>required</em></td><td><code>string</code></td><td>Human readable error, potentially with more details,</td></tr></tbody></table></figure><pre><code class=\"language-application-json\">{\n \"status\": 400,\n \"code\": \"NOTE_IS_PROTECTED\",\n \"message\": \"Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI\"\n}</code></pre></div></section></div><h3>Update a note</h3><p><code>PATCH /notes/{noteId}</code> · <code>patchNoteById</code></p><p>patch a note identified by the noteId with changes in the body</p><p><strong>Authorization</strong>: <code>EtapiTokenAuth</code> or <code>EtapiBasicAuth</code></p><p><strong>Parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>In</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td>path</td><td><code>EntityId</code></td><td></td></tr></tbody></table></figure><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>Note</code></li></ul><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code></td><td><code>EntityId</code></td><td></td></tr><tr><td><code>title</code></td><td><code>string</code></td><td>Title of the note. Returned as \"[protected]\" for protected notes, since ETAPI cannot open a protected session.</td></tr><tr><td><code>type</code></td><td><code>string</code></td><td>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>webView</code>, <code>shortcut</code>, <code>doc</code>, <code>contentWidget</code>, <code>launcher</code>.</td></tr><tr><td><code>mime</code></td><td><code>string</code></td><td></td></tr><tr><td><code>isProtected</code></td><td><code>boolean</code></td><td></td></tr><tr><td><code>blobId</code></td><td><code>string</code></td><td>ID of the blob object which effectively serves as a content hash</td></tr><tr><td><code>attributes</code></td><td><code>AttributeList</code></td><td></td></tr><tr><td><code>parentNoteIds</code></td><td><code>EntityIdList</code></td><td></td></tr><tr><td><code>childNoteIds</code></td><td><code>EntityIdList</code></td><td></td></tr><tr><td><code>parentBranchIds</code></td><td><code>EntityIdList</code></td><td></td></tr><tr><td><code>childBranchIds</code></td><td><code>EntityIdList</code></td><td></td></tr><tr><td><code>dateCreated</code></td><td><code>LocalDateTime</code></td><td></td></tr><tr><td><code>dateModified</code></td><td><code>LocalDateTime</code></td><td></td></tr><tr><td><code>utcDateCreated</code></td><td><code>UtcDateTime</code></td><td></td></tr><tr><td><code>utcDateModified</code></td><td><code>UtcDateTime</code></td><td>Writable through PATCH, e.g. to restore a migrated note's date after its content was rewritten. The local dateModified is derived from it.</td></tr></tbody></table></figure><pre><code class=\"language-application-json\">{\n \"title\": \"string\",\n \"type\": \"text\",\n \"mime\": \"string\",\n \"blobId\": \"string\",\n \"dateCreated\": \"2021-12-31 20:18:11.930+0100\",\n \"utcDateCreated\": \"2021-12-31 19:18:11.930Z\",\n \"utcDateModified\": \"2021-12-31 19:18:11.930Z\"\n}</code></pre><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: note updated</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Note</code></li></ul><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code></td><td><code>EntityId</code></td><td></td></tr><tr><td><code>title</code></td><td><code>string</code></td><td>Title of the note. Returned as \"[protected]\" for protected notes, since ETAPI cannot open a protected session.</td></tr><tr><td><code>type</code></td><td><code>string</code></td><td>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>webView</code>, <code>shortcut</code>, <code>doc</code>, <code>contentWidget</code>, <code>launcher</code>.</td></tr><tr><td><code>mime</code></td><td><code>string</code></td><td></td></tr><tr><td><code>isProtected</code></td><td><code>boolean</code></td><td></td></tr><tr><td><code>blobId</code></td><td><code>string</code></td><td>ID of the blob object which effectively serves as a content hash</td></tr><tr><td><code>attributes</code></td><td><code>AttributeList</code></td><td></td></tr><tr><td><code>parentNoteIds</code></td><td><code>EntityIdList</code></td><td></td></tr><tr><td><code>childNoteIds</code></td><td><code>EntityIdList</code></td><td></td></tr><tr><td><code>parentBranchIds</code></td><td><code>EntityIdList</code></td><td></td></tr><tr><td><code>childBranchIds</code></td><td><code>EntityIdList</code></td><td></td></tr><tr><td><code>dateCreated</code></td><td><code>LocalDateTime</code></td><td></td></tr><tr><td><code>dateModified</code></td><td><code>LocalDateTime</code></td><td></td></tr><tr><td><code>utcDateCreated</code></td><td><code>UtcDateTime</code></td><td></td></tr><tr><td><code>utcDateModified</code></td><td><code>UtcDateTime</code></td><td>Writable through PATCH, e.g. to restore a migrated note's date after its content was rewritten. The local dateModified is derived from it.</td></tr></tbody></table></figure><pre><code class=\"language-application-json\">{\n \"noteId\": \"evnnmvHTCgIn\",\n \"title\": \"string\",\n \"type\": \"text\",\n \"mime\": \"string\",\n \"isProtected\": true,\n \"blobId\": \"string\",\n \"attributes\": [\n {\n \"attributeId\": \"evnnmvHTCgIn\",\n \"noteId\": \"evnnmvHTCgIn\",\n \"type\": \"label\",\n \"name\": \"shareCss\",\n \"value\": \"string\",\n \"position\": 0,\n \"isInheritable\": true,\n \"utcDateModified\": \"2021-12-31 19:18:11.930Z\"\n }\n ],\n \"parentNoteIds\": [\n \"evnnmvHTCgIn\"\n ],\n \"childNoteIds\": [\n \"evnnmvHTCgIn\"\n ],\n \"parentBranchIds\": [\n \"evnnmvHTCgIn\"\n ],\n \"childBranchIds\": [\n \"evnnmvHTCgIn\"\n ],\n \"dateCreated\": \"2021-12-31 20:18:11.930+0100\",\n \"dateModified\": \"2021-12-31 20:18:11.930+0100\",\n \"utcDateCreated\": \"2021-12-31 19:18:11.930Z\",\n \"utcDateModified\": \"2021-12-31 19:18:11.930Z\"\n}</code></pre></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">default: unexpected error</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Error</code></li></ul><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>status</code> <br><em>required</em></td><td><code>integer (int32)</code></td><td>HTTP status, identical to the one given in HTTP response</td></tr><tr><td><code>code</code> <br><em>required</em></td><td><code>string</code></td><td>stable string constant</td></tr><tr><td><code>message</code> <br><em>required</em></td><td><code>string</code></td><td>Human readable error, potentially with more details,</td></tr></tbody></table></figure><pre><code class=\"language-application-json\">{\n \"status\": 400,\n \"code\": \"NOTE_IS_PROTECTED\",\n \"message\": \"Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI\"\n}</code></pre></div></section></div><h3>Get the content of a note</h3><p><code>GET /notes/{noteId}/content</code> · <code>getNoteContent</code></p><p>Returns note content identified by its ID. The response carries the note's MIME type as its <code>Content-Type</code>.</p><p><strong>Authorization</strong>: <code>EtapiTokenAuth</code> or <code>EtapiBasicAuth</code></p><p><strong>Parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>In</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td>path</td><td><code>EntityId</code></td><td></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\"><ul><li><code>*/*</code>: <code>string (binary)</code></li></ul></div></section></div><h3>Replace the content of a note</h3><p><code>PUT /notes/{noteId}/content</code> · <code>putNoteContentById</code></p><p>Updates note content identified by its ID</p><p><strong>Authorization</strong>: <code>EtapiTokenAuth</code> or <code>EtapiBasicAuth</code></p><p><strong>Parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>In</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td>path</td><td><code>EntityId</code></td><td></td></tr></tbody></table></figure><p><strong>Request body</strong> (required)</p><p>New content of the note. Send text (such as the HTML of a text note) as <code>text/plain</code> and binary data (such as the file of an image or file note) as <code>application/octet-stream</code>; other content types are not accepted.</p><ul><li><code>text/plain</code>: <code>string</code></li><li><code>application/octet-stream</code>: <code>string (binary)</code></li></ul><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: note content updated</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Export a subtree</h3><p><code>GET /notes/{noteId}/export</code> · <code>exportNoteSubtree</code></p><p>Exports ZIP file export of a given note subtree. To export whole document, use \"root\" for noteId</p><p><strong>Authorization</strong>: <code>EtapiTokenAuth</code> or <code>EtapiBasicAuth</code></p><p><strong>Parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>In</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td>path</td><td><code>EntityId</code></td><td></td></tr><tr><td><code>format</code></td><td>query</td><td><code>any</code></td><td>One of <code>html</code>, <code>markdown</code>, <code>share</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: export ZIP file</p><div class=\"trilium-tab-panel\"><ul><li><code>application/zip</code>: <code>string (binary)</code></li></ul></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">default: unexpected error</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Error</code></li></ul><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>status</code> <br><em>required</em></td><td><code>integer (int32)</code></td><td>HTTP status, identical to the one given in HTTP response</td></tr><tr><td><code>code</code> <br><em>required</em></td><td><code>string</code></td><td>stable string constant</td></tr><tr><td><code>message</code> <br><em>required</em></td><td><code>string</code></td><td>Human readable error, potentially with more details,</td></tr></tbody></table></figure><pre><code class=\"language-application-json\">{\n \"status\": 400,\n \"code\": \"NOTE_IS_PROTECTED\",\n \"message\": \"Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI\"\n}</code></pre></div></section></div><h3>Import a ZIP archive</h3><p><code>POST /notes/{noteId}/import</code> · <code>importZip</code></p><p>Imports ZIP file into a given note.</p><p><strong>Authorization</strong>: <code>EtapiTokenAuth</code> or <code>EtapiBasicAuth</code></p><p><strong>Parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>In</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td>path</td><td><code>EntityId</code></td><td></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 created</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>NoteWithBranch</code></li></ul><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>note</code></td><td><code>Note</code></td><td></td></tr><tr><td><code>branch</code></td><td><code>Branch</code></td><td>Branch places the note into the tree, it represents the relationship between a parent note and child note</td></tr></tbody></table></figure><pre><code class=\"language-application-json\">{\n \"note\": {\n \"noteId\": \"evnnmvHTCgIn\",\n \"title\": \"string\",\n \"type\": \"text\",\n \"mime\": \"string\",\n \"isProtected\": true,\n \"blobId\": \"string\",\n \"attributes\": [\n {\n \"attributeId\": \"evnnmvHTCgIn\",\n \"noteId\": \"evnnmvHTCgIn\",\n \"type\": \"label\",\n \"name\": \"shareCss\",\n \"value\": \"string\",\n \"position\": 0,\n \"isInheritable\": true,\n \"utcDateModified\": \"2021-12-31 19:18:11.930Z\"\n }\n ],\n \"parentNoteIds\": [\n \"evnnmvHTCgIn\"\n ],\n \"childNoteIds\": [\n \"evnnmvHTCgIn\"\n ],\n \"parentBranchIds\": [\n \"evnnmvHTCgIn\"\n ],\n \"childBranchIds\": [\n \"evnnmvHTCgIn\"\n ],\n \"dateCreated\": \"2021-12-31 20:18:11.930+0100\",\n \"dateModified\": \"2021-12-31 20:18:11.930+0100\",\n \"utcDateCreated\": \"2021-12-31 19:18:11.930Z\",\n \"utcDateModified\": \"2021-12-31 19:18:11.930Z\"\n },\n \"branch\": {\n \"branchId\": \"evnnmvHTCgIn\",\n \"noteId\": \"evnnmvHTCgIn\",\n \"parentNoteId\": \"evnnmvHTCgIn\",\n \"prefix\": \"string\",\n \"notePosition\": 0,\n \"isExpanded\": true,\n \"utcDateModified\": \"2021-12-31 19:18:11.930Z\"\n }\n}</code></pre></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">default: unexpected error</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Error</code></li></ul><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>status</code> <br><em>required</em></td><td><code>integer (int32)</code></td><td>HTTP status, identical to the one given in HTTP response</td></tr><tr><td><code>code</code> <br><em>required</em></td><td><code>string</code></td><td>stable string constant</td></tr><tr><td><code>message</code> <br><em>required</em></td><td><code>string</code></td><td>Human readable error, potentially with more details,</td></tr></tbody></table></figure><pre><code class=\"language-application-json\">{\n \"status\": 400,\n \"code\": \"NOTE_IS_PROTECTED\",\n \"message\": \"Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI\"\n}</code></pre></div></section></div><h3>Restore a deleted note</h3><p><code>POST /notes/{noteId}/undelete</code> · <code>undeleteNote</code></p><p>Restore a deleted note. The note must be deleted and must have at least one undeleted parent.</p><p><strong>Authorization</strong>: <code>EtapiTokenAuth</code> or <code>EtapiBasicAuth</code></p><p><strong>Parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>In</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td>path</td><td><code>EntityId</code></td><td></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 restored successfully</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>object</code></li></ul><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>success</code></td><td><code>boolean</code></td><td></td></tr></tbody></table></figure><pre><code class=\"language-application-json\">{\n \"success\": true\n}</code></pre></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">default: unexpected error</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Error</code></li></ul><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>status</code> <br><em>required</em></td><td><code>integer (int32)</code></td><td>HTTP status, identical to the one given in HTTP response</td></tr><tr><td><code>code</code> <br><em>required</em></td><td><code>string</code></td><td>stable string constant</td></tr><tr><td><code>message</code> <br><em>required</em></td><td><code>string</code></td><td>Human readable error, potentially with more details,</td></tr></tbody></table></figure><pre><code class=\"language-application-json\">{\n \"status\": 400,\n \"code\": \"NOTE_IS_PROTECTED\",\n \"message\": \"Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI\"\n}</code></pre></div></section></div><h3>List recent changes</h3><p><code>GET /notes/history</code> · <code>getNoteHistory</code></p><p>Returns recent changes including note creations, modifications, and deletions</p><p><strong>Authorization</strong>: <code>EtapiTokenAuth</code> or <code>EtapiBasicAuth</code></p><p><strong>Parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>In</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>ancestorNoteId</code></td><td>query</td><td><code>EntityId</code></td><td>Limit changes to a subtree identified by this note ID. Defaults to \"root\" (all notes).</td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: list of recent changes</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>array of RecentChange</code></li></ul><pre><code class=\"language-application-json\">[\n {\n \"noteId\": \"evnnmvHTCgIn\",\n \"title\": \"string\",\n \"current_title\": \"string\",\n \"current_isDeleted\": true,\n \"current_deleteId\": \"string\",\n \"current_isProtected\": true,\n \"utcDate\": \"2021-12-31 19:18:11.930Z\",\n \"date\": \"2021-12-31 20:18:11.930+0100\",\n \"canBeUndeleted\": true\n }\n]</code></pre></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">default: unexpected error</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Error</code></li></ul><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>status</code> <br><em>required</em></td><td><code>integer (int32)</code></td><td>HTTP status, identical to the one given in HTTP response</td></tr><tr><td><code>code</code> <br><em>required</em></td><td><code>string</code></td><td>stable string constant</td></tr><tr><td><code>message</code> <br><em>required</em></td><td><code>string</code></td><td>Human readable error, potentially with more details,</td></tr></tbody></table></figure><pre><code class=\"language-application-json\">{\n \"status\": 400,\n \"code\": \"NOTE_IS_PROTECTED\",\n \"message\": \"Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI\"\n}</code></pre></div></section></div><h2>Branches</h2><p>Branches place a note in the tree, under a parent note.</p><h3>Create a branch</h3><p><code>POST /branches</code> · <code>postBranch</code></p><p>Create a branch (clone a note to a different location in the tree). In case there is a branch between parent note and child note already, then this will update the existing branch with prefix, notePosition and isExpanded.</p><p><strong>Authorization</strong>: <code>EtapiTokenAuth</code> or <code>EtapiBasicAuth</code></p><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>Branch</code></li></ul><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>branchId</code></td><td><code>EntityId</code></td><td></td></tr><tr><td><code>noteId</code></td><td><code>EntityId</code></td><td>identifies the child note</td></tr><tr><td><code>parentNoteId</code></td><td><code>EntityId</code></td><td>identifies the parent note</td></tr><tr><td><code>prefix</code></td><td><code>string</code></td><td></td></tr><tr><td><code>notePosition</code></td><td><code>integer (int32)</code></td><td></td></tr><tr><td><code>isExpanded</code></td><td><code>boolean</code></td><td></td></tr><tr><td><code>utcDateModified</code></td><td><code>UtcDateTime</code></td><td></td></tr></tbody></table></figure><pre><code class=\"language-application-json\">{\n \"branchId\": \"evnnmvHTCgIn\",\n \"prefix\": \"string\",\n \"notePosition\": 0,\n \"isExpanded\": true\n}</code></pre><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: existing branch updated</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Branch</code></li></ul><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>branchId</code></td><td><code>EntityId</code></td><td></td></tr><tr><td><code>noteId</code></td><td><code>EntityId</code></td><td>identifies the child note</td></tr><tr><td><code>parentNoteId</code></td><td><code>EntityId</code></td><td>identifies the parent note</td></tr><tr><td><code>prefix</code></td><td><code>string</code></td><td></td></tr><tr><td><code>notePosition</code></td><td><code>integer (int32)</code></td><td></td></tr><tr><td><code>isExpanded</code></td><td><code>boolean</code></td><td></td></tr><tr><td><code>utcDateModified</code></td><td><code>UtcDateTime</code></td><td></td></tr></tbody></table></figure><pre><code class=\"language-application-json\">{\n \"branchId\": \"evnnmvHTCgIn\",\n \"noteId\": \"evnnmvHTCgIn\",\n \"parentNoteId\": \"evnnmvHTCgIn\",\n \"prefix\": \"string\",\n \"notePosition\": 0,\n \"isExpanded\": true,\n \"utcDateModified\": \"2021-12-31 19:18:11.930Z\"\n}</code></pre></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">201: branch created</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Branch</code></li></ul><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>branchId</code></td><td><code>EntityId</code></td><td></td></tr><tr><td><code>noteId</code></td><td><code>EntityId</code></td><td>identifies the child note</td></tr><tr><td><code>parentNoteId</code></td><td><code>EntityId</code></td><td>identifies the parent note</td></tr><tr><td><code>prefix</code></td><td><code>string</code></td><td></td></tr><tr><td><code>notePosition</code></td><td><code>integer (int32)</code></td><td></td></tr><tr><td><code>isExpanded</code></td><td><code>boolean</code></td><td></td></tr><tr><td><code>utcDateModified</code></td><td><code>UtcDateTime</code></td><td></td></tr></tbody></table></figure><pre><code class=\"language-application-json\">{\n \"branchId\": \"evnnmvHTCgIn\",\n \"noteId\": \"evnnmvHTCgIn\",\n \"parentNoteId\": \"evnnmvHTCgIn\",\n \"prefix\": \"string\",\n \"notePosition\": 0,\n \"isExpanded\": true,\n \"utcDateModified\": \"2021-12-31 19:18:11.930Z\"\n}</code></pre></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">default: unexpected error</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Error</code></li></ul><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>status</code> <br><em>required</em></td><td><code>integer (int32)</code></td><td>HTTP status, identical to the one given in HTTP response</td></tr><tr><td><code>code</code> <br><em>required</em></td><td><code>string</code></td><td>stable string constant</td></tr><tr><td><code>message</code> <br><em>required</em></td><td><code>string</code></td><td>Human readable error, potentially with more details,</td></tr></tbody></table></figure><pre><code class=\"language-application-json\">{\n \"status\": 400,\n \"code\": \"NOTE_IS_PROTECTED\",\n \"message\": \"Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI\"\n}</code></pre></div></section></div><h3>Get a branch</h3><p><code>GET /branches/{branchId}</code> · <code>getBranchById</code></p><p>Returns a branch identified by its ID</p><p><strong>Authorization</strong>: <code>EtapiTokenAuth</code> or <code>EtapiBasicAuth</code></p><p><strong>Parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>In</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>branchId</code> <br><em>required</em></td><td>path</td><td><code>EntityId</code></td><td></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 response</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Branch</code></li></ul><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>branchId</code></td><td><code>EntityId</code></td><td></td></tr><tr><td><code>noteId</code></td><td><code>EntityId</code></td><td>identifies the child note</td></tr><tr><td><code>parentNoteId</code></td><td><code>EntityId</code></td><td>identifies the parent note</td></tr><tr><td><code>prefix</code></td><td><code>string</code></td><td></td></tr><tr><td><code>notePosition</code></td><td><code>integer (int32)</code></td><td></td></tr><tr><td><code>isExpanded</code></td><td><code>boolean</code></td><td></td></tr><tr><td><code>utcDateModified</code></td><td><code>UtcDateTime</code></td><td></td></tr></tbody></table></figure><pre><code class=\"language-application-json\">{\n \"branchId\": \"evnnmvHTCgIn\",\n \"noteId\": \"evnnmvHTCgIn\",\n \"parentNoteId\": \"evnnmvHTCgIn\",\n \"prefix\": \"string\",\n \"notePosition\": 0,\n \"isExpanded\": true,\n \"utcDateModified\": \"2021-12-31 19:18:11.930Z\"\n}</code></pre></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">default: unexpected error</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Error</code></li></ul><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>status</code> <br><em>required</em></td><td><code>integer (int32)</code></td><td>HTTP status, identical to the one given in HTTP response</td></tr><tr><td><code>code</code> <br><em>required</em></td><td><code>string</code></td><td>stable string constant</td></tr><tr><td><code>message</code> <br><em>required</em></td><td><code>string</code></td><td>Human readable error, potentially with more details,</td></tr></tbody></table></figure><pre><code class=\"language-application-json\">{\n \"status\": 400,\n \"code\": \"NOTE_IS_PROTECTED\",\n \"message\": \"Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI\"\n}</code></pre></div></section></div><h3>Delete a branch</h3><p><code>DELETE /branches/{branchId}</code> · <code>deleteBranchById</code></p><p>deletes a branch based on the branchId supplied. If this is the last branch of the (child) note, then the note is deleted as well.</p><p><strong>Authorization</strong>: <code>EtapiTokenAuth</code> or <code>EtapiBasicAuth</code></p><p><strong>Parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>In</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>branchId</code> <br><em>required</em></td><td>path</td><td><code>EntityId</code></td><td></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 deleted</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">default: unexpected error</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Error</code></li></ul><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>status</code> <br><em>required</em></td><td><code>integer (int32)</code></td><td>HTTP status, identical to the one given in HTTP response</td></tr><tr><td><code>code</code> <br><em>required</em></td><td><code>string</code></td><td>stable string constant</td></tr><tr><td><code>message</code> <br><em>required</em></td><td><code>string</code></td><td>Human readable error, potentially with more details,</td></tr></tbody></table></figure><pre><code class=\"language-application-json\">{\n \"status\": 400,\n \"code\": \"NOTE_IS_PROTECTED\",\n \"message\": \"Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI\"\n}</code></pre></div></section></div><h3>Update a branch</h3><p><code>PATCH /branches/{branchId}</code> · <code>patchBranchById</code></p><p>patch a branch identified by the branchId with changes in the body. Only prefix and notePosition can be updated. If you want to update other properties, you need to delete the old branch and create a new one.</p><p><strong>Authorization</strong>: <code>EtapiTokenAuth</code> or <code>EtapiBasicAuth</code></p><p><strong>Parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>In</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>branchId</code> <br><em>required</em></td><td>path</td><td><code>EntityId</code></td><td></td></tr></tbody></table></figure><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>Branch</code></li></ul><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>branchId</code></td><td><code>EntityId</code></td><td></td></tr><tr><td><code>noteId</code></td><td><code>EntityId</code></td><td>identifies the child note</td></tr><tr><td><code>parentNoteId</code></td><td><code>EntityId</code></td><td>identifies the parent note</td></tr><tr><td><code>prefix</code></td><td><code>string</code></td><td></td></tr><tr><td><code>notePosition</code></td><td><code>integer (int32)</code></td><td></td></tr><tr><td><code>isExpanded</code></td><td><code>boolean</code></td><td></td></tr><tr><td><code>utcDateModified</code></td><td><code>UtcDateTime</code></td><td></td></tr></tbody></table></figure><pre><code class=\"language-application-json\">{\n \"branchId\": \"evnnmvHTCgIn\",\n \"prefix\": \"string\",\n \"notePosition\": 0,\n \"isExpanded\": true\n}</code></pre><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: branch updated</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Branch</code></li></ul><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>branchId</code></td><td><code>EntityId</code></td><td></td></tr><tr><td><code>noteId</code></td><td><code>EntityId</code></td><td>identifies the child note</td></tr><tr><td><code>parentNoteId</code></td><td><code>EntityId</code></td><td>identifies the parent note</td></tr><tr><td><code>prefix</code></td><td><code>string</code></td><td></td></tr><tr><td><code>notePosition</code></td><td><code>integer (int32)</code></td><td></td></tr><tr><td><code>isExpanded</code></td><td><code>boolean</code></td><td></td></tr><tr><td><code>utcDateModified</code></td><td><code>UtcDateTime</code></td><td></td></tr></tbody></table></figure><pre><code class=\"language-application-json\">{\n \"branchId\": \"evnnmvHTCgIn\",\n \"noteId\": \"evnnmvHTCgIn\",\n \"parentNoteId\": \"evnnmvHTCgIn\",\n \"prefix\": \"string\",\n \"notePosition\": 0,\n \"isExpanded\": true,\n \"utcDateModified\": \"2021-12-31 19:18:11.930Z\"\n}</code></pre></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">default: unexpected error</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Error</code></li></ul><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>status</code> <br><em>required</em></td><td><code>integer (int32)</code></td><td>HTTP status, identical to the one given in HTTP response</td></tr><tr><td><code>code</code> <br><em>required</em></td><td><code>string</code></td><td>stable string constant</td></tr><tr><td><code>message</code> <br><em>required</em></td><td><code>string</code></td><td>Human readable error, potentially with more details,</td></tr></tbody></table></figure><pre><code class=\"language-application-json\">{\n \"status\": 400,\n \"code\": \"NOTE_IS_PROTECTED\",\n \"message\": \"Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI\"\n}</code></pre></div></section></div><h3>Refresh the order of child notes</h3><p><code>POST /refresh-note-ordering/{parentNoteId}</code> · <code>postRefreshNoteOrdering</code></p><p>notePositions in branches are not automatically pushed to connected clients and need a specific instruction. If you want your changes to be in effect immediately, call this service after setting branches' notePosition. Note that you need to supply \"parentNoteId\" of branch(es) with changed positions.</p><p><strong>Authorization</strong>: <code>EtapiTokenAuth</code> or <code>EtapiBasicAuth</code></p><p><strong>Parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>In</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>parentNoteId</code> <br><em>required</em></td><td>path</td><td><code>EntityId</code></td><td></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 ordering refreshed</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">default: unexpected error</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Error</code></li></ul><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>status</code> <br><em>required</em></td><td><code>integer (int32)</code></td><td>HTTP status, identical to the one given in HTTP response</td></tr><tr><td><code>code</code> <br><em>required</em></td><td><code>string</code></td><td>stable string constant</td></tr><tr><td><code>message</code> <br><em>required</em></td><td><code>string</code></td><td>Human readable error, potentially with more details,</td></tr></tbody></table></figure><pre><code class=\"language-application-json\">{\n \"status\": 400,\n \"code\": \"NOTE_IS_PROTECTED\",\n \"message\": \"Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI\"\n}</code></pre></div></section></div><h2>Attributes</h2><p>Labels and relations of a note.</p><h3>Create an attribute</h3><p><code>POST /attributes</code> · <code>postAttribute</code></p><p>create an attribute for a given note</p><p><strong>Authorization</strong>: <code>EtapiTokenAuth</code> or <code>EtapiBasicAuth</code></p><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>Attribute</code></li></ul><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>attributeId</code></td><td><code>EntityId</code></td><td></td></tr><tr><td><code>noteId</code></td><td><code>EntityId</code></td><td>identifies the child note</td></tr><tr><td><code>type</code></td><td><code>string</code></td><td>One of <code>label</code>, <code>relation</code>.</td></tr><tr><td><code>name</code></td><td><code>string</code></td><td></td></tr><tr><td><code>value</code></td><td><code>string</code></td><td></td></tr><tr><td><code>position</code></td><td><code>integer (int32)</code></td><td></td></tr><tr><td><code>isInheritable</code></td><td><code>boolean</code></td><td></td></tr><tr><td><code>utcDateModified</code></td><td><code>UtcDateTime</code></td><td></td></tr></tbody></table></figure><pre><code class=\"language-application-json\">{\n \"attributeId\": \"evnnmvHTCgIn\",\n \"type\": \"label\",\n \"name\": \"shareCss\",\n \"value\": \"string\",\n \"position\": 0,\n \"isInheritable\": true\n}</code></pre><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">201: attribute created</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Attribute</code></li></ul><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>attributeId</code></td><td><code>EntityId</code></td><td></td></tr><tr><td><code>noteId</code></td><td><code>EntityId</code></td><td>identifies the child note</td></tr><tr><td><code>type</code></td><td><code>string</code></td><td>One of <code>label</code>, <code>relation</code>.</td></tr><tr><td><code>name</code></td><td><code>string</code></td><td></td></tr><tr><td><code>value</code></td><td><code>string</code></td><td></td></tr><tr><td><code>position</code></td><td><code>integer (int32)</code></td><td></td></tr><tr><td><code>isInheritable</code></td><td><code>boolean</code></td><td></td></tr><tr><td><code>utcDateModified</code></td><td><code>UtcDateTime</code></td><td></td></tr></tbody></table></figure><pre><code class=\"language-application-json\">{\n \"attributeId\": \"evnnmvHTCgIn\",\n \"noteId\": \"evnnmvHTCgIn\",\n \"type\": \"label\",\n \"name\": \"shareCss\",\n \"value\": \"string\",\n \"position\": 0,\n \"isInheritable\": true,\n \"utcDateModified\": \"2021-12-31 19:18:11.930Z\"\n}</code></pre></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">default: unexpected error</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Error</code></li></ul><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>status</code> <br><em>required</em></td><td><code>integer (int32)</code></td><td>HTTP status, identical to the one given in HTTP response</td></tr><tr><td><code>code</code> <br><em>required</em></td><td><code>string</code></td><td>stable string constant</td></tr><tr><td><code>message</code> <br><em>required</em></td><td><code>string</code></td><td>Human readable error, potentially with more details,</td></tr></tbody></table></figure><pre><code class=\"language-application-json\">{\n \"status\": 400,\n \"code\": \"NOTE_IS_PROTECTED\",\n \"message\": \"Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI\"\n}</code></pre></div></section></div><h3>Get an attribute</h3><p><code>GET /attributes/{attributeId}</code> · <code>getAttributeById</code></p><p>Returns an attribute identified by its ID</p><p><strong>Authorization</strong>: <code>EtapiTokenAuth</code> or <code>EtapiBasicAuth</code></p><p><strong>Parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>In</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>attributeId</code> <br><em>required</em></td><td>path</td><td><code>EntityId</code></td><td></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 response</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Attribute</code></li></ul><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>attributeId</code></td><td><code>EntityId</code></td><td></td></tr><tr><td><code>noteId</code></td><td><code>EntityId</code></td><td>identifies the child note</td></tr><tr><td><code>type</code></td><td><code>string</code></td><td>One of <code>label</code>, <code>relation</code>.</td></tr><tr><td><code>name</code></td><td><code>string</code></td><td></td></tr><tr><td><code>value</code></td><td><code>string</code></td><td></td></tr><tr><td><code>position</code></td><td><code>integer (int32)</code></td><td></td></tr><tr><td><code>isInheritable</code></td><td><code>boolean</code></td><td></td></tr><tr><td><code>utcDateModified</code></td><td><code>UtcDateTime</code></td><td></td></tr></tbody></table></figure><pre><code class=\"language-application-json\">{\n \"attributeId\": \"evnnmvHTCgIn\",\n \"noteId\": \"evnnmvHTCgIn\",\n \"type\": \"label\",\n \"name\": \"shareCss\",\n \"value\": \"string\",\n \"position\": 0,\n \"isInheritable\": true,\n \"utcDateModified\": \"2021-12-31 19:18:11.930Z\"\n}</code></pre></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">default: unexpected error</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Error</code></li></ul><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>status</code> <br><em>required</em></td><td><code>integer (int32)</code></td><td>HTTP status, identical to the one given in HTTP response</td></tr><tr><td><code>code</code> <br><em>required</em></td><td><code>string</code></td><td>stable string constant</td></tr><tr><td><code>message</code> <br><em>required</em></td><td><code>string</code></td><td>Human readable error, potentially with more details,</td></tr></tbody></table></figure><pre><code class=\"language-application-json\">{\n \"status\": 400,\n \"code\": \"NOTE_IS_PROTECTED\",\n \"message\": \"Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI\"\n}</code></pre></div></section></div><h3>Delete an attribute</h3><p><code>DELETE /attributes/{attributeId}</code> · <code>deleteAttributeById</code></p><p>deletes an attribute based on the attributeId supplied.</p><p><strong>Authorization</strong>: <code>EtapiTokenAuth</code> or <code>EtapiBasicAuth</code></p><p><strong>Parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>In</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>attributeId</code> <br><em>required</em></td><td>path</td><td><code>EntityId</code></td><td></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><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">default: unexpected error</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Error</code></li></ul><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>status</code> <br><em>required</em></td><td><code>integer (int32)</code></td><td>HTTP status, identical to the one given in HTTP response</td></tr><tr><td><code>code</code> <br><em>required</em></td><td><code>string</code></td><td>stable string constant</td></tr><tr><td><code>message</code> <br><em>required</em></td><td><code>string</code></td><td>Human readable error, potentially with more details,</td></tr></tbody></table></figure><pre><code class=\"language-application-json\">{\n \"status\": 400,\n \"code\": \"NOTE_IS_PROTECTED\",\n \"message\": \"Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI\"\n}</code></pre></div></section></div><h3>Update an attribute</h3><p><code>PATCH /attributes/{attributeId}</code> · <code>patchAttributeById</code></p><p>patch an attribute identified by the attributeId with changes in the body. For labels, only value and position can be updated. For relations, only position can be updated. If you want to modify other properties, you need to delete the old attribute and create a new one.</p><p><strong>Authorization</strong>: <code>EtapiTokenAuth</code> or <code>EtapiBasicAuth</code></p><p><strong>Parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>In</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>attributeId</code> <br><em>required</em></td><td>path</td><td><code>EntityId</code></td><td></td></tr></tbody></table></figure><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>Attribute</code></li></ul><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>attributeId</code></td><td><code>EntityId</code></td><td></td></tr><tr><td><code>noteId</code></td><td><code>EntityId</code></td><td>identifies the child note</td></tr><tr><td><code>type</code></td><td><code>string</code></td><td>One of <code>label</code>, <code>relation</code>.</td></tr><tr><td><code>name</code></td><td><code>string</code></td><td></td></tr><tr><td><code>value</code></td><td><code>string</code></td><td></td></tr><tr><td><code>position</code></td><td><code>integer (int32)</code></td><td></td></tr><tr><td><code>isInheritable</code></td><td><code>boolean</code></td><td></td></tr><tr><td><code>utcDateModified</code></td><td><code>UtcDateTime</code></td><td></td></tr></tbody></table></figure><pre><code class=\"language-application-json\">{\n \"attributeId\": \"evnnmvHTCgIn\",\n \"type\": \"label\",\n \"name\": \"shareCss\",\n \"value\": \"string\",\n \"position\": 0,\n \"isInheritable\": true\n}</code></pre><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: attribute updated</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Attribute</code></li></ul><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>attributeId</code></td><td><code>EntityId</code></td><td></td></tr><tr><td><code>noteId</code></td><td><code>EntityId</code></td><td>identifies the child note</td></tr><tr><td><code>type</code></td><td><code>string</code></td><td>One of <code>label</code>, <code>relation</code>.</td></tr><tr><td><code>name</code></td><td><code>string</code></td><td></td></tr><tr><td><code>value</code></td><td><code>string</code></td><td></td></tr><tr><td><code>position</code></td><td><code>integer (int32)</code></td><td></td></tr><tr><td><code>isInheritable</code></td><td><code>boolean</code></td><td></td></tr><tr><td><code>utcDateModified</code></td><td><code>UtcDateTime</code></td><td></td></tr></tbody></table></figure><pre><code class=\"language-application-json\">{\n \"attributeId\": \"evnnmvHTCgIn\",\n \"noteId\": \"evnnmvHTCgIn\",\n \"type\": \"label\",\n \"name\": \"shareCss\",\n \"value\": \"string\",\n \"position\": 0,\n \"isInheritable\": true,\n \"utcDateModified\": \"2021-12-31 19:18:11.930Z\"\n}</code></pre></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">default: unexpected error</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Error</code></li></ul><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>status</code> <br><em>required</em></td><td><code>integer (int32)</code></td><td>HTTP status, identical to the one given in HTTP response</td></tr><tr><td><code>code</code> <br><em>required</em></td><td><code>string</code></td><td>stable string constant</td></tr><tr><td><code>message</code> <br><em>required</em></td><td><code>string</code></td><td>Human readable error, potentially with more details,</td></tr></tbody></table></figure><pre><code class=\"language-application-json\">{\n \"status\": 400,\n \"code\": \"NOTE_IS_PROTECTED\",\n \"message\": \"Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI\"\n}</code></pre></div></section></div><h2>Attachments</h2><p>Files attached to a note.</p><h3>List the attachments of a note</h3><p><code>GET /notes/{noteId}/attachments</code> · <code>getNoteAttachments</code></p><p>Returns all attachments for a note identified by its ID</p><p><strong>Authorization</strong>: <code>EtapiTokenAuth</code> or <code>EtapiBasicAuth</code></p><p><strong>Parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>In</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td>path</td><td><code>EntityId</code></td><td></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: list of attachments</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>array of Attachment</code></li></ul><pre><code class=\"language-application-json\">[\n {\n \"attachmentId\": \"evnnmvHTCgIn\",\n \"ownerId\": \"evnnmvHTCgIn\",\n \"role\": \"string\",\n \"mime\": \"string\",\n \"title\": \"string\",\n \"position\": 0,\n \"blobId\": \"string\",\n \"dateModified\": \"2021-12-31 20:18:11.930+0100\",\n \"utcDateModified\": \"2021-12-31 19:18:11.930Z\",\n \"utcDateScheduledForErasureSince\": \"2021-12-31 19:18:11.930Z\",\n \"contentLength\": 0\n }\n]</code></pre></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">default: unexpected error</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Error</code></li></ul><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>status</code> <br><em>required</em></td><td><code>integer (int32)</code></td><td>HTTP status, identical to the one given in HTTP response</td></tr><tr><td><code>code</code> <br><em>required</em></td><td><code>string</code></td><td>stable string constant</td></tr><tr><td><code>message</code> <br><em>required</em></td><td><code>string</code></td><td>Human readable error, potentially with more details,</td></tr></tbody></table></figure><pre><code class=\"language-application-json\">{\n \"status\": 400,\n \"code\": \"NOTE_IS_PROTECTED\",\n \"message\": \"Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI\"\n}</code></pre></div></section></div><h3>Create an attachment</h3><p><code>POST /attachments</code> · <code>postAttachment</code></p><p>create an attachment</p><p><strong>Authorization</strong>: <code>EtapiTokenAuth</code> or <code>EtapiBasicAuth</code></p><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>CreateAttachment</code></li></ul><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>ownerId</code></td><td><code>EntityId</code></td><td>identifies the owner of the attachment, is either noteId or revisionId</td></tr><tr><td><code>role</code></td><td><code>string</code></td><td></td></tr><tr><td><code>mime</code></td><td><code>string</code></td><td></td></tr><tr><td><code>title</code></td><td><code>string</code></td><td></td></tr><tr><td><code>content</code></td><td><code>string</code></td><td>Text content of the attachment, stored as-is. To store binary content, create the attachment without it, then upload the data with <code>PUT /attachments/{attachmentId}/content</code>.</td></tr><tr><td><code>position</code></td><td><code>integer (int32)</code></td><td></td></tr></tbody></table></figure><pre><code class=\"language-application-json\">{\n \"ownerId\": \"evnnmvHTCgIn\",\n \"role\": \"string\",\n \"mime\": \"string\",\n \"title\": \"string\",\n \"content\": \"string\",\n \"position\": 0\n}</code></pre><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">201: attachment created</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Attachment</code></li></ul><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>attachmentId</code></td><td><code>EntityId</code></td><td></td></tr><tr><td><code>ownerId</code></td><td><code>EntityId</code></td><td>identifies the owner of the attachment, is either noteId or revisionId</td></tr><tr><td><code>role</code></td><td><code>string</code></td><td></td></tr><tr><td><code>mime</code></td><td><code>string</code></td><td></td></tr><tr><td><code>title</code></td><td><code>string</code></td><td>Title of the attachment. Returned as \"[protected]\" for protected attachments, since ETAPI cannot open a protected session.</td></tr><tr><td><code>position</code></td><td><code>integer (int32)</code></td><td></td></tr><tr><td><code>blobId</code></td><td><code>string</code></td><td>ID of the blob object which effectively serves as a content hash</td></tr><tr><td><code>dateModified</code></td><td><code>LocalDateTime</code></td><td></td></tr><tr><td><code>utcDateModified</code></td><td><code>UtcDateTime</code></td><td></td></tr><tr><td><code>utcDateScheduledForErasureSince</code></td><td><code>UtcDateTime</code></td><td></td></tr><tr><td><code>contentLength</code></td><td><code>integer (int32)</code></td><td></td></tr></tbody></table></figure><pre><code class=\"language-application-json\">{\n \"attachmentId\": \"evnnmvHTCgIn\",\n \"ownerId\": \"evnnmvHTCgIn\",\n \"role\": \"string\",\n \"mime\": \"string\",\n \"title\": \"string\",\n \"position\": 0,\n \"blobId\": \"string\",\n \"dateModified\": \"2021-12-31 20:18:11.930+0100\",\n \"utcDateModified\": \"2021-12-31 19:18:11.930Z\",\n \"utcDateScheduledForErasureSince\": \"2021-12-31 19:18:11.930Z\",\n \"contentLength\": 0\n}</code></pre></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">default: unexpected error</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Error</code></li></ul><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>status</code> <br><em>required</em></td><td><code>integer (int32)</code></td><td>HTTP status, identical to the one given in HTTP response</td></tr><tr><td><code>code</code> <br><em>required</em></td><td><code>string</code></td><td>stable string constant</td></tr><tr><td><code>message</code> <br><em>required</em></td><td><code>string</code></td><td>Human readable error, potentially with more details,</td></tr></tbody></table></figure><pre><code class=\"language-application-json\">{\n \"status\": 400,\n \"code\": \"NOTE_IS_PROTECTED\",\n \"message\": \"Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI\"\n}</code></pre></div></section></div><h3>Get an attachment</h3><p><code>GET /attachments/{attachmentId}</code> · <code>getAttachmentById</code></p><p>Returns an attachment identified by its ID</p><p><strong>Authorization</strong>: <code>EtapiTokenAuth</code> or <code>EtapiBasicAuth</code></p><p><strong>Parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>In</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>attachmentId</code> <br><em>required</em></td><td>path</td><td><code>EntityId</code></td><td></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 response</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Attachment</code></li></ul><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>attachmentId</code></td><td><code>EntityId</code></td><td></td></tr><tr><td><code>ownerId</code></td><td><code>EntityId</code></td><td>identifies the owner of the attachment, is either noteId or revisionId</td></tr><tr><td><code>role</code></td><td><code>string</code></td><td></td></tr><tr><td><code>mime</code></td><td><code>string</code></td><td></td></tr><tr><td><code>title</code></td><td><code>string</code></td><td>Title of the attachment. Returned as \"[protected]\" for protected attachments, since ETAPI cannot open a protected session.</td></tr><tr><td><code>position</code></td><td><code>integer (int32)</code></td><td></td></tr><tr><td><code>blobId</code></td><td><code>string</code></td><td>ID of the blob object which effectively serves as a content hash</td></tr><tr><td><code>dateModified</code></td><td><code>LocalDateTime</code></td><td></td></tr><tr><td><code>utcDateModified</code></td><td><code>UtcDateTime</code></td><td></td></tr><tr><td><code>utcDateScheduledForErasureSince</code></td><td><code>UtcDateTime</code></td><td></td></tr><tr><td><code>contentLength</code></td><td><code>integer (int32)</code></td><td></td></tr></tbody></table></figure><pre><code class=\"language-application-json\">{\n \"attachmentId\": \"evnnmvHTCgIn\",\n \"ownerId\": \"evnnmvHTCgIn\",\n \"role\": \"string\",\n \"mime\": \"string\",\n \"title\": \"string\",\n \"position\": 0,\n \"blobId\": \"string\",\n \"dateModified\": \"2021-12-31 20:18:11.930+0100\",\n \"utcDateModified\": \"2021-12-31 19:18:11.930Z\",\n \"utcDateScheduledForErasureSince\": \"2021-12-31 19:18:11.930Z\",\n \"contentLength\": 0\n}</code></pre></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">default: unexpected error</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Error</code></li></ul><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>status</code> <br><em>required</em></td><td><code>integer (int32)</code></td><td>HTTP status, identical to the one given in HTTP response</td></tr><tr><td><code>code</code> <br><em>required</em></td><td><code>string</code></td><td>stable string constant</td></tr><tr><td><code>message</code> <br><em>required</em></td><td><code>string</code></td><td>Human readable error, potentially with more details,</td></tr></tbody></table></figure><pre><code class=\"language-application-json\">{\n \"status\": 400,\n \"code\": \"NOTE_IS_PROTECTED\",\n \"message\": \"Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI\"\n}</code></pre></div></section></div><h3>Delete an attachment</h3><p><code>DELETE /attachments/{attachmentId}</code> · <code>deleteAttachmentById</code></p><p>deletes an attachment based on the attachmentId supplied.</p><p><strong>Authorization</strong>: <code>EtapiTokenAuth</code> or <code>EtapiBasicAuth</code></p><p><strong>Parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>In</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>attachmentId</code> <br><em>required</em></td><td>path</td><td><code>EntityId</code></td><td></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><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">default: unexpected error</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Error</code></li></ul><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>status</code> <br><em>required</em></td><td><code>integer (int32)</code></td><td>HTTP status, identical to the one given in HTTP response</td></tr><tr><td><code>code</code> <br><em>required</em></td><td><code>string</code></td><td>stable string constant</td></tr><tr><td><code>message</code> <br><em>required</em></td><td><code>string</code></td><td>Human readable error, potentially with more details,</td></tr></tbody></table></figure><pre><code class=\"language-application-json\">{\n \"status\": 400,\n \"code\": \"NOTE_IS_PROTECTED\",\n \"message\": \"Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI\"\n}</code></pre></div></section></div><h3>Update an attachment</h3><p><code>PATCH /attachments/{attachmentId}</code> · <code>patchAttachmentById</code></p><p>patch an attachment identified by the attachmentId with changes in the body. Only role, mime, title, and position are patchable.</p><p><strong>Authorization</strong>: <code>EtapiTokenAuth</code> or <code>EtapiBasicAuth</code></p><p><strong>Parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>In</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>attachmentId</code> <br><em>required</em></td><td>path</td><td><code>EntityId</code></td><td></td></tr></tbody></table></figure><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>Attachment</code></li></ul><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>attachmentId</code></td><td><code>EntityId</code></td><td></td></tr><tr><td><code>ownerId</code></td><td><code>EntityId</code></td><td>identifies the owner of the attachment, is either noteId or revisionId</td></tr><tr><td><code>role</code></td><td><code>string</code></td><td></td></tr><tr><td><code>mime</code></td><td><code>string</code></td><td></td></tr><tr><td><code>title</code></td><td><code>string</code></td><td>Title of the attachment. Returned as \"[protected]\" for protected attachments, since ETAPI cannot open a protected session.</td></tr><tr><td><code>position</code></td><td><code>integer (int32)</code></td><td></td></tr><tr><td><code>blobId</code></td><td><code>string</code></td><td>ID of the blob object which effectively serves as a content hash</td></tr><tr><td><code>dateModified</code></td><td><code>LocalDateTime</code></td><td></td></tr><tr><td><code>utcDateModified</code></td><td><code>UtcDateTime</code></td><td></td></tr><tr><td><code>utcDateScheduledForErasureSince</code></td><td><code>UtcDateTime</code></td><td></td></tr><tr><td><code>contentLength</code></td><td><code>integer (int32)</code></td><td></td></tr></tbody></table></figure><pre><code class=\"language-application-json\">{\n \"ownerId\": \"evnnmvHTCgIn\",\n \"role\": \"string\",\n \"mime\": \"string\",\n \"title\": \"string\",\n \"position\": 0,\n \"blobId\": \"string\",\n \"contentLength\": 0\n}</code></pre><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: attribute updated</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Attachment</code></li></ul><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>attachmentId</code></td><td><code>EntityId</code></td><td></td></tr><tr><td><code>ownerId</code></td><td><code>EntityId</code></td><td>identifies the owner of the attachment, is either noteId or revisionId</td></tr><tr><td><code>role</code></td><td><code>string</code></td><td></td></tr><tr><td><code>mime</code></td><td><code>string</code></td><td></td></tr><tr><td><code>title</code></td><td><code>string</code></td><td>Title of the attachment. Returned as \"[protected]\" for protected attachments, since ETAPI cannot open a protected session.</td></tr><tr><td><code>position</code></td><td><code>integer (int32)</code></td><td></td></tr><tr><td><code>blobId</code></td><td><code>string</code></td><td>ID of the blob object which effectively serves as a content hash</td></tr><tr><td><code>dateModified</code></td><td><code>LocalDateTime</code></td><td></td></tr><tr><td><code>utcDateModified</code></td><td><code>UtcDateTime</code></td><td></td></tr><tr><td><code>utcDateScheduledForErasureSince</code></td><td><code>UtcDateTime</code></td><td></td></tr><tr><td><code>contentLength</code></td><td><code>integer (int32)</code></td><td></td></tr></tbody></table></figure><pre><code class=\"language-application-json\">{\n \"attachmentId\": \"evnnmvHTCgIn\",\n \"ownerId\": \"evnnmvHTCgIn\",\n \"role\": \"string\",\n \"mime\": \"string\",\n \"title\": \"string\",\n \"position\": 0,\n \"blobId\": \"string\",\n \"dateModified\": \"2021-12-31 20:18:11.930+0100\",\n \"utcDateModified\": \"2021-12-31 19:18:11.930Z\",\n \"utcDateScheduledForErasureSince\": \"2021-12-31 19:18:11.930Z\",\n \"contentLength\": 0\n}</code></pre></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">default: unexpected error</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Error</code></li></ul><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>status</code> <br><em>required</em></td><td><code>integer (int32)</code></td><td>HTTP status, identical to the one given in HTTP response</td></tr><tr><td><code>code</code> <br><em>required</em></td><td><code>string</code></td><td>stable string constant</td></tr><tr><td><code>message</code> <br><em>required</em></td><td><code>string</code></td><td>Human readable error, potentially with more details,</td></tr></tbody></table></figure><pre><code class=\"language-application-json\">{\n \"status\": 400,\n \"code\": \"NOTE_IS_PROTECTED\",\n \"message\": \"Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI\"\n}</code></pre></div></section></div><h3>Get the content of an attachment</h3><p><code>GET /attachments/{attachmentId}/content</code> · <code>getAttachmentContent</code></p><p>Returns attachment content identified by its ID. The response carries the attachment's MIME type as its <code>Content-Type</code>.</p><p><strong>Authorization</strong>: <code>EtapiTokenAuth</code> or <code>EtapiBasicAuth</code></p><p><strong>Parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>In</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>attachmentId</code> <br><em>required</em></td><td>path</td><td><code>EntityId</code></td><td></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>*/*</code>: <code>string (binary)</code></li></ul></div></section></div><h3>Replace the content of an attachment</h3><p><code>PUT /attachments/{attachmentId}/content</code> · <code>putAttachmentContentById</code></p><p>Updates attachment content identified by its ID</p><p><strong>Authorization</strong>: <code>EtapiTokenAuth</code> or <code>EtapiBasicAuth</code></p><p><strong>Parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>In</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>attachmentId</code> <br><em>required</em></td><td>path</td><td><code>EntityId</code></td><td></td></tr></tbody></table></figure><p><strong>Request body</strong> (required)</p><p>New content of the attachment. Send text as <code>text/plain</code> and binary data (such as an image or a PDF) as <code>application/octet-stream</code>; other content types are not accepted.</p><ul><li><code>text/plain</code>: <code>string</code></li><li><code>application/octet-stream</code>: <code>string (binary)</code></li></ul><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: attachment content updated</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h2>Revisions</h2><p>Snapshots of a note's content.</p><h3>Create a revision</h3><p><code>POST /notes/{noteId}/revision</code> · <code>createRevision</code></p><p>Create a note revision for the given note</p><p><strong>Authorization</strong>: <code>EtapiTokenAuth</code> or <code>EtapiBasicAuth</code></p><p><strong>Parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>In</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td>path</td><td><code>EntityId</code></td><td></td></tr><tr><td><code>format</code></td><td>query</td><td><code>any</code></td><td>One of <code>html</code>, <code>markdown</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 has been created</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">default: unexpected error</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Error</code></li></ul><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>status</code> <br><em>required</em></td><td><code>integer (int32)</code></td><td>HTTP status, identical to the one given in HTTP response</td></tr><tr><td><code>code</code> <br><em>required</em></td><td><code>string</code></td><td>stable string constant</td></tr><tr><td><code>message</code> <br><em>required</em></td><td><code>string</code></td><td>Human readable error, potentially with more details,</td></tr></tbody></table></figure><pre><code class=\"language-application-json\">{\n \"status\": 400,\n \"code\": \"NOTE_IS_PROTECTED\",\n \"message\": \"Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI\"\n}</code></pre></div></section></div><h3>List the revisions of a note</h3><p><code>GET /notes/{noteId}/revisions</code> · <code>getNoteRevisions</code></p><p>Returns the revisions of a note identified by its ID. Protected revisions are omitted, since they cannot be read through ETAPI individually either.</p><p><strong>Authorization</strong>: <code>EtapiTokenAuth</code> or <code>EtapiBasicAuth</code></p><p><strong>Parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>In</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td>path</td><td><code>EntityId</code></td><td></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: list of revisions</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>array of Revision</code></li></ul><pre><code class=\"language-application-json\">[\n {\n \"revisionId\": \"evnnmvHTCgIn\",\n \"noteId\": \"evnnmvHTCgIn\",\n \"type\": \"text\",\n \"mime\": \"string\",\n \"isProtected\": true,\n \"title\": \"string\",\n \"blobId\": \"string\",\n \"dateLastEdited\": \"2021-12-31 20:18:11.930+0100\",\n \"dateCreated\": \"2021-12-31 20:18:11.930+0100\",\n \"utcDateLastEdited\": \"2021-12-31 19:18:11.930Z\",\n \"utcDateCreated\": \"2021-12-31 19:18:11.930Z\",\n \"utcDateModified\": \"2021-12-31 19:18:11.930Z\",\n \"contentLength\": 0\n }\n]</code></pre></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">default: unexpected error</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Error</code></li></ul><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>status</code> <br><em>required</em></td><td><code>integer (int32)</code></td><td>HTTP status, identical to the one given in HTTP response</td></tr><tr><td><code>code</code> <br><em>required</em></td><td><code>string</code></td><td>stable string constant</td></tr><tr><td><code>message</code> <br><em>required</em></td><td><code>string</code></td><td>Human readable error, potentially with more details,</td></tr></tbody></table></figure><pre><code class=\"language-application-json\">{\n \"status\": 400,\n \"code\": \"NOTE_IS_PROTECTED\",\n \"message\": \"Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI\"\n}</code></pre></div></section></div><h3>Get a revision</h3><p><code>GET /revisions/{revisionId}</code> · <code>getRevisionById</code></p><p>Returns a revision identified by its ID</p><p><strong>Authorization</strong>: <code>EtapiTokenAuth</code> or <code>EtapiBasicAuth</code></p><p><strong>Parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>In</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>revisionId</code> <br><em>required</em></td><td>path</td><td><code>EntityId</code></td><td></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 response</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Revision</code></li></ul><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>revisionId</code></td><td><code>EntityId</code></td><td></td></tr><tr><td><code>noteId</code></td><td><code>EntityId</code></td><td></td></tr><tr><td><code>type</code></td><td><code>string</code></td><td>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>webView</code>, <code>shortcut</code>, <code>doc</code>, <code>contentWidget</code>, <code>launcher</code>.</td></tr><tr><td><code>mime</code></td><td><code>string</code></td><td></td></tr><tr><td><code>isProtected</code></td><td><code>boolean</code></td><td></td></tr><tr><td><code>title</code></td><td><code>string</code></td><td></td></tr><tr><td><code>blobId</code></td><td><code>string</code></td><td>ID of the blob object which effectively serves as a content hash</td></tr><tr><td><code>dateLastEdited</code></td><td><code>LocalDateTime</code></td><td></td></tr><tr><td><code>dateCreated</code></td><td><code>LocalDateTime</code></td><td></td></tr><tr><td><code>utcDateLastEdited</code></td><td><code>UtcDateTime</code></td><td></td></tr><tr><td><code>utcDateCreated</code></td><td><code>UtcDateTime</code></td><td></td></tr><tr><td><code>utcDateModified</code></td><td><code>UtcDateTime</code></td><td></td></tr><tr><td><code>contentLength</code></td><td><code>integer (int32)</code></td><td></td></tr></tbody></table></figure><pre><code class=\"language-application-json\">{\n \"revisionId\": \"evnnmvHTCgIn\",\n \"noteId\": \"evnnmvHTCgIn\",\n \"type\": \"text\",\n \"mime\": \"string\",\n \"isProtected\": true,\n \"title\": \"string\",\n \"blobId\": \"string\",\n \"dateLastEdited\": \"2021-12-31 20:18:11.930+0100\",\n \"dateCreated\": \"2021-12-31 20:18:11.930+0100\",\n \"utcDateLastEdited\": \"2021-12-31 19:18:11.930Z\",\n \"utcDateCreated\": \"2021-12-31 19:18:11.930Z\",\n \"utcDateModified\": \"2021-12-31 19:18:11.930Z\",\n \"contentLength\": 0\n}</code></pre></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">default: unexpected error</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Error</code></li></ul><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>status</code> <br><em>required</em></td><td><code>integer (int32)</code></td><td>HTTP status, identical to the one given in HTTP response</td></tr><tr><td><code>code</code> <br><em>required</em></td><td><code>string</code></td><td>stable string constant</td></tr><tr><td><code>message</code> <br><em>required</em></td><td><code>string</code></td><td>Human readable error, potentially with more details,</td></tr></tbody></table></figure><pre><code class=\"language-application-json\">{\n \"status\": 400,\n \"code\": \"NOTE_IS_PROTECTED\",\n \"message\": \"Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI\"\n}</code></pre></div></section></div><h3>Get the content of a revision</h3><p><code>GET /revisions/{revisionId}/content</code> · <code>getRevisionContent</code></p><p>Returns revision content identified by its ID</p><p><strong>Authorization</strong>: <code>EtapiTokenAuth</code> or <code>EtapiBasicAuth</code></p><p><strong>Parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>In</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>revisionId</code> <br><em>required</em></td><td>path</td><td><code>EntityId</code></td><td></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 response</p><div class=\"trilium-tab-panel\"><ul><li><code>text/html</code>: <code>string</code></li></ul></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">default: unexpected error</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Error</code></li></ul><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>status</code> <br><em>required</em></td><td><code>integer (int32)</code></td><td>HTTP status, identical to the one given in HTTP response</td></tr><tr><td><code>code</code> <br><em>required</em></td><td><code>string</code></td><td>stable string constant</td></tr><tr><td><code>message</code> <br><em>required</em></td><td><code>string</code></td><td>Human readable error, potentially with more details,</td></tr></tbody></table></figure><pre><code class=\"language-application-json\">{\n \"status\": 400,\n \"code\": \"NOTE_IS_PROTECTED\",\n \"message\": \"Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI\"\n}</code></pre></div></section></div><h2>Calendar</h2><p>Day, week, month and year notes of the journal, and the inbox note.</p><h3>Get the inbox note</h3><p><code>GET /inbox/{date}</code> · <code>getInboxNote</code></p><p>returns an \"inbox\" note, into which note can be created. Date will be used depending on whether the inbox is a fixed note (identified with #inbox label) or a day note in a journal. A database with neither returns the root note, and ignores the date, rather than creating a journal to hold a day note.</p><p><strong>Authorization</strong>: <code>EtapiTokenAuth</code> or <code>EtapiBasicAuth</code></p><p><strong>Parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>In</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>date</code> <br><em>required</em></td><td>path</td><td><code>string (date)</code></td><td></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; charset=utf-8</code>: <code>Note</code></li></ul><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code></td><td><code>EntityId</code></td><td></td></tr><tr><td><code>title</code></td><td><code>string</code></td><td>Title of the note. Returned as \"[protected]\" for protected notes, since ETAPI cannot open a protected session.</td></tr><tr><td><code>type</code></td><td><code>string</code></td><td>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>webView</code>, <code>shortcut</code>, <code>doc</code>, <code>contentWidget</code>, <code>launcher</code>.</td></tr><tr><td><code>mime</code></td><td><code>string</code></td><td></td></tr><tr><td><code>isProtected</code></td><td><code>boolean</code></td><td></td></tr><tr><td><code>blobId</code></td><td><code>string</code></td><td>ID of the blob object which effectively serves as a content hash</td></tr><tr><td><code>attributes</code></td><td><code>AttributeList</code></td><td></td></tr><tr><td><code>parentNoteIds</code></td><td><code>EntityIdList</code></td><td></td></tr><tr><td><code>childNoteIds</code></td><td><code>EntityIdList</code></td><td></td></tr><tr><td><code>parentBranchIds</code></td><td><code>EntityIdList</code></td><td></td></tr><tr><td><code>childBranchIds</code></td><td><code>EntityIdList</code></td><td></td></tr><tr><td><code>dateCreated</code></td><td><code>LocalDateTime</code></td><td></td></tr><tr><td><code>dateModified</code></td><td><code>LocalDateTime</code></td><td></td></tr><tr><td><code>utcDateCreated</code></td><td><code>UtcDateTime</code></td><td></td></tr><tr><td><code>utcDateModified</code></td><td><code>UtcDateTime</code></td><td>Writable through PATCH, e.g. to restore a migrated note's date after its content was rewritten. The local dateModified is derived from it.</td></tr></tbody></table></figure><pre><code class=\"language-application-json\">{\n \"noteId\": \"evnnmvHTCgIn\",\n \"title\": \"string\",\n \"type\": \"text\",\n \"mime\": \"string\",\n \"isProtected\": true,\n \"blobId\": \"string\",\n \"attributes\": [\n {\n \"attributeId\": \"evnnmvHTCgIn\",\n \"noteId\": \"evnnmvHTCgIn\",\n \"type\": \"label\",\n \"name\": \"shareCss\",\n \"value\": \"string\",\n \"position\": 0,\n \"isInheritable\": true,\n \"utcDateModified\": \"2021-12-31 19:18:11.930Z\"\n }\n ],\n \"parentNoteIds\": [\n \"evnnmvHTCgIn\"\n ],\n \"childNoteIds\": [\n \"evnnmvHTCgIn\"\n ],\n \"parentBranchIds\": [\n \"evnnmvHTCgIn\"\n ],\n \"childBranchIds\": [\n \"evnnmvHTCgIn\"\n ],\n \"dateCreated\": \"2021-12-31 20:18:11.930+0100\",\n \"dateModified\": \"2021-12-31 20:18:11.930+0100\",\n \"utcDateCreated\": \"2021-12-31 19:18:11.930Z\",\n \"utcDateModified\": \"2021-12-31 19:18:11.930Z\"\n}</code></pre></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">default: unexpected error</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Error</code></li></ul><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>status</code> <br><em>required</em></td><td><code>integer (int32)</code></td><td>HTTP status, identical to the one given in HTTP response</td></tr><tr><td><code>code</code> <br><em>required</em></td><td><code>string</code></td><td>stable string constant</td></tr><tr><td><code>message</code> <br><em>required</em></td><td><code>string</code></td><td>Human readable error, potentially with more details,</td></tr></tbody></table></figure><pre><code class=\"language-application-json\">{\n \"status\": 400,\n \"code\": \"NOTE_IS_PROTECTED\",\n \"message\": \"Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI\"\n}</code></pre></div></section></div><h3>Get a day note</h3><p><code>GET /calendar/days/{date}</code> · <code>getDayNote</code></p><p>returns a day note for a given date. Gets created if doesn't exist.</p><p><strong>Authorization</strong>: <code>EtapiTokenAuth</code> or <code>EtapiBasicAuth</code></p><p><strong>Parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>In</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>date</code> <br><em>required</em></td><td>path</td><td><code>string (date)</code></td><td></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; charset=utf-8</code>: <code>Note</code></li></ul><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code></td><td><code>EntityId</code></td><td></td></tr><tr><td><code>title</code></td><td><code>string</code></td><td>Title of the note. Returned as \"[protected]\" for protected notes, since ETAPI cannot open a protected session.</td></tr><tr><td><code>type</code></td><td><code>string</code></td><td>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>webView</code>, <code>shortcut</code>, <code>doc</code>, <code>contentWidget</code>, <code>launcher</code>.</td></tr><tr><td><code>mime</code></td><td><code>string</code></td><td></td></tr><tr><td><code>isProtected</code></td><td><code>boolean</code></td><td></td></tr><tr><td><code>blobId</code></td><td><code>string</code></td><td>ID of the blob object which effectively serves as a content hash</td></tr><tr><td><code>attributes</code></td><td><code>AttributeList</code></td><td></td></tr><tr><td><code>parentNoteIds</code></td><td><code>EntityIdList</code></td><td></td></tr><tr><td><code>childNoteIds</code></td><td><code>EntityIdList</code></td><td></td></tr><tr><td><code>parentBranchIds</code></td><td><code>EntityIdList</code></td><td></td></tr><tr><td><code>childBranchIds</code></td><td><code>EntityIdList</code></td><td></td></tr><tr><td><code>dateCreated</code></td><td><code>LocalDateTime</code></td><td></td></tr><tr><td><code>dateModified</code></td><td><code>LocalDateTime</code></td><td></td></tr><tr><td><code>utcDateCreated</code></td><td><code>UtcDateTime</code></td><td></td></tr><tr><td><code>utcDateModified</code></td><td><code>UtcDateTime</code></td><td>Writable through PATCH, e.g. to restore a migrated note's date after its content was rewritten. The local dateModified is derived from it.</td></tr></tbody></table></figure><pre><code class=\"language-application-json\">{\n \"noteId\": \"evnnmvHTCgIn\",\n \"title\": \"string\",\n \"type\": \"text\",\n \"mime\": \"string\",\n \"isProtected\": true,\n \"blobId\": \"string\",\n \"attributes\": [\n {\n \"attributeId\": \"evnnmvHTCgIn\",\n \"noteId\": \"evnnmvHTCgIn\",\n \"type\": \"label\",\n \"name\": \"shareCss\",\n \"value\": \"string\",\n \"position\": 0,\n \"isInheritable\": true,\n \"utcDateModified\": \"2021-12-31 19:18:11.930Z\"\n }\n ],\n \"parentNoteIds\": [\n \"evnnmvHTCgIn\"\n ],\n \"childNoteIds\": [\n \"evnnmvHTCgIn\"\n ],\n \"parentBranchIds\": [\n \"evnnmvHTCgIn\"\n ],\n \"childBranchIds\": [\n \"evnnmvHTCgIn\"\n ],\n \"dateCreated\": \"2021-12-31 20:18:11.930+0100\",\n \"dateModified\": \"2021-12-31 20:18:11.930+0100\",\n \"utcDateCreated\": \"2021-12-31 19:18:11.930Z\",\n \"utcDateModified\": \"2021-12-31 19:18:11.930Z\"\n}</code></pre></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">default: unexpected error</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Error</code></li></ul><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>status</code> <br><em>required</em></td><td><code>integer (int32)</code></td><td>HTTP status, identical to the one given in HTTP response</td></tr><tr><td><code>code</code> <br><em>required</em></td><td><code>string</code></td><td>stable string constant</td></tr><tr><td><code>message</code> <br><em>required</em></td><td><code>string</code></td><td>Human readable error, potentially with more details,</td></tr></tbody></table></figure><pre><code class=\"language-application-json\">{\n \"status\": 400,\n \"code\": \"NOTE_IS_PROTECTED\",\n \"message\": \"Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI\"\n}</code></pre></div></section></div><h3>Get the day note starting the week</h3><p><code>GET /calendar/week-first-day/{date}</code> · <code>getWeekFirstDayNote</code></p><p>Returns the day note for the first day of the week containing the given date, honouring the configured first day of week. The note is created if it doesn't exist. This returns a day note, not a week note, so unlike /calendar/weeks/{week} it does not require the enableWeekNote label on the calendar root.</p><p><strong>Authorization</strong>: <code>EtapiTokenAuth</code> or <code>EtapiBasicAuth</code></p><p><strong>Parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>In</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>date</code> <br><em>required</em></td><td>path</td><td><code>string (date)</code></td><td>Any date within the week, in the format YYYY-MM-DD.</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 starting the week</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Note</code></li></ul><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code></td><td><code>EntityId</code></td><td></td></tr><tr><td><code>title</code></td><td><code>string</code></td><td>Title of the note. Returned as \"[protected]\" for protected notes, since ETAPI cannot open a protected session.</td></tr><tr><td><code>type</code></td><td><code>string</code></td><td>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>webView</code>, <code>shortcut</code>, <code>doc</code>, <code>contentWidget</code>, <code>launcher</code>.</td></tr><tr><td><code>mime</code></td><td><code>string</code></td><td></td></tr><tr><td><code>isProtected</code></td><td><code>boolean</code></td><td></td></tr><tr><td><code>blobId</code></td><td><code>string</code></td><td>ID of the blob object which effectively serves as a content hash</td></tr><tr><td><code>attributes</code></td><td><code>AttributeList</code></td><td></td></tr><tr><td><code>parentNoteIds</code></td><td><code>EntityIdList</code></td><td></td></tr><tr><td><code>childNoteIds</code></td><td><code>EntityIdList</code></td><td></td></tr><tr><td><code>parentBranchIds</code></td><td><code>EntityIdList</code></td><td></td></tr><tr><td><code>childBranchIds</code></td><td><code>EntityIdList</code></td><td></td></tr><tr><td><code>dateCreated</code></td><td><code>LocalDateTime</code></td><td></td></tr><tr><td><code>dateModified</code></td><td><code>LocalDateTime</code></td><td></td></tr><tr><td><code>utcDateCreated</code></td><td><code>UtcDateTime</code></td><td></td></tr><tr><td><code>utcDateModified</code></td><td><code>UtcDateTime</code></td><td>Writable through PATCH, e.g. to restore a migrated note's date after its content was rewritten. The local dateModified is derived from it.</td></tr></tbody></table></figure><pre><code class=\"language-application-json\">{\n \"noteId\": \"evnnmvHTCgIn\",\n \"title\": \"string\",\n \"type\": \"text\",\n \"mime\": \"string\",\n \"isProtected\": true,\n \"blobId\": \"string\",\n \"attributes\": [\n {\n \"attributeId\": \"evnnmvHTCgIn\",\n \"noteId\": \"evnnmvHTCgIn\",\n \"type\": \"label\",\n \"name\": \"shareCss\",\n \"value\": \"string\",\n \"position\": 0,\n \"isInheritable\": true,\n \"utcDateModified\": \"2021-12-31 19:18:11.930Z\"\n }\n ],\n \"parentNoteIds\": [\n \"evnnmvHTCgIn\"\n ],\n \"childNoteIds\": [\n \"evnnmvHTCgIn\"\n ],\n \"parentBranchIds\": [\n \"evnnmvHTCgIn\"\n ],\n \"childBranchIds\": [\n \"evnnmvHTCgIn\"\n ],\n \"dateCreated\": \"2021-12-31 20:18:11.930+0100\",\n \"dateModified\": \"2021-12-31 20:18:11.930+0100\",\n \"utcDateCreated\": \"2021-12-31 19:18:11.930Z\",\n \"utcDateModified\": \"2021-12-31 19:18:11.930Z\"\n}</code></pre></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">default: unexpected error</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Error</code></li></ul><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>status</code> <br><em>required</em></td><td><code>integer (int32)</code></td><td>HTTP status, identical to the one given in HTTP response</td></tr><tr><td><code>code</code> <br><em>required</em></td><td><code>string</code></td><td>stable string constant</td></tr><tr><td><code>message</code> <br><em>required</em></td><td><code>string</code></td><td>Human readable error, potentially with more details,</td></tr></tbody></table></figure><pre><code class=\"language-application-json\">{\n \"status\": 400,\n \"code\": \"NOTE_IS_PROTECTED\",\n \"message\": \"Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI\"\n}</code></pre></div></section></div><h3>Get a week note</h3><p><code>GET /calendar/weeks/{week}</code> · <code>getWeekNote</code></p><p>Returns a week note for a given ISO week (format YYYY-Www, e.g., 2025-W01). The note is created if it doesn't exist.</p><p><strong>Authorization</strong>: <code>EtapiTokenAuth</code> or <code>EtapiBasicAuth</code></p><p><strong>Parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>In</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>week</code> <br><em>required</em></td><td>path</td><td><code>string</code></td><td>The ISO 8601 week identifier (YYYY-Www).</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; charset=utf-8</code>: <code>Note</code></li></ul><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code></td><td><code>EntityId</code></td><td></td></tr><tr><td><code>title</code></td><td><code>string</code></td><td>Title of the note. Returned as \"[protected]\" for protected notes, since ETAPI cannot open a protected session.</td></tr><tr><td><code>type</code></td><td><code>string</code></td><td>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>webView</code>, <code>shortcut</code>, <code>doc</code>, <code>contentWidget</code>, <code>launcher</code>.</td></tr><tr><td><code>mime</code></td><td><code>string</code></td><td></td></tr><tr><td><code>isProtected</code></td><td><code>boolean</code></td><td></td></tr><tr><td><code>blobId</code></td><td><code>string</code></td><td>ID of the blob object which effectively serves as a content hash</td></tr><tr><td><code>attributes</code></td><td><code>AttributeList</code></td><td></td></tr><tr><td><code>parentNoteIds</code></td><td><code>EntityIdList</code></td><td></td></tr><tr><td><code>childNoteIds</code></td><td><code>EntityIdList</code></td><td></td></tr><tr><td><code>parentBranchIds</code></td><td><code>EntityIdList</code></td><td></td></tr><tr><td><code>childBranchIds</code></td><td><code>EntityIdList</code></td><td></td></tr><tr><td><code>dateCreated</code></td><td><code>LocalDateTime</code></td><td></td></tr><tr><td><code>dateModified</code></td><td><code>LocalDateTime</code></td><td></td></tr><tr><td><code>utcDateCreated</code></td><td><code>UtcDateTime</code></td><td></td></tr><tr><td><code>utcDateModified</code></td><td><code>UtcDateTime</code></td><td>Writable through PATCH, e.g. to restore a migrated note's date after its content was rewritten. The local dateModified is derived from it.</td></tr></tbody></table></figure><pre><code class=\"language-application-json\">{\n \"noteId\": \"evnnmvHTCgIn\",\n \"title\": \"string\",\n \"type\": \"text\",\n \"mime\": \"string\",\n \"isProtected\": true,\n \"blobId\": \"string\",\n \"attributes\": [\n {\n \"attributeId\": \"evnnmvHTCgIn\",\n \"noteId\": \"evnnmvHTCgIn\",\n \"type\": \"label\",\n \"name\": \"shareCss\",\n \"value\": \"string\",\n \"position\": 0,\n \"isInheritable\": true,\n \"utcDateModified\": \"2021-12-31 19:18:11.930Z\"\n }\n ],\n \"parentNoteIds\": [\n \"evnnmvHTCgIn\"\n ],\n \"childNoteIds\": [\n \"evnnmvHTCgIn\"\n ],\n \"parentBranchIds\": [\n \"evnnmvHTCgIn\"\n ],\n \"childBranchIds\": [\n \"evnnmvHTCgIn\"\n ],\n \"dateCreated\": \"2021-12-31 20:18:11.930+0100\",\n \"dateModified\": \"2021-12-31 20:18:11.930+0100\",\n \"utcDateCreated\": \"2021-12-31 19:18:11.930Z\",\n \"utcDateModified\": \"2021-12-31 19:18:11.930Z\"\n}</code></pre></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">default: unexpected error</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Error</code></li></ul><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>status</code> <br><em>required</em></td><td><code>integer (int32)</code></td><td>HTTP status, identical to the one given in HTTP response</td></tr><tr><td><code>code</code> <br><em>required</em></td><td><code>string</code></td><td>stable string constant</td></tr><tr><td><code>message</code> <br><em>required</em></td><td><code>string</code></td><td>Human readable error, potentially with more details,</td></tr></tbody></table></figure><pre><code class=\"language-application-json\">{\n \"status\": 400,\n \"code\": \"NOTE_IS_PROTECTED\",\n \"message\": \"Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI\"\n}</code></pre></div></section></div><h3>Get a month note</h3><p><code>GET /calendar/months/{month}</code> · <code>getMonthNote</code></p><p>Returns a month note for a given month (format YYYY-MM, e.g., 2022-02). The note is created if it doesn't exist.</p><p><strong>Authorization</strong>: <code>EtapiTokenAuth</code> or <code>EtapiBasicAuth</code></p><p><strong>Parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>In</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>month</code> <br><em>required</em></td><td>path</td><td><code>string</code></td><td></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; charset=utf-8</code>: <code>Note</code></li></ul><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code></td><td><code>EntityId</code></td><td></td></tr><tr><td><code>title</code></td><td><code>string</code></td><td>Title of the note. Returned as \"[protected]\" for protected notes, since ETAPI cannot open a protected session.</td></tr><tr><td><code>type</code></td><td><code>string</code></td><td>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>webView</code>, <code>shortcut</code>, <code>doc</code>, <code>contentWidget</code>, <code>launcher</code>.</td></tr><tr><td><code>mime</code></td><td><code>string</code></td><td></td></tr><tr><td><code>isProtected</code></td><td><code>boolean</code></td><td></td></tr><tr><td><code>blobId</code></td><td><code>string</code></td><td>ID of the blob object which effectively serves as a content hash</td></tr><tr><td><code>attributes</code></td><td><code>AttributeList</code></td><td></td></tr><tr><td><code>parentNoteIds</code></td><td><code>EntityIdList</code></td><td></td></tr><tr><td><code>childNoteIds</code></td><td><code>EntityIdList</code></td><td></td></tr><tr><td><code>parentBranchIds</code></td><td><code>EntityIdList</code></td><td></td></tr><tr><td><code>childBranchIds</code></td><td><code>EntityIdList</code></td><td></td></tr><tr><td><code>dateCreated</code></td><td><code>LocalDateTime</code></td><td></td></tr><tr><td><code>dateModified</code></td><td><code>LocalDateTime</code></td><td></td></tr><tr><td><code>utcDateCreated</code></td><td><code>UtcDateTime</code></td><td></td></tr><tr><td><code>utcDateModified</code></td><td><code>UtcDateTime</code></td><td>Writable through PATCH, e.g. to restore a migrated note's date after its content was rewritten. The local dateModified is derived from it.</td></tr></tbody></table></figure><pre><code class=\"language-application-json\">{\n \"noteId\": \"evnnmvHTCgIn\",\n \"title\": \"string\",\n \"type\": \"text\",\n \"mime\": \"string\",\n \"isProtected\": true,\n \"blobId\": \"string\",\n \"attributes\": [\n {\n \"attributeId\": \"evnnmvHTCgIn\",\n \"noteId\": \"evnnmvHTCgIn\",\n \"type\": \"label\",\n \"name\": \"shareCss\",\n \"value\": \"string\",\n \"position\": 0,\n \"isInheritable\": true,\n \"utcDateModified\": \"2021-12-31 19:18:11.930Z\"\n }\n ],\n \"parentNoteIds\": [\n \"evnnmvHTCgIn\"\n ],\n \"childNoteIds\": [\n \"evnnmvHTCgIn\"\n ],\n \"parentBranchIds\": [\n \"evnnmvHTCgIn\"\n ],\n \"childBranchIds\": [\n \"evnnmvHTCgIn\"\n ],\n \"dateCreated\": \"2021-12-31 20:18:11.930+0100\",\n \"dateModified\": \"2021-12-31 20:18:11.930+0100\",\n \"utcDateCreated\": \"2021-12-31 19:18:11.930Z\",\n \"utcDateModified\": \"2021-12-31 19:18:11.930Z\"\n}</code></pre></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">default: unexpected error</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Error</code></li></ul><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>status</code> <br><em>required</em></td><td><code>integer (int32)</code></td><td>HTTP status, identical to the one given in HTTP response</td></tr><tr><td><code>code</code> <br><em>required</em></td><td><code>string</code></td><td>stable string constant</td></tr><tr><td><code>message</code> <br><em>required</em></td><td><code>string</code></td><td>Human readable error, potentially with more details,</td></tr></tbody></table></figure><pre><code class=\"language-application-json\">{\n \"status\": 400,\n \"code\": \"NOTE_IS_PROTECTED\",\n \"message\": \"Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI\"\n}</code></pre></div></section></div><h3>Get a year note</h3><p><code>GET /calendar/years/{year}</code> · <code>getYearNote</code></p><p>Returns a year note for a given year (format YYYY, e.g., 2022). The note is created if it doesn't exist.</p><p><strong>Authorization</strong>: <code>EtapiTokenAuth</code> or <code>EtapiBasicAuth</code></p><p><strong>Parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>In</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>year</code> <br><em>required</em></td><td>path</td><td><code>string</code></td><td></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; charset=utf-8</code>: <code>Note</code></li></ul><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code></td><td><code>EntityId</code></td><td></td></tr><tr><td><code>title</code></td><td><code>string</code></td><td>Title of the note. Returned as \"[protected]\" for protected notes, since ETAPI cannot open a protected session.</td></tr><tr><td><code>type</code></td><td><code>string</code></td><td>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>webView</code>, <code>shortcut</code>, <code>doc</code>, <code>contentWidget</code>, <code>launcher</code>.</td></tr><tr><td><code>mime</code></td><td><code>string</code></td><td></td></tr><tr><td><code>isProtected</code></td><td><code>boolean</code></td><td></td></tr><tr><td><code>blobId</code></td><td><code>string</code></td><td>ID of the blob object which effectively serves as a content hash</td></tr><tr><td><code>attributes</code></td><td><code>AttributeList</code></td><td></td></tr><tr><td><code>parentNoteIds</code></td><td><code>EntityIdList</code></td><td></td></tr><tr><td><code>childNoteIds</code></td><td><code>EntityIdList</code></td><td></td></tr><tr><td><code>parentBranchIds</code></td><td><code>EntityIdList</code></td><td></td></tr><tr><td><code>childBranchIds</code></td><td><code>EntityIdList</code></td><td></td></tr><tr><td><code>dateCreated</code></td><td><code>LocalDateTime</code></td><td></td></tr><tr><td><code>dateModified</code></td><td><code>LocalDateTime</code></td><td></td></tr><tr><td><code>utcDateCreated</code></td><td><code>UtcDateTime</code></td><td></td></tr><tr><td><code>utcDateModified</code></td><td><code>UtcDateTime</code></td><td>Writable through PATCH, e.g. to restore a migrated note's date after its content was rewritten. The local dateModified is derived from it.</td></tr></tbody></table></figure><pre><code class=\"language-application-json\">{\n \"noteId\": \"evnnmvHTCgIn\",\n \"title\": \"string\",\n \"type\": \"text\",\n \"mime\": \"string\",\n \"isProtected\": true,\n \"blobId\": \"string\",\n \"attributes\": [\n {\n \"attributeId\": \"evnnmvHTCgIn\",\n \"noteId\": \"evnnmvHTCgIn\",\n \"type\": \"label\",\n \"name\": \"shareCss\",\n \"value\": \"string\",\n \"position\": 0,\n \"isInheritable\": true,\n \"utcDateModified\": \"2021-12-31 19:18:11.930Z\"\n }\n ],\n \"parentNoteIds\": [\n \"evnnmvHTCgIn\"\n ],\n \"childNoteIds\": [\n \"evnnmvHTCgIn\"\n ],\n \"parentBranchIds\": [\n \"evnnmvHTCgIn\"\n ],\n \"childBranchIds\": [\n \"evnnmvHTCgIn\"\n ],\n \"dateCreated\": \"2021-12-31 20:18:11.930+0100\",\n \"dateModified\": \"2021-12-31 20:18:11.930+0100\",\n \"utcDateCreated\": \"2021-12-31 19:18:11.930Z\",\n \"utcDateModified\": \"2021-12-31 19:18:11.930Z\"\n}</code></pre></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">default: unexpected error</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Error</code></li></ul><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>status</code> <br><em>required</em></td><td><code>integer (int32)</code></td><td>HTTP status, identical to the one given in HTTP response</td></tr><tr><td><code>code</code> <br><em>required</em></td><td><code>string</code></td><td>stable string constant</td></tr><tr><td><code>message</code> <br><em>required</em></td><td><code>string</code></td><td>Human readable error, potentially with more details,</td></tr></tbody></table></figure><pre><code class=\"language-application-json\">{\n \"status\": 400,\n \"code\": \"NOTE_IS_PROTECTED\",\n \"message\": \"Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI\"\n}</code></pre></div></section></div><h2>Tokens</h2><p>Obtaining and revoking ETAPI tokens with the password.</p><h3>Log in</h3><p><code>POST /auth/login</code> · <code>login</code></p><p>get an ETAPI token based on password for further use with ETAPI. Too many requests from one IP address within a short time, such as failed logins, block that address for a while.</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><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>password</code></td><td><code>string</code></td><td>user's password used to e.g. login to Trilium server and/or protect notes</td></tr></tbody></table></figure><pre><code class=\"language-application-json\">{\n \"password\": \"string\"\n}</code></pre><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">201: auth token</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>object</code></li></ul><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>authToken</code></td><td><code>string</code></td><td></td></tr></tbody></table></figure><pre><code class=\"language-application-json\">{\n \"authToken\": \"Bc4bFn0Ffiok_4NpbVCDnFz7B2WU+pdhW8B5Ne3DiR5wXrEyqdjgRIsk=\"\n}</code></pre></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">429: too many requests</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">default: unexpected error</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Error</code></li></ul><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>status</code> <br><em>required</em></td><td><code>integer (int32)</code></td><td>HTTP status, identical to the one given in HTTP response</td></tr><tr><td><code>code</code> <br><em>required</em></td><td><code>string</code></td><td>stable string constant</td></tr><tr><td><code>message</code> <br><em>required</em></td><td><code>string</code></td><td>Human readable error, potentially with more details,</td></tr></tbody></table></figure><pre><code class=\"language-application-json\">{\n \"status\": 400,\n \"code\": \"NOTE_IS_PROTECTED\",\n \"message\": \"Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI\"\n}</code></pre></div></section></div><h3>Log out</h3><p><code>POST /auth/logout</code> · <code>logout</code></p><p>logout (delete/deactivate) an ETAPI token</p><p><strong>Authorization</strong>: <code>EtapiTokenAuth</code> or <code>EtapiBasicAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: logout successful</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">default: unexpected error</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Error</code></li></ul><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>status</code> <br><em>required</em></td><td><code>integer (int32)</code></td><td>HTTP status, identical to the one given in HTTP response</td></tr><tr><td><code>code</code> <br><em>required</em></td><td><code>string</code></td><td>stable string constant</td></tr><tr><td><code>message</code> <br><em>required</em></td><td><code>string</code></td><td>Human readable error, potentially with more details,</td></tr></tbody></table></figure><pre><code class=\"language-application-json\">{\n \"status\": 400,\n \"code\": \"NOTE_IS_PROTECTED\",\n \"message\": \"Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI\"\n}</code></pre></div></section></div><h2>Application</h2><p>Information about the instance, backups and metrics.</p><h3>Get application info</h3><p><code>GET /app-info</code> · <code>getAppInfo</code></p><p>returns information about the running Trilium instance</p><p><strong>Authorization</strong>: <code>EtapiTokenAuth</code> or <code>EtapiBasicAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: app info</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>AppInfo</code></li></ul><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>appVersion</code></td><td><code>string</code></td><td>Trilium version</td></tr><tr><td><code>dbVersion</code></td><td><code>integer (int32)</code></td><td>DB version</td></tr><tr><td><code>syncVersion</code></td><td><code>integer (int32)</code></td><td>Sync protocol version</td></tr><tr><td><code>buildDate</code></td><td><code>string (date-time)</code></td><td>build date</td></tr><tr><td><code>buildRevision</code></td><td><code>string</code></td><td>git build revision</td></tr><tr><td><code>dataDirectory</code></td><td><code>string</code></td><td>data directory where Trilium stores files</td></tr><tr><td><code>clipperProtocolVersion</code></td><td><code>string</code></td><td>version of the supported Trilium Web Clipper protocol</td></tr><tr><td><code>utcDateTime</code></td><td><code>string</code></td><td>current UTC date time</td></tr></tbody></table></figure><pre><code class=\"language-application-json\">{\n \"appVersion\": \"0.50.2\",\n \"dbVersion\": 194,\n \"syncVersion\": 25,\n \"buildDate\": \"2022-02-09T22:52:36+01:00\",\n \"buildRevision\": \"23daaa2387a0655685377f0a541d154aeec2aae8\",\n \"dataDirectory\": \"/home/user/data\",\n \"clipperProtocolVersion\": 1.1,\n \"utcDateTime\": \"2022-03-07T21:54:25.277Z\"\n}</code></pre></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">default: unexpected error</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Error</code></li></ul><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>status</code> <br><em>required</em></td><td><code>integer (int32)</code></td><td>HTTP status, identical to the one given in HTTP response</td></tr><tr><td><code>code</code> <br><em>required</em></td><td><code>string</code></td><td>stable string constant</td></tr><tr><td><code>message</code> <br><em>required</em></td><td><code>string</code></td><td>Human readable error, potentially with more details,</td></tr></tbody></table></figure><pre><code class=\"language-application-json\">{\n \"status\": 400,\n \"code\": \"NOTE_IS_PROTECTED\",\n \"message\": \"Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI\"\n}</code></pre></div></section></div><h3>Create a backup</h3><p><code>PUT /backup/{backupName}</code> · <code>createBackup</code></p><p>Create a database backup under a given name</p><p><strong>Authorization</strong>: <code>EtapiTokenAuth</code> or <code>EtapiBasicAuth</code></p><p><strong>Parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>In</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>backupName</code> <br><em>required</em></td><td>path</td><td><code>StringId</code></td><td>If the backupName is e.g. \"now\", then the backup will be written to \"backup-now.db\" file</td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: backup has been created</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">default: unexpected error</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Error</code></li></ul><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>status</code> <br><em>required</em></td><td><code>integer (int32)</code></td><td>HTTP status, identical to the one given in HTTP response</td></tr><tr><td><code>code</code> <br><em>required</em></td><td><code>string</code></td><td>stable string constant</td></tr><tr><td><code>message</code> <br><em>required</em></td><td><code>string</code></td><td>Human readable error, potentially with more details,</td></tr></tbody></table></figure><pre><code class=\"language-application-json\">{\n \"status\": 400,\n \"code\": \"NOTE_IS_PROTECTED\",\n \"message\": \"Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI\"\n}</code></pre></div></section></div><h3>Get instance metrics</h3><p><code>GET /metrics</code> · <code>getMetrics</code></p><p>Returns instance and database metrics for monitoring: note, attachment, revision, branch, attribute and blob counts, note and attachment type breakdowns, version information and database size. Counts only — no note titles, content or attributes.</p><p>The same data is served by GET /api/metrics to the web session.</p><p><strong>Authorization</strong>: <code>EtapiTokenAuth</code> or <code>EtapiBasicAuth</code></p><p><strong>Parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>In</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>format</code></td><td>query</td><td><code>string</code></td><td>Response format. Defaults to Prometheus text. 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: instance metrics</p><div class=\"trilium-tab-panel\"><ul><li><code>text/plain</code>: <code>string</code></li><li><code>application/json</code>: <code>Metrics</code></li></ul><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>version</code></td><td><code>object</code></td><td></td></tr><tr><td><code>database</code></td><td><code>object</code></td><td></td></tr><tr><td><code>noteTypes</code></td><td><code>object</code></td><td>Number of active notes per note type</td></tr><tr><td><code>attachmentTypes</code></td><td><code>object</code></td><td>Number of active attachments per MIME type</td></tr><tr><td><code>statistics</code></td><td><code>object</code></td><td></td></tr><tr><td><code>timestamp</code></td><td><code>string</code></td><td></td></tr></tbody></table></figure><pre><code class=\"language-application-json\">{\n \"version\": {\n \"app\": \"0.99.3\",\n \"db\": 231,\n \"node\": \"v22.14.0\",\n \"sync\": 35,\n \"buildDate\": \"2024-09-07T18:36:34Z\",\n \"buildRevision\": \"7c0d6930fa8f20d269dcfbcbc8f636a25f6bb9a7\"\n },\n \"database\": {\n \"totalNotes\": 0,\n \"deletedNotes\": 0,\n \"activeNotes\": 0,\n \"protectedNotes\": 0,\n \"totalAttachments\": 0,\n \"deletedAttachments\": 0,\n \"activeAttachments\": 0,\n \"totalRevisions\": 0,\n \"totalBranches\": 0,\n \"totalAttributes\": 0,\n \"totalBlobs\": 0,\n \"totalEtapiTokens\": 0,\n \"totalRecentNotes\": 0\n },\n \"noteTypes\": {\n \"text\": 800,\n \"code\": 200\n },\n \"attachmentTypes\": {\n \"image/png\": 45,\n \"application/pdf\": 14\n },\n \"statistics\": {\n \"oldestNote\": \"string\",\n \"newestNote\": \"string\",\n \"lastModified\": \"string\",\n \"databaseSizeBytes\": 0\n },\n \"timestamp\": \"2024-12-01T12:00:00.000Z\"\n}</code></pre></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">default: unexpected error</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Error</code></li></ul><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>status</code> <br><em>required</em></td><td><code>integer (int32)</code></td><td>HTTP status, identical to the one given in HTTP response</td></tr><tr><td><code>code</code> <br><em>required</em></td><td><code>string</code></td><td>stable string constant</td></tr><tr><td><code>message</code> <br><em>required</em></td><td><code>string</code></td><td>Human readable error, potentially with more details,</td></tr></tbody></table></figure><pre><code class=\"language-application-json\">{\n \"status\": 400,\n \"code\": \"NOTE_IS_PROTECTED\",\n \"message\": \"Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI\"\n}</code></pre></div></section></div><h2>Schemas</h2><h3><code>CreateNoteDef</code></h3><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>parentNoteId</code> <br><em>required</em></td><td><code>EntityId</code></td><td>Note ID of the parent note in the tree</td></tr><tr><td><code>title</code> <br><em>required</em></td><td><code>string</code></td><td></td></tr><tr><td><code>type</code> <br><em>required</em></td><td><code>string</code></td><td>One of <code>text</code>, <code>code</code>, <code>file</code>, <code>image</code>, <code>search</code>, <code>book</code>, <code>relationMap</code>, <code>render</code>.</td></tr><tr><td><code>mime</code></td><td><code>string</code></td><td>this needs to be specified only for note types 'code', 'file', 'image'.</td></tr><tr><td><code>content</code> <br><em>required</em></td><td><code>string</code></td><td></td></tr><tr><td><code>notePosition</code></td><td><code>integer</code></td><td>Position of the note in the parent. Normal ordering is 10, 20, 30 ... So if you want to create a note on the first position, use e.g. 5, for second position 15, for last e.g. 1000000</td></tr><tr><td><code>prefix</code></td><td><code>string</code></td><td>Prefix is branch (placement) specific title prefix for the note. Let's say you have your note placed into two different places in the tree, but you want to change the title a bit in one of the placements. For this you can use prefix.</td></tr><tr><td><code>isExpanded</code></td><td><code>boolean</code></td><td>true if this note (as a folder) should appear expanded</td></tr><tr><td><code>noteId</code></td><td><code>EntityId</code></td><td>DON'T specify unless you want to force a specific noteId</td></tr><tr><td><code>branchId</code></td><td><code>EntityId</code></td><td>DON'T specify unless you want to force a specific branchId</td></tr><tr><td><code>dateCreated</code></td><td><code>LocalDateTime</code></td><td>Local timestap of the note creation. Specify only if you want to override the default (current datetime in the current timezone/offset).</td></tr><tr><td><code>utcDateCreated</code></td><td><code>UtcDateTime</code></td><td>UTC timestap of the note creation. Specify only if you want to override the default (current datetime).</td></tr><tr><td><code>utcDateModified</code></td><td><code>UtcDateTime</code></td><td>UTC timestamp of the note's last modification, e.g. to keep the date of a note being migrated from another application. The local dateModified is derived from it. Specify only if you want to override the default (current datetime).</td></tr></tbody></table></figure><h3><code>Note</code></h3><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code></td><td><code>EntityId</code></td><td></td></tr><tr><td><code>title</code></td><td><code>string</code></td><td>Title of the note. Returned as \"[protected]\" for protected notes, since ETAPI cannot open a protected session.</td></tr><tr><td><code>type</code></td><td><code>string</code></td><td>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>webView</code>, <code>shortcut</code>, <code>doc</code>, <code>contentWidget</code>, <code>launcher</code>.</td></tr><tr><td><code>mime</code></td><td><code>string</code></td><td></td></tr><tr><td><code>isProtected</code></td><td><code>boolean</code></td><td></td></tr><tr><td><code>blobId</code></td><td><code>string</code></td><td>ID of the blob object which effectively serves as a content hash</td></tr><tr><td><code>attributes</code></td><td><code>AttributeList</code></td><td></td></tr><tr><td><code>parentNoteIds</code></td><td><code>EntityIdList</code></td><td></td></tr><tr><td><code>childNoteIds</code></td><td><code>EntityIdList</code></td><td></td></tr><tr><td><code>parentBranchIds</code></td><td><code>EntityIdList</code></td><td></td></tr><tr><td><code>childBranchIds</code></td><td><code>EntityIdList</code></td><td></td></tr><tr><td><code>dateCreated</code></td><td><code>LocalDateTime</code></td><td></td></tr><tr><td><code>dateModified</code></td><td><code>LocalDateTime</code></td><td></td></tr><tr><td><code>utcDateCreated</code></td><td><code>UtcDateTime</code></td><td></td></tr><tr><td><code>utcDateModified</code></td><td><code>UtcDateTime</code></td><td>Writable through PATCH, e.g. to restore a migrated note's date after its content was rewritten. The local dateModified is derived from it.</td></tr></tbody></table></figure><h3><code>Branch</code></h3><p>Branch places the note into the tree, it represents the relationship between a parent note and child note</p><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>branchId</code></td><td><code>EntityId</code></td><td></td></tr><tr><td><code>noteId</code></td><td><code>EntityId</code></td><td>identifies the child note</td></tr><tr><td><code>parentNoteId</code></td><td><code>EntityId</code></td><td>identifies the parent note</td></tr><tr><td><code>prefix</code></td><td><code>string</code></td><td></td></tr><tr><td><code>notePosition</code></td><td><code>integer (int32)</code></td><td></td></tr><tr><td><code>isExpanded</code></td><td><code>boolean</code></td><td></td></tr><tr><td><code>utcDateModified</code></td><td><code>UtcDateTime</code></td><td></td></tr></tbody></table></figure><h3><code>NoteWithBranch</code></h3><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>note</code></td><td><code>Note</code></td><td></td></tr><tr><td><code>branch</code></td><td><code>Branch</code></td><td>Branch places the note into the tree, it represents the relationship between a parent note and child note</td></tr></tbody></table></figure><h3><code>Attachment</code></h3><p>Attachment is owned by a note, has title and content</p><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>attachmentId</code></td><td><code>EntityId</code></td><td></td></tr><tr><td><code>ownerId</code></td><td><code>EntityId</code></td><td>identifies the owner of the attachment, is either noteId or revisionId</td></tr><tr><td><code>role</code></td><td><code>string</code></td><td></td></tr><tr><td><code>mime</code></td><td><code>string</code></td><td></td></tr><tr><td><code>title</code></td><td><code>string</code></td><td>Title of the attachment. Returned as \"[protected]\" for protected attachments, since ETAPI cannot open a protected session.</td></tr><tr><td><code>position</code></td><td><code>integer (int32)</code></td><td></td></tr><tr><td><code>blobId</code></td><td><code>string</code></td><td>ID of the blob object which effectively serves as a content hash</td></tr><tr><td><code>dateModified</code></td><td><code>LocalDateTime</code></td><td></td></tr><tr><td><code>utcDateModified</code></td><td><code>UtcDateTime</code></td><td></td></tr><tr><td><code>utcDateScheduledForErasureSince</code></td><td><code>UtcDateTime</code></td><td></td></tr><tr><td><code>contentLength</code></td><td><code>integer (int32)</code></td><td></td></tr></tbody></table></figure><h3><code>CreateAttachment</code></h3><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>ownerId</code></td><td><code>EntityId</code></td><td>identifies the owner of the attachment, is either noteId or revisionId</td></tr><tr><td><code>role</code></td><td><code>string</code></td><td></td></tr><tr><td><code>mime</code></td><td><code>string</code></td><td></td></tr><tr><td><code>title</code></td><td><code>string</code></td><td></td></tr><tr><td><code>content</code></td><td><code>string</code></td><td>Text content of the attachment, stored as-is. To store binary content, create the attachment without it, then upload the data with <code>PUT /attachments/{attachmentId}/content</code>.</td></tr><tr><td><code>position</code></td><td><code>integer (int32)</code></td><td></td></tr></tbody></table></figure><h3><code>Attribute</code></h3><p>Attribute (Label, Relation) is a key-value record attached to a note.</p><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>attributeId</code></td><td><code>EntityId</code></td><td></td></tr><tr><td><code>noteId</code></td><td><code>EntityId</code></td><td>identifies the child note</td></tr><tr><td><code>type</code></td><td><code>string</code></td><td>One of <code>label</code>, <code>relation</code>.</td></tr><tr><td><code>name</code></td><td><code>string</code></td><td></td></tr><tr><td><code>value</code></td><td><code>string</code></td><td></td></tr><tr><td><code>position</code></td><td><code>integer (int32)</code></td><td></td></tr><tr><td><code>isInheritable</code></td><td><code>boolean</code></td><td></td></tr><tr><td><code>utcDateModified</code></td><td><code>UtcDateTime</code></td><td></td></tr></tbody></table></figure><h3><code>AttributeList</code></h3><p>Type: <code>array of Attribute</code></p><h3><code>SearchResponse</code></h3><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>results</code> <br><em>required</em></td><td><code>array of Note</code></td><td></td></tr><tr><td><code>debugInfo</code></td><td><code>object</code></td><td>debugging info on parsing the search query enabled with &amp;debug=true parameter</td></tr></tbody></table></figure><h3><code>EntityId</code></h3><p>Type: <code>string</code></p><h3><code>StringId</code></h3><p>Type: <code>string</code></p><h3><code>EntityIdList</code></h3><p>Type: <code>array of EntityId</code></p><h3><code>LocalDateTime</code></h3><p>Type: <code>string</code></p><h3><code>UtcDateTime</code></h3><p>Type: <code>string</code></p><h3><code>AppInfo</code></h3><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>appVersion</code></td><td><code>string</code></td><td>Trilium version</td></tr><tr><td><code>dbVersion</code></td><td><code>integer (int32)</code></td><td>DB version</td></tr><tr><td><code>syncVersion</code></td><td><code>integer (int32)</code></td><td>Sync protocol version</td></tr><tr><td><code>buildDate</code></td><td><code>string (date-time)</code></td><td>build date</td></tr><tr><td><code>buildRevision</code></td><td><code>string</code></td><td>git build revision</td></tr><tr><td><code>dataDirectory</code></td><td><code>string</code></td><td>data directory where Trilium stores files</td></tr><tr><td><code>clipperProtocolVersion</code></td><td><code>string</code></td><td>version of the supported Trilium Web Clipper protocol</td></tr><tr><td><code>utcDateTime</code></td><td><code>string</code></td><td>current UTC date time</td></tr></tbody></table></figure><h3><code>Error</code></h3><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>status</code> <br><em>required</em></td><td><code>integer (int32)</code></td><td>HTTP status, identical to the one given in HTTP response</td></tr><tr><td><code>code</code> <br><em>required</em></td><td><code>string</code></td><td>stable string constant</td></tr><tr><td><code>message</code> <br><em>required</em></td><td><code>string</code></td><td>Human readable error, potentially with more details,</td></tr></tbody></table></figure><h3><code>Revision</code></h3><p>Revision represents a snapshot of note's title and content at some point in the past.</p><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>revisionId</code></td><td><code>EntityId</code></td><td></td></tr><tr><td><code>noteId</code></td><td><code>EntityId</code></td><td></td></tr><tr><td><code>type</code></td><td><code>string</code></td><td>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>webView</code>, <code>shortcut</code>, <code>doc</code>, <code>contentWidget</code>, <code>launcher</code>.</td></tr><tr><td><code>mime</code></td><td><code>string</code></td><td></td></tr><tr><td><code>isProtected</code></td><td><code>boolean</code></td><td></td></tr><tr><td><code>title</code></td><td><code>string</code></td><td></td></tr><tr><td><code>blobId</code></td><td><code>string</code></td><td>ID of the blob object which effectively serves as a content hash</td></tr><tr><td><code>dateLastEdited</code></td><td><code>LocalDateTime</code></td><td></td></tr><tr><td><code>dateCreated</code></td><td><code>LocalDateTime</code></td><td></td></tr><tr><td><code>utcDateLastEdited</code></td><td><code>UtcDateTime</code></td><td></td></tr><tr><td><code>utcDateCreated</code></td><td><code>UtcDateTime</code></td><td></td></tr><tr><td><code>utcDateModified</code></td><td><code>UtcDateTime</code></td><td></td></tr><tr><td><code>contentLength</code></td><td><code>integer (int32)</code></td><td></td></tr></tbody></table></figure><h3><code>RecentChange</code></h3><p>Represents a recent change event (creation, modification, or deletion).</p><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code></td><td><code>EntityId</code></td><td></td></tr><tr><td><code>title</code></td><td><code>string</code></td><td>Title at the time of the change (may be \"[protected]\" for protected notes)</td></tr><tr><td><code>current_title</code></td><td><code>string</code></td><td>Current title of the note (may be \"[protected]\" for protected notes)</td></tr><tr><td><code>current_isDeleted</code></td><td><code>boolean</code></td><td>Whether the note is currently deleted</td></tr><tr><td><code>current_deleteId</code></td><td><code>string</code></td><td>Delete ID if the note is deleted</td></tr><tr><td><code>current_isProtected</code></td><td><code>boolean</code></td><td>Whether the note is protected</td></tr><tr><td><code>utcDate</code></td><td><code>UtcDateTime</code></td><td>UTC timestamp of the change</td></tr><tr><td><code>date</code></td><td><code>LocalDateTime</code></td><td>Local timestamp of the change</td></tr><tr><td><code>canBeUndeleted</code></td><td><code>boolean</code></td><td>Whether the note can be undeleted (only present for deleted notes)</td></tr></tbody></table></figure><h3><code>Metrics</code></h3><p>Instance and database metrics, as served by GET /etapi/metrics?format=json</p><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>version</code></td><td><code>object</code></td><td></td></tr><tr><td><code>database</code></td><td><code>object</code></td><td></td></tr><tr><td><code>noteTypes</code></td><td><code>object</code></td><td>Number of active notes per note type</td></tr><tr><td><code>attachmentTypes</code></td><td><code>object</code></td><td>Number of active attachments per MIME type</td></tr><tr><td><code>statistics</code></td><td><code>object</code></td><td></td></tr><tr><td><code>timestamp</code></td><td><code>string</code></td><td></td></tr></tbody></table></figure>",
+ "_help_9qPsTWBorUhQ": "<p>External Trilium API</p><h2>Authentication</h2><h3><code>EtapiTokenAuth</code></h3><p>API key in the <code>Authorization</code> header.</p><h3><code>EtapiBasicAuth</code></h3><p>HTTP <code>basic</code> authentication.</p><p>Basic Auth where username is arbitrary string (e.g. \"trilium\", not checked), username is the ETAPI token. To emphasize, do not use Trilium password here (won't work), only the generated ETAPI token (from Options -&gt; ETAPI)</p><h2>Notes</h2><p>Notes and their content, and the import and export of whole subtrees.</p><h3>Create a note</h3><p><code>POST /create-note</code> · <code>createNote</code></p><p>Create a note and place it into the note tree</p><p><strong>Authorization</strong>: <code>EtapiTokenAuth</code> or <code>EtapiBasicAuth</code></p><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>CreateNoteDef</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>parentNoteId</code> <br><em>required</em></td><td><code>EntityId</code></td><td>Note ID of the parent note in the tree</td></tr><tr><td><code>title</code> <br><em>required</em></td><td><code>string</code></td><td></td></tr><tr><td><code>type</code> <br><em>required</em></td><td><code>string</code></td><td>One of <code>text</code>, <code>code</code>, <code>file</code>, <code>image</code>, <code>search</code>, <code>book</code>, <code>relationMap</code>, <code>render</code>.</td></tr><tr><td><code>mime</code></td><td><code>string</code></td><td>this needs to be specified only for note types 'code', 'file', 'image'.</td></tr><tr><td><code>content</code> <br><em>required</em></td><td><code>string</code></td><td></td></tr><tr><td><code>notePosition</code></td><td><code>integer</code></td><td>Position of the note in the parent. Normal ordering is 10, 20, 30 ... So if you want to create a note on the first position, use e.g. 5, for second position 15, for last e.g. 1000000</td></tr><tr><td><code>prefix</code></td><td><code>string</code></td><td>Prefix is branch (placement) specific title prefix for the note. Let's say you have your note placed into two different places in the tree, but you want to change the title a bit in one of the placements. For this you can use prefix.</td></tr><tr><td><code>isExpanded</code></td><td><code>boolean</code></td><td>true if this note (as a folder) should appear expanded</td></tr><tr><td><code>noteId</code></td><td><code>EntityId</code></td><td>DON'T specify unless you want to force a specific noteId</td></tr><tr><td><code>branchId</code></td><td><code>EntityId</code></td><td>DON'T specify unless you want to force a specific branchId</td></tr><tr><td><code>dateCreated</code></td><td><code>LocalDateTime</code></td><td>Local timestap of the note creation. Specify only if you want to override the default (current datetime in the current timezone/offset).</td></tr><tr><td><code>utcDateCreated</code></td><td><code>UtcDateTime</code></td><td>UTC timestap of the note creation. Specify only if you want to override the default (current datetime).</td></tr><tr><td><code>utcDateModified</code></td><td><code>UtcDateTime</code></td><td>UTC timestamp of the note's last modification, e.g. to keep the date of a note being migrated from another application. The local dateModified is derived from it. Specify only if you want to override the default (current datetime).</td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"parentNoteId\": \"evnnmvHTCgIn\",\n \"title\": \"string\",\n \"type\": \"text\",\n \"mime\": \"application/json\",\n \"content\": \"string\",\n \"notePosition\": 0,\n \"prefix\": \"string\",\n \"isExpanded\": true,\n \"noteId\": \"evnnmvHTCgIn\",\n \"branchId\": \"evnnmvHTCgIn\",\n \"dateCreated\": \"2021-12-31 20:18:11.930+0100\",\n \"utcDateCreated\": \"2021-12-31 19:18:11.930Z\",\n \"utcDateModified\": \"2021-12-31 19:18:11.930Z\"\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; charset=utf-8</code>: <code>NoteWithBranch</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>note</code></td><td><code>Note</code></td><td></td></tr><tr><td><code>branch</code></td><td><code>Branch</code></td><td>Branch places the note into the tree, it represents the relationship between a parent note and child note</td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"note\": {\n \"noteId\": \"evnnmvHTCgIn\",\n \"title\": \"string\",\n \"type\": \"text\",\n \"mime\": \"string\",\n \"isProtected\": true,\n \"blobId\": \"string\",\n \"attributes\": [\n {\n \"attributeId\": \"evnnmvHTCgIn\",\n \"noteId\": \"evnnmvHTCgIn\",\n \"type\": \"label\",\n \"name\": \"shareCss\",\n \"value\": \"string\",\n \"position\": 0,\n \"isInheritable\": true,\n \"utcDateModified\": \"2021-12-31 19:18:11.930Z\"\n }\n ],\n \"parentNoteIds\": [\n \"evnnmvHTCgIn\"\n ],\n \"childNoteIds\": [\n \"evnnmvHTCgIn\"\n ],\n \"parentBranchIds\": [\n \"evnnmvHTCgIn\"\n ],\n \"childBranchIds\": [\n \"evnnmvHTCgIn\"\n ],\n \"dateCreated\": \"2021-12-31 20:18:11.930+0100\",\n \"dateModified\": \"2021-12-31 20:18:11.930+0100\",\n \"utcDateCreated\": \"2021-12-31 19:18:11.930Z\",\n \"utcDateModified\": \"2021-12-31 19:18:11.930Z\"\n },\n \"branch\": {\n \"branchId\": \"evnnmvHTCgIn\",\n \"noteId\": \"evnnmvHTCgIn\",\n \"parentNoteId\": \"evnnmvHTCgIn\",\n \"prefix\": \"string\",\n \"notePosition\": 0,\n \"isExpanded\": true,\n \"utcDateModified\": \"2021-12-31 19:18:11.930Z\"\n }\n}</code></pre></div></div></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">default: unexpected error</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Error</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>status</code> <br><em>required</em></td><td><code>integer (int32)</code></td><td>HTTP status, identical to the one given in HTTP response</td></tr><tr><td><code>code</code> <br><em>required</em></td><td><code>string</code></td><td>stable string constant</td></tr><tr><td><code>message</code> <br><em>required</em></td><td><code>string</code></td><td>Human readable error, potentially with more details,</td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"status\": 400,\n \"code\": \"NOTE_IS_PROTECTED\",\n \"message\": \"Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI\"\n}</code></pre></div></div></div></section></div><h3>Search notes</h3><p><code>GET /notes</code> · <code>searchNotes</code></p><p>Search notes</p><p><strong>Authorization</strong>: <code>EtapiTokenAuth</code> or <code>EtapiBasicAuth</code></p><p><strong>Parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>In</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>search</code> <br><em>required</em></td><td>query</td><td><code>string</code></td><td>search query string as described in <a href=\"https://triliumnext.github.io/Docs/Wiki/search.html\">https://triliumnext.github.io/Docs/Wiki/search.html</a></td></tr><tr><td><code>fastSearch</code></td><td>query</td><td><code>boolean</code></td><td>enable fast search (fulltext doesn't look into content)</td></tr><tr><td><code>includeArchivedNotes</code></td><td>query</td><td><code>boolean</code></td><td>search by default ignores archived notes. Set to 'true' to includes archived notes into search results.</td></tr><tr><td><code>ancestorNoteId</code></td><td>query</td><td><code>EntityId</code></td><td>search only in a subtree identified by the subtree noteId. By default whole tree is searched.</td></tr><tr><td><code>ancestorDepth</code></td><td>query</td><td><code>string</code></td><td>define how deep in the tree should the notes be searched</td></tr><tr><td><code>orderBy</code></td><td>query</td><td><code>string</code></td><td>name of the property/label to order search results by</td></tr><tr><td><code>orderDirection</code></td><td>query</td><td><code>string</code></td><td>order direction, ascending or descending. One of <code>asc</code>, <code>desc</code>.</td></tr><tr><td><code>limit</code></td><td>query</td><td><code>integer</code></td><td>limit the number of results you want to receive</td></tr><tr><td><code>debug</code></td><td>query</td><td><code>boolean</code></td><td>set to true to get debug information in the response (search query parsing)</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 response</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>SearchResponse</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>results</code> <br><em>required</em></td><td><code>array of Note</code></td><td></td></tr><tr><td><code>debugInfo</code></td><td><code>object</code></td><td>debugging info on parsing the search query enabled with &amp;debug=true parameter</td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"results\": [\n {\n \"noteId\": \"evnnmvHTCgIn\",\n \"title\": \"string\",\n \"type\": \"text\",\n \"mime\": \"string\",\n \"isProtected\": true,\n \"blobId\": \"string\",\n \"attributes\": [\n {\n \"attributeId\": \"evnnmvHTCgIn\",\n \"noteId\": \"evnnmvHTCgIn\",\n \"type\": \"label\",\n \"name\": \"shareCss\",\n \"value\": \"string\",\n \"position\": 0,\n \"isInheritable\": true,\n \"utcDateModified\": \"2021-12-31 19:18:11.930Z\"\n }\n ],\n \"parentNoteIds\": [\n \"evnnmvHTCgIn\"\n ],\n \"childNoteIds\": [\n \"evnnmvHTCgIn\"\n ],\n \"parentBranchIds\": [\n \"evnnmvHTCgIn\"\n ],\n \"childBranchIds\": [\n \"evnnmvHTCgIn\"\n ],\n \"dateCreated\": \"2021-12-31 20:18:11.930+0100\",\n \"dateModified\": \"2021-12-31 20:18:11.930+0100\",\n \"utcDateCreated\": \"2021-12-31 19:18:11.930Z\",\n \"utcDateModified\": \"2021-12-31 19:18:11.930Z\"\n }\n ],\n \"debugInfo\": {}\n}</code></pre></div></div></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">default: unexpected error</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Error</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>status</code> <br><em>required</em></td><td><code>integer (int32)</code></td><td>HTTP status, identical to the one given in HTTP response</td></tr><tr><td><code>code</code> <br><em>required</em></td><td><code>string</code></td><td>stable string constant</td></tr><tr><td><code>message</code> <br><em>required</em></td><td><code>string</code></td><td>Human readable error, potentially with more details,</td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"status\": 400,\n \"code\": \"NOTE_IS_PROTECTED\",\n \"message\": \"Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI\"\n}</code></pre></div></div></div></section></div><h3>Get a note</h3><p><code>GET /notes/{noteId}</code> · <code>getNoteById</code></p><p>Returns a note identified by its ID</p><p><strong>Authorization</strong>: <code>EtapiTokenAuth</code> or <code>EtapiBasicAuth</code></p><p><strong>Parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>In</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td>path</td><td><code>EntityId</code></td><td></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 response</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Note</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code></td><td><code>EntityId</code></td><td></td></tr><tr><td><code>title</code></td><td><code>string</code></td><td>Title of the note. Returned as \"[protected]\" for protected notes, since ETAPI cannot open a protected session.</td></tr><tr><td><code>type</code></td><td><code>string</code></td><td>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>webView</code>, <code>shortcut</code>, <code>doc</code>, <code>contentWidget</code>, <code>launcher</code>.</td></tr><tr><td><code>mime</code></td><td><code>string</code></td><td></td></tr><tr><td><code>isProtected</code></td><td><code>boolean</code></td><td></td></tr><tr><td><code>blobId</code></td><td><code>string</code></td><td>ID of the blob object which effectively serves as a content hash</td></tr><tr><td><code>attributes</code></td><td><code>AttributeList</code></td><td></td></tr><tr><td><code>parentNoteIds</code></td><td><code>EntityIdList</code></td><td></td></tr><tr><td><code>childNoteIds</code></td><td><code>EntityIdList</code></td><td></td></tr><tr><td><code>parentBranchIds</code></td><td><code>EntityIdList</code></td><td></td></tr><tr><td><code>childBranchIds</code></td><td><code>EntityIdList</code></td><td></td></tr><tr><td><code>dateCreated</code></td><td><code>LocalDateTime</code></td><td></td></tr><tr><td><code>dateModified</code></td><td><code>LocalDateTime</code></td><td></td></tr><tr><td><code>utcDateCreated</code></td><td><code>UtcDateTime</code></td><td></td></tr><tr><td><code>utcDateModified</code></td><td><code>UtcDateTime</code></td><td>Writable through PATCH, e.g. to restore a migrated note's date after its content was rewritten. The local dateModified is derived from it.</td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"noteId\": \"evnnmvHTCgIn\",\n \"title\": \"string\",\n \"type\": \"text\",\n \"mime\": \"string\",\n \"isProtected\": true,\n \"blobId\": \"string\",\n \"attributes\": [\n {\n \"attributeId\": \"evnnmvHTCgIn\",\n \"noteId\": \"evnnmvHTCgIn\",\n \"type\": \"label\",\n \"name\": \"shareCss\",\n \"value\": \"string\",\n \"position\": 0,\n \"isInheritable\": true,\n \"utcDateModified\": \"2021-12-31 19:18:11.930Z\"\n }\n ],\n \"parentNoteIds\": [\n \"evnnmvHTCgIn\"\n ],\n \"childNoteIds\": [\n \"evnnmvHTCgIn\"\n ],\n \"parentBranchIds\": [\n \"evnnmvHTCgIn\"\n ],\n \"childBranchIds\": [\n \"evnnmvHTCgIn\"\n ],\n \"dateCreated\": \"2021-12-31 20:18:11.930+0100\",\n \"dateModified\": \"2021-12-31 20:18:11.930+0100\",\n \"utcDateCreated\": \"2021-12-31 19:18:11.930Z\",\n \"utcDateModified\": \"2021-12-31 19:18:11.930Z\"\n}</code></pre></div></div></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">default: unexpected error</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Error</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>status</code> <br><em>required</em></td><td><code>integer (int32)</code></td><td>HTTP status, identical to the one given in HTTP response</td></tr><tr><td><code>code</code> <br><em>required</em></td><td><code>string</code></td><td>stable string constant</td></tr><tr><td><code>message</code> <br><em>required</em></td><td><code>string</code></td><td>Human readable error, potentially with more details,</td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"status\": 400,\n \"code\": \"NOTE_IS_PROTECTED\",\n \"message\": \"Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI\"\n}</code></pre></div></div></div></section></div><h3>Delete a note</h3><p><code>DELETE /notes/{noteId}</code> · <code>deleteNoteById</code></p><p>deletes a single note based on the noteId supplied</p><p><strong>Authorization</strong>: <code>EtapiTokenAuth</code> or <code>EtapiBasicAuth</code></p><p><strong>Parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>In</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td>path</td><td><code>EntityId</code></td><td></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\">default: unexpected error</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Error</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>status</code> <br><em>required</em></td><td><code>integer (int32)</code></td><td>HTTP status, identical to the one given in HTTP response</td></tr><tr><td><code>code</code> <br><em>required</em></td><td><code>string</code></td><td>stable string constant</td></tr><tr><td><code>message</code> <br><em>required</em></td><td><code>string</code></td><td>Human readable error, potentially with more details,</td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"status\": 400,\n \"code\": \"NOTE_IS_PROTECTED\",\n \"message\": \"Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI\"\n}</code></pre></div></div></div></section></div><h3>Update a note</h3><p><code>PATCH /notes/{noteId}</code> · <code>patchNoteById</code></p><p>patch a note identified by the noteId with changes in the body</p><p><strong>Authorization</strong>: <code>EtapiTokenAuth</code> or <code>EtapiBasicAuth</code></p><p><strong>Parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>In</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td>path</td><td><code>EntityId</code></td><td></td></tr></tbody></table></figure><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>Note</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code></td><td><code>EntityId</code></td><td></td></tr><tr><td><code>title</code></td><td><code>string</code></td><td>Title of the note. Returned as \"[protected]\" for protected notes, since ETAPI cannot open a protected session.</td></tr><tr><td><code>type</code></td><td><code>string</code></td><td>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>webView</code>, <code>shortcut</code>, <code>doc</code>, <code>contentWidget</code>, <code>launcher</code>.</td></tr><tr><td><code>mime</code></td><td><code>string</code></td><td></td></tr><tr><td><code>isProtected</code></td><td><code>boolean</code></td><td></td></tr><tr><td><code>blobId</code></td><td><code>string</code></td><td>ID of the blob object which effectively serves as a content hash</td></tr><tr><td><code>attributes</code></td><td><code>AttributeList</code></td><td></td></tr><tr><td><code>parentNoteIds</code></td><td><code>EntityIdList</code></td><td></td></tr><tr><td><code>childNoteIds</code></td><td><code>EntityIdList</code></td><td></td></tr><tr><td><code>parentBranchIds</code></td><td><code>EntityIdList</code></td><td></td></tr><tr><td><code>childBranchIds</code></td><td><code>EntityIdList</code></td><td></td></tr><tr><td><code>dateCreated</code></td><td><code>LocalDateTime</code></td><td></td></tr><tr><td><code>dateModified</code></td><td><code>LocalDateTime</code></td><td></td></tr><tr><td><code>utcDateCreated</code></td><td><code>UtcDateTime</code></td><td></td></tr><tr><td><code>utcDateModified</code></td><td><code>UtcDateTime</code></td><td>Writable through PATCH, e.g. to restore a migrated note's date after its content was rewritten. The local dateModified is derived from it.</td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"title\": \"string\",\n \"type\": \"text\",\n \"mime\": \"string\",\n \"blobId\": \"string\",\n \"dateCreated\": \"2021-12-31 20:18:11.930+0100\",\n \"utcDateCreated\": \"2021-12-31 19:18:11.930Z\",\n \"utcDateModified\": \"2021-12-31 19:18:11.930Z\"\n}</code></pre></div></div><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: note updated</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Note</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code></td><td><code>EntityId</code></td><td></td></tr><tr><td><code>title</code></td><td><code>string</code></td><td>Title of the note. Returned as \"[protected]\" for protected notes, since ETAPI cannot open a protected session.</td></tr><tr><td><code>type</code></td><td><code>string</code></td><td>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>webView</code>, <code>shortcut</code>, <code>doc</code>, <code>contentWidget</code>, <code>launcher</code>.</td></tr><tr><td><code>mime</code></td><td><code>string</code></td><td></td></tr><tr><td><code>isProtected</code></td><td><code>boolean</code></td><td></td></tr><tr><td><code>blobId</code></td><td><code>string</code></td><td>ID of the blob object which effectively serves as a content hash</td></tr><tr><td><code>attributes</code></td><td><code>AttributeList</code></td><td></td></tr><tr><td><code>parentNoteIds</code></td><td><code>EntityIdList</code></td><td></td></tr><tr><td><code>childNoteIds</code></td><td><code>EntityIdList</code></td><td></td></tr><tr><td><code>parentBranchIds</code></td><td><code>EntityIdList</code></td><td></td></tr><tr><td><code>childBranchIds</code></td><td><code>EntityIdList</code></td><td></td></tr><tr><td><code>dateCreated</code></td><td><code>LocalDateTime</code></td><td></td></tr><tr><td><code>dateModified</code></td><td><code>LocalDateTime</code></td><td></td></tr><tr><td><code>utcDateCreated</code></td><td><code>UtcDateTime</code></td><td></td></tr><tr><td><code>utcDateModified</code></td><td><code>UtcDateTime</code></td><td>Writable through PATCH, e.g. to restore a migrated note's date after its content was rewritten. The local dateModified is derived from it.</td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"noteId\": \"evnnmvHTCgIn\",\n \"title\": \"string\",\n \"type\": \"text\",\n \"mime\": \"string\",\n \"isProtected\": true,\n \"blobId\": \"string\",\n \"attributes\": [\n {\n \"attributeId\": \"evnnmvHTCgIn\",\n \"noteId\": \"evnnmvHTCgIn\",\n \"type\": \"label\",\n \"name\": \"shareCss\",\n \"value\": \"string\",\n \"position\": 0,\n \"isInheritable\": true,\n \"utcDateModified\": \"2021-12-31 19:18:11.930Z\"\n }\n ],\n \"parentNoteIds\": [\n \"evnnmvHTCgIn\"\n ],\n \"childNoteIds\": [\n \"evnnmvHTCgIn\"\n ],\n \"parentBranchIds\": [\n \"evnnmvHTCgIn\"\n ],\n \"childBranchIds\": [\n \"evnnmvHTCgIn\"\n ],\n \"dateCreated\": \"2021-12-31 20:18:11.930+0100\",\n \"dateModified\": \"2021-12-31 20:18:11.930+0100\",\n \"utcDateCreated\": \"2021-12-31 19:18:11.930Z\",\n \"utcDateModified\": \"2021-12-31 19:18:11.930Z\"\n}</code></pre></div></div></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">default: unexpected error</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Error</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>status</code> <br><em>required</em></td><td><code>integer (int32)</code></td><td>HTTP status, identical to the one given in HTTP response</td></tr><tr><td><code>code</code> <br><em>required</em></td><td><code>string</code></td><td>stable string constant</td></tr><tr><td><code>message</code> <br><em>required</em></td><td><code>string</code></td><td>Human readable error, potentially with more details,</td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"status\": 400,\n \"code\": \"NOTE_IS_PROTECTED\",\n \"message\": \"Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI\"\n}</code></pre></div></div></div></section></div><h3>Get the content of a note</h3><p><code>GET /notes/{noteId}/content</code> · <code>getNoteContent</code></p><p>Returns note content identified by its ID. The response carries the note's MIME type as its <code>Content-Type</code>.</p><p><strong>Authorization</strong>: <code>EtapiTokenAuth</code> or <code>EtapiBasicAuth</code></p><p><strong>Parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>In</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td>path</td><td><code>EntityId</code></td><td></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\"><ul><li><code>*/*</code>: <code>string (binary)</code></li></ul></div></section></div><h3>Replace the content of a note</h3><p><code>PUT /notes/{noteId}/content</code> · <code>putNoteContentById</code></p><p>Updates note content identified by its ID</p><p><strong>Authorization</strong>: <code>EtapiTokenAuth</code> or <code>EtapiBasicAuth</code></p><p><strong>Parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>In</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td>path</td><td><code>EntityId</code></td><td></td></tr></tbody></table></figure><p><strong>Request body</strong> (required)</p><p>New content of the note. Send text (such as the HTML of a text note) as <code>text/plain</code> and binary data (such as the file of an image or file note) as <code>application/octet-stream</code>; other content types are not accepted.</p><ul><li><code>text/plain</code>: <code>string</code></li><li><code>application/octet-stream</code>: <code>string (binary)</code></li></ul><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: note content updated</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h3>Export a subtree</h3><p><code>GET /notes/{noteId}/export</code> · <code>exportNoteSubtree</code></p><p>Exports ZIP file export of a given note subtree. To export whole document, use \"root\" for noteId</p><p><strong>Authorization</strong>: <code>EtapiTokenAuth</code> or <code>EtapiBasicAuth</code></p><p><strong>Parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>In</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td>path</td><td><code>EntityId</code></td><td></td></tr><tr><td><code>format</code></td><td>query</td><td><code>any</code></td><td>One of <code>html</code>, <code>markdown</code>, <code>share</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: export ZIP file</p><div class=\"trilium-tab-panel\"><ul><li><code>application/zip</code>: <code>string (binary)</code></li></ul></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">default: unexpected error</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Error</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>status</code> <br><em>required</em></td><td><code>integer (int32)</code></td><td>HTTP status, identical to the one given in HTTP response</td></tr><tr><td><code>code</code> <br><em>required</em></td><td><code>string</code></td><td>stable string constant</td></tr><tr><td><code>message</code> <br><em>required</em></td><td><code>string</code></td><td>Human readable error, potentially with more details,</td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"status\": 400,\n \"code\": \"NOTE_IS_PROTECTED\",\n \"message\": \"Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI\"\n}</code></pre></div></div></div></section></div><h3>Import a ZIP archive</h3><p><code>POST /notes/{noteId}/import</code> · <code>importZip</code></p><p>Imports ZIP file into a given note.</p><p><strong>Authorization</strong>: <code>EtapiTokenAuth</code> or <code>EtapiBasicAuth</code></p><p><strong>Parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>In</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td>path</td><td><code>EntityId</code></td><td></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 created</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>NoteWithBranch</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>note</code></td><td><code>Note</code></td><td></td></tr><tr><td><code>branch</code></td><td><code>Branch</code></td><td>Branch places the note into the tree, it represents the relationship between a parent note and child note</td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"note\": {\n \"noteId\": \"evnnmvHTCgIn\",\n \"title\": \"string\",\n \"type\": \"text\",\n \"mime\": \"string\",\n \"isProtected\": true,\n \"blobId\": \"string\",\n \"attributes\": [\n {\n \"attributeId\": \"evnnmvHTCgIn\",\n \"noteId\": \"evnnmvHTCgIn\",\n \"type\": \"label\",\n \"name\": \"shareCss\",\n \"value\": \"string\",\n \"position\": 0,\n \"isInheritable\": true,\n \"utcDateModified\": \"2021-12-31 19:18:11.930Z\"\n }\n ],\n \"parentNoteIds\": [\n \"evnnmvHTCgIn\"\n ],\n \"childNoteIds\": [\n \"evnnmvHTCgIn\"\n ],\n \"parentBranchIds\": [\n \"evnnmvHTCgIn\"\n ],\n \"childBranchIds\": [\n \"evnnmvHTCgIn\"\n ],\n \"dateCreated\": \"2021-12-31 20:18:11.930+0100\",\n \"dateModified\": \"2021-12-31 20:18:11.930+0100\",\n \"utcDateCreated\": \"2021-12-31 19:18:11.930Z\",\n \"utcDateModified\": \"2021-12-31 19:18:11.930Z\"\n },\n \"branch\": {\n \"branchId\": \"evnnmvHTCgIn\",\n \"noteId\": \"evnnmvHTCgIn\",\n \"parentNoteId\": \"evnnmvHTCgIn\",\n \"prefix\": \"string\",\n \"notePosition\": 0,\n \"isExpanded\": true,\n \"utcDateModified\": \"2021-12-31 19:18:11.930Z\"\n }\n}</code></pre></div></div></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">default: unexpected error</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Error</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>status</code> <br><em>required</em></td><td><code>integer (int32)</code></td><td>HTTP status, identical to the one given in HTTP response</td></tr><tr><td><code>code</code> <br><em>required</em></td><td><code>string</code></td><td>stable string constant</td></tr><tr><td><code>message</code> <br><em>required</em></td><td><code>string</code></td><td>Human readable error, potentially with more details,</td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"status\": 400,\n \"code\": \"NOTE_IS_PROTECTED\",\n \"message\": \"Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI\"\n}</code></pre></div></div></div></section></div><h3>Restore a deleted note</h3><p><code>POST /notes/{noteId}/undelete</code> · <code>undeleteNote</code></p><p>Restore a deleted note. The note must be deleted and must have at least one undeleted parent.</p><p><strong>Authorization</strong>: <code>EtapiTokenAuth</code> or <code>EtapiBasicAuth</code></p><p><strong>Parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>In</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td>path</td><td><code>EntityId</code></td><td></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 restored successfully</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>success</code></td><td><code>boolean</code></td><td></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><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">default: unexpected error</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Error</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>status</code> <br><em>required</em></td><td><code>integer (int32)</code></td><td>HTTP status, identical to the one given in HTTP response</td></tr><tr><td><code>code</code> <br><em>required</em></td><td><code>string</code></td><td>stable string constant</td></tr><tr><td><code>message</code> <br><em>required</em></td><td><code>string</code></td><td>Human readable error, potentially with more details,</td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"status\": 400,\n \"code\": \"NOTE_IS_PROTECTED\",\n \"message\": \"Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI\"\n}</code></pre></div></div></div></section></div><h3>List recent changes</h3><p><code>GET /notes/history</code> · <code>getNoteHistory</code></p><p>Returns recent changes including note creations, modifications, and deletions</p><p><strong>Authorization</strong>: <code>EtapiTokenAuth</code> or <code>EtapiBasicAuth</code></p><p><strong>Parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>In</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>ancestorNoteId</code></td><td>query</td><td><code>EntityId</code></td><td>Limit changes to a subtree identified by this note ID. Defaults to \"root\" (all notes).</td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: list of recent changes</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>array of RecentChange</code></li></ul><pre><code class=\"language-application-json\">[\n {\n \"noteId\": \"evnnmvHTCgIn\",\n \"title\": \"string\",\n \"current_title\": \"string\",\n \"current_isDeleted\": true,\n \"current_deleteId\": \"string\",\n \"current_isProtected\": true,\n \"utcDate\": \"2021-12-31 19:18:11.930Z\",\n \"date\": \"2021-12-31 20:18:11.930+0100\",\n \"canBeUndeleted\": true\n }\n]</code></pre></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">default: unexpected error</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Error</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>status</code> <br><em>required</em></td><td><code>integer (int32)</code></td><td>HTTP status, identical to the one given in HTTP response</td></tr><tr><td><code>code</code> <br><em>required</em></td><td><code>string</code></td><td>stable string constant</td></tr><tr><td><code>message</code> <br><em>required</em></td><td><code>string</code></td><td>Human readable error, potentially with more details,</td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"status\": 400,\n \"code\": \"NOTE_IS_PROTECTED\",\n \"message\": \"Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI\"\n}</code></pre></div></div></div></section></div><h2>Branches</h2><p>Branches place a note in the tree, under a parent note.</p><h3>Create a branch</h3><p><code>POST /branches</code> · <code>postBranch</code></p><p>Create a branch (clone a note to a different location in the tree). In case there is a branch between parent note and child note already, then this will update the existing branch with prefix, notePosition and isExpanded.</p><p><strong>Authorization</strong>: <code>EtapiTokenAuth</code> or <code>EtapiBasicAuth</code></p><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>Branch</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>branchId</code></td><td><code>EntityId</code></td><td></td></tr><tr><td><code>noteId</code></td><td><code>EntityId</code></td><td>identifies the child note</td></tr><tr><td><code>parentNoteId</code></td><td><code>EntityId</code></td><td>identifies the parent note</td></tr><tr><td><code>prefix</code></td><td><code>string</code></td><td></td></tr><tr><td><code>notePosition</code></td><td><code>integer (int32)</code></td><td></td></tr><tr><td><code>isExpanded</code></td><td><code>boolean</code></td><td></td></tr><tr><td><code>utcDateModified</code></td><td><code>UtcDateTime</code></td><td></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"branchId\": \"evnnmvHTCgIn\",\n \"prefix\": \"string\",\n \"notePosition\": 0,\n \"isExpanded\": 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: existing branch updated</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Branch</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>branchId</code></td><td><code>EntityId</code></td><td></td></tr><tr><td><code>noteId</code></td><td><code>EntityId</code></td><td>identifies the child note</td></tr><tr><td><code>parentNoteId</code></td><td><code>EntityId</code></td><td>identifies the parent note</td></tr><tr><td><code>prefix</code></td><td><code>string</code></td><td></td></tr><tr><td><code>notePosition</code></td><td><code>integer (int32)</code></td><td></td></tr><tr><td><code>isExpanded</code></td><td><code>boolean</code></td><td></td></tr><tr><td><code>utcDateModified</code></td><td><code>UtcDateTime</code></td><td></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"branchId\": \"evnnmvHTCgIn\",\n \"noteId\": \"evnnmvHTCgIn\",\n \"parentNoteId\": \"evnnmvHTCgIn\",\n \"prefix\": \"string\",\n \"notePosition\": 0,\n \"isExpanded\": true,\n \"utcDateModified\": \"2021-12-31 19:18:11.930Z\"\n}</code></pre></div></div></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">201: branch created</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Branch</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>branchId</code></td><td><code>EntityId</code></td><td></td></tr><tr><td><code>noteId</code></td><td><code>EntityId</code></td><td>identifies the child note</td></tr><tr><td><code>parentNoteId</code></td><td><code>EntityId</code></td><td>identifies the parent note</td></tr><tr><td><code>prefix</code></td><td><code>string</code></td><td></td></tr><tr><td><code>notePosition</code></td><td><code>integer (int32)</code></td><td></td></tr><tr><td><code>isExpanded</code></td><td><code>boolean</code></td><td></td></tr><tr><td><code>utcDateModified</code></td><td><code>UtcDateTime</code></td><td></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"branchId\": \"evnnmvHTCgIn\",\n \"noteId\": \"evnnmvHTCgIn\",\n \"parentNoteId\": \"evnnmvHTCgIn\",\n \"prefix\": \"string\",\n \"notePosition\": 0,\n \"isExpanded\": true,\n \"utcDateModified\": \"2021-12-31 19:18:11.930Z\"\n}</code></pre></div></div></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">default: unexpected error</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Error</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>status</code> <br><em>required</em></td><td><code>integer (int32)</code></td><td>HTTP status, identical to the one given in HTTP response</td></tr><tr><td><code>code</code> <br><em>required</em></td><td><code>string</code></td><td>stable string constant</td></tr><tr><td><code>message</code> <br><em>required</em></td><td><code>string</code></td><td>Human readable error, potentially with more details,</td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"status\": 400,\n \"code\": \"NOTE_IS_PROTECTED\",\n \"message\": \"Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI\"\n}</code></pre></div></div></div></section></div><h3>Get a branch</h3><p><code>GET /branches/{branchId}</code> · <code>getBranchById</code></p><p>Returns a branch identified by its ID</p><p><strong>Authorization</strong>: <code>EtapiTokenAuth</code> or <code>EtapiBasicAuth</code></p><p><strong>Parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>In</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>branchId</code> <br><em>required</em></td><td>path</td><td><code>EntityId</code></td><td></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 response</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Branch</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>branchId</code></td><td><code>EntityId</code></td><td></td></tr><tr><td><code>noteId</code></td><td><code>EntityId</code></td><td>identifies the child note</td></tr><tr><td><code>parentNoteId</code></td><td><code>EntityId</code></td><td>identifies the parent note</td></tr><tr><td><code>prefix</code></td><td><code>string</code></td><td></td></tr><tr><td><code>notePosition</code></td><td><code>integer (int32)</code></td><td></td></tr><tr><td><code>isExpanded</code></td><td><code>boolean</code></td><td></td></tr><tr><td><code>utcDateModified</code></td><td><code>UtcDateTime</code></td><td></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"branchId\": \"evnnmvHTCgIn\",\n \"noteId\": \"evnnmvHTCgIn\",\n \"parentNoteId\": \"evnnmvHTCgIn\",\n \"prefix\": \"string\",\n \"notePosition\": 0,\n \"isExpanded\": true,\n \"utcDateModified\": \"2021-12-31 19:18:11.930Z\"\n}</code></pre></div></div></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">default: unexpected error</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Error</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>status</code> <br><em>required</em></td><td><code>integer (int32)</code></td><td>HTTP status, identical to the one given in HTTP response</td></tr><tr><td><code>code</code> <br><em>required</em></td><td><code>string</code></td><td>stable string constant</td></tr><tr><td><code>message</code> <br><em>required</em></td><td><code>string</code></td><td>Human readable error, potentially with more details,</td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"status\": 400,\n \"code\": \"NOTE_IS_PROTECTED\",\n \"message\": \"Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI\"\n}</code></pre></div></div></div></section></div><h3>Delete a branch</h3><p><code>DELETE /branches/{branchId}</code> · <code>deleteBranchById</code></p><p>deletes a branch based on the branchId supplied. If this is the last branch of the (child) note, then the note is deleted as well.</p><p><strong>Authorization</strong>: <code>EtapiTokenAuth</code> or <code>EtapiBasicAuth</code></p><p><strong>Parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>In</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>branchId</code> <br><em>required</em></td><td>path</td><td><code>EntityId</code></td><td></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 deleted</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">default: unexpected error</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Error</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>status</code> <br><em>required</em></td><td><code>integer (int32)</code></td><td>HTTP status, identical to the one given in HTTP response</td></tr><tr><td><code>code</code> <br><em>required</em></td><td><code>string</code></td><td>stable string constant</td></tr><tr><td><code>message</code> <br><em>required</em></td><td><code>string</code></td><td>Human readable error, potentially with more details,</td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"status\": 400,\n \"code\": \"NOTE_IS_PROTECTED\",\n \"message\": \"Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI\"\n}</code></pre></div></div></div></section></div><h3>Update a branch</h3><p><code>PATCH /branches/{branchId}</code> · <code>patchBranchById</code></p><p>patch a branch identified by the branchId with changes in the body. Only prefix and notePosition can be updated. If you want to update other properties, you need to delete the old branch and create a new one.</p><p><strong>Authorization</strong>: <code>EtapiTokenAuth</code> or <code>EtapiBasicAuth</code></p><p><strong>Parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>In</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>branchId</code> <br><em>required</em></td><td>path</td><td><code>EntityId</code></td><td></td></tr></tbody></table></figure><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>Branch</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>branchId</code></td><td><code>EntityId</code></td><td></td></tr><tr><td><code>noteId</code></td><td><code>EntityId</code></td><td>identifies the child note</td></tr><tr><td><code>parentNoteId</code></td><td><code>EntityId</code></td><td>identifies the parent note</td></tr><tr><td><code>prefix</code></td><td><code>string</code></td><td></td></tr><tr><td><code>notePosition</code></td><td><code>integer (int32)</code></td><td></td></tr><tr><td><code>isExpanded</code></td><td><code>boolean</code></td><td></td></tr><tr><td><code>utcDateModified</code></td><td><code>UtcDateTime</code></td><td></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"branchId\": \"evnnmvHTCgIn\",\n \"prefix\": \"string\",\n \"notePosition\": 0,\n \"isExpanded\": 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: branch updated</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Branch</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>branchId</code></td><td><code>EntityId</code></td><td></td></tr><tr><td><code>noteId</code></td><td><code>EntityId</code></td><td>identifies the child note</td></tr><tr><td><code>parentNoteId</code></td><td><code>EntityId</code></td><td>identifies the parent note</td></tr><tr><td><code>prefix</code></td><td><code>string</code></td><td></td></tr><tr><td><code>notePosition</code></td><td><code>integer (int32)</code></td><td></td></tr><tr><td><code>isExpanded</code></td><td><code>boolean</code></td><td></td></tr><tr><td><code>utcDateModified</code></td><td><code>UtcDateTime</code></td><td></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"branchId\": \"evnnmvHTCgIn\",\n \"noteId\": \"evnnmvHTCgIn\",\n \"parentNoteId\": \"evnnmvHTCgIn\",\n \"prefix\": \"string\",\n \"notePosition\": 0,\n \"isExpanded\": true,\n \"utcDateModified\": \"2021-12-31 19:18:11.930Z\"\n}</code></pre></div></div></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">default: unexpected error</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Error</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>status</code> <br><em>required</em></td><td><code>integer (int32)</code></td><td>HTTP status, identical to the one given in HTTP response</td></tr><tr><td><code>code</code> <br><em>required</em></td><td><code>string</code></td><td>stable string constant</td></tr><tr><td><code>message</code> <br><em>required</em></td><td><code>string</code></td><td>Human readable error, potentially with more details,</td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"status\": 400,\n \"code\": \"NOTE_IS_PROTECTED\",\n \"message\": \"Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI\"\n}</code></pre></div></div></div></section></div><h3>Refresh the order of child notes</h3><p><code>POST /refresh-note-ordering/{parentNoteId}</code> · <code>postRefreshNoteOrdering</code></p><p>notePositions in branches are not automatically pushed to connected clients and need a specific instruction. If you want your changes to be in effect immediately, call this service after setting branches' notePosition. Note that you need to supply \"parentNoteId\" of branch(es) with changed positions.</p><p><strong>Authorization</strong>: <code>EtapiTokenAuth</code> or <code>EtapiBasicAuth</code></p><p><strong>Parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>In</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>parentNoteId</code> <br><em>required</em></td><td>path</td><td><code>EntityId</code></td><td></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 ordering refreshed</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">default: unexpected error</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Error</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>status</code> <br><em>required</em></td><td><code>integer (int32)</code></td><td>HTTP status, identical to the one given in HTTP response</td></tr><tr><td><code>code</code> <br><em>required</em></td><td><code>string</code></td><td>stable string constant</td></tr><tr><td><code>message</code> <br><em>required</em></td><td><code>string</code></td><td>Human readable error, potentially with more details,</td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"status\": 400,\n \"code\": \"NOTE_IS_PROTECTED\",\n \"message\": \"Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI\"\n}</code></pre></div></div></div></section></div><h2>Attributes</h2><p>Labels and relations of a note.</p><h3>Create an attribute</h3><p><code>POST /attributes</code> · <code>postAttribute</code></p><p>create an attribute for a given note</p><p><strong>Authorization</strong>: <code>EtapiTokenAuth</code> or <code>EtapiBasicAuth</code></p><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>Attribute</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>attributeId</code></td><td><code>EntityId</code></td><td></td></tr><tr><td><code>noteId</code></td><td><code>EntityId</code></td><td>identifies the child note</td></tr><tr><td><code>type</code></td><td><code>string</code></td><td>One of <code>label</code>, <code>relation</code>.</td></tr><tr><td><code>name</code></td><td><code>string</code></td><td></td></tr><tr><td><code>value</code></td><td><code>string</code></td><td></td></tr><tr><td><code>position</code></td><td><code>integer (int32)</code></td><td></td></tr><tr><td><code>isInheritable</code></td><td><code>boolean</code></td><td></td></tr><tr><td><code>utcDateModified</code></td><td><code>UtcDateTime</code></td><td></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"attributeId\": \"evnnmvHTCgIn\",\n \"type\": \"label\",\n \"name\": \"shareCss\",\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 created</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Attribute</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>attributeId</code></td><td><code>EntityId</code></td><td></td></tr><tr><td><code>noteId</code></td><td><code>EntityId</code></td><td>identifies the child note</td></tr><tr><td><code>type</code></td><td><code>string</code></td><td>One of <code>label</code>, <code>relation</code>.</td></tr><tr><td><code>name</code></td><td><code>string</code></td><td></td></tr><tr><td><code>value</code></td><td><code>string</code></td><td></td></tr><tr><td><code>position</code></td><td><code>integer (int32)</code></td><td></td></tr><tr><td><code>isInheritable</code></td><td><code>boolean</code></td><td></td></tr><tr><td><code>utcDateModified</code></td><td><code>UtcDateTime</code></td><td></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"attributeId\": \"evnnmvHTCgIn\",\n \"noteId\": \"evnnmvHTCgIn\",\n \"type\": \"label\",\n \"name\": \"shareCss\",\n \"value\": \"string\",\n \"position\": 0,\n \"isInheritable\": true,\n \"utcDateModified\": \"2021-12-31 19:18:11.930Z\"\n}</code></pre></div></div></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">default: unexpected error</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Error</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>status</code> <br><em>required</em></td><td><code>integer (int32)</code></td><td>HTTP status, identical to the one given in HTTP response</td></tr><tr><td><code>code</code> <br><em>required</em></td><td><code>string</code></td><td>stable string constant</td></tr><tr><td><code>message</code> <br><em>required</em></td><td><code>string</code></td><td>Human readable error, potentially with more details,</td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"status\": 400,\n \"code\": \"NOTE_IS_PROTECTED\",\n \"message\": \"Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI\"\n}</code></pre></div></div></div></section></div><h3>Get an attribute</h3><p><code>GET /attributes/{attributeId}</code> · <code>getAttributeById</code></p><p>Returns an attribute identified by its ID</p><p><strong>Authorization</strong>: <code>EtapiTokenAuth</code> or <code>EtapiBasicAuth</code></p><p><strong>Parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>In</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>attributeId</code> <br><em>required</em></td><td>path</td><td><code>EntityId</code></td><td></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 response</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Attribute</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>attributeId</code></td><td><code>EntityId</code></td><td></td></tr><tr><td><code>noteId</code></td><td><code>EntityId</code></td><td>identifies the child note</td></tr><tr><td><code>type</code></td><td><code>string</code></td><td>One of <code>label</code>, <code>relation</code>.</td></tr><tr><td><code>name</code></td><td><code>string</code></td><td></td></tr><tr><td><code>value</code></td><td><code>string</code></td><td></td></tr><tr><td><code>position</code></td><td><code>integer (int32)</code></td><td></td></tr><tr><td><code>isInheritable</code></td><td><code>boolean</code></td><td></td></tr><tr><td><code>utcDateModified</code></td><td><code>UtcDateTime</code></td><td></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"attributeId\": \"evnnmvHTCgIn\",\n \"noteId\": \"evnnmvHTCgIn\",\n \"type\": \"label\",\n \"name\": \"shareCss\",\n \"value\": \"string\",\n \"position\": 0,\n \"isInheritable\": true,\n \"utcDateModified\": \"2021-12-31 19:18:11.930Z\"\n}</code></pre></div></div></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">default: unexpected error</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Error</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>status</code> <br><em>required</em></td><td><code>integer (int32)</code></td><td>HTTP status, identical to the one given in HTTP response</td></tr><tr><td><code>code</code> <br><em>required</em></td><td><code>string</code></td><td>stable string constant</td></tr><tr><td><code>message</code> <br><em>required</em></td><td><code>string</code></td><td>Human readable error, potentially with more details,</td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"status\": 400,\n \"code\": \"NOTE_IS_PROTECTED\",\n \"message\": \"Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI\"\n}</code></pre></div></div></div></section></div><h3>Delete an attribute</h3><p><code>DELETE /attributes/{attributeId}</code> · <code>deleteAttributeById</code></p><p>deletes an attribute based on the attributeId supplied.</p><p><strong>Authorization</strong>: <code>EtapiTokenAuth</code> or <code>EtapiBasicAuth</code></p><p><strong>Parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>In</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>attributeId</code> <br><em>required</em></td><td>path</td><td><code>EntityId</code></td><td></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><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">default: unexpected error</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Error</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>status</code> <br><em>required</em></td><td><code>integer (int32)</code></td><td>HTTP status, identical to the one given in HTTP response</td></tr><tr><td><code>code</code> <br><em>required</em></td><td><code>string</code></td><td>stable string constant</td></tr><tr><td><code>message</code> <br><em>required</em></td><td><code>string</code></td><td>Human readable error, potentially with more details,</td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"status\": 400,\n \"code\": \"NOTE_IS_PROTECTED\",\n \"message\": \"Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI\"\n}</code></pre></div></div></div></section></div><h3>Update an attribute</h3><p><code>PATCH /attributes/{attributeId}</code> · <code>patchAttributeById</code></p><p>patch an attribute identified by the attributeId with changes in the body. For labels, only value and position can be updated. For relations, only position can be updated. If you want to modify other properties, you need to delete the old attribute and create a new one.</p><p><strong>Authorization</strong>: <code>EtapiTokenAuth</code> or <code>EtapiBasicAuth</code></p><p><strong>Parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>In</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>attributeId</code> <br><em>required</em></td><td>path</td><td><code>EntityId</code></td><td></td></tr></tbody></table></figure><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>Attribute</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>attributeId</code></td><td><code>EntityId</code></td><td></td></tr><tr><td><code>noteId</code></td><td><code>EntityId</code></td><td>identifies the child note</td></tr><tr><td><code>type</code></td><td><code>string</code></td><td>One of <code>label</code>, <code>relation</code>.</td></tr><tr><td><code>name</code></td><td><code>string</code></td><td></td></tr><tr><td><code>value</code></td><td><code>string</code></td><td></td></tr><tr><td><code>position</code></td><td><code>integer (int32)</code></td><td></td></tr><tr><td><code>isInheritable</code></td><td><code>boolean</code></td><td></td></tr><tr><td><code>utcDateModified</code></td><td><code>UtcDateTime</code></td><td></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"attributeId\": \"evnnmvHTCgIn\",\n \"type\": \"label\",\n \"name\": \"shareCss\",\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: attribute updated</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Attribute</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>attributeId</code></td><td><code>EntityId</code></td><td></td></tr><tr><td><code>noteId</code></td><td><code>EntityId</code></td><td>identifies the child note</td></tr><tr><td><code>type</code></td><td><code>string</code></td><td>One of <code>label</code>, <code>relation</code>.</td></tr><tr><td><code>name</code></td><td><code>string</code></td><td></td></tr><tr><td><code>value</code></td><td><code>string</code></td><td></td></tr><tr><td><code>position</code></td><td><code>integer (int32)</code></td><td></td></tr><tr><td><code>isInheritable</code></td><td><code>boolean</code></td><td></td></tr><tr><td><code>utcDateModified</code></td><td><code>UtcDateTime</code></td><td></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"attributeId\": \"evnnmvHTCgIn\",\n \"noteId\": \"evnnmvHTCgIn\",\n \"type\": \"label\",\n \"name\": \"shareCss\",\n \"value\": \"string\",\n \"position\": 0,\n \"isInheritable\": true,\n \"utcDateModified\": \"2021-12-31 19:18:11.930Z\"\n}</code></pre></div></div></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">default: unexpected error</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Error</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>status</code> <br><em>required</em></td><td><code>integer (int32)</code></td><td>HTTP status, identical to the one given in HTTP response</td></tr><tr><td><code>code</code> <br><em>required</em></td><td><code>string</code></td><td>stable string constant</td></tr><tr><td><code>message</code> <br><em>required</em></td><td><code>string</code></td><td>Human readable error, potentially with more details,</td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"status\": 400,\n \"code\": \"NOTE_IS_PROTECTED\",\n \"message\": \"Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI\"\n}</code></pre></div></div></div></section></div><h2>Attachments</h2><p>Files attached to a note.</p><h3>List the attachments of a note</h3><p><code>GET /notes/{noteId}/attachments</code> · <code>getNoteAttachments</code></p><p>Returns all attachments for a note identified by its ID</p><p><strong>Authorization</strong>: <code>EtapiTokenAuth</code> or <code>EtapiBasicAuth</code></p><p><strong>Parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>In</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td>path</td><td><code>EntityId</code></td><td></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: list of attachments</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>array of Attachment</code></li></ul><pre><code class=\"language-application-json\">[\n {\n \"attachmentId\": \"evnnmvHTCgIn\",\n \"ownerId\": \"evnnmvHTCgIn\",\n \"role\": \"string\",\n \"mime\": \"string\",\n \"title\": \"string\",\n \"position\": 0,\n \"blobId\": \"string\",\n \"dateModified\": \"2021-12-31 20:18:11.930+0100\",\n \"utcDateModified\": \"2021-12-31 19:18:11.930Z\",\n \"utcDateScheduledForErasureSince\": \"2021-12-31 19:18:11.930Z\",\n \"contentLength\": 0\n }\n]</code></pre></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">default: unexpected error</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Error</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>status</code> <br><em>required</em></td><td><code>integer (int32)</code></td><td>HTTP status, identical to the one given in HTTP response</td></tr><tr><td><code>code</code> <br><em>required</em></td><td><code>string</code></td><td>stable string constant</td></tr><tr><td><code>message</code> <br><em>required</em></td><td><code>string</code></td><td>Human readable error, potentially with more details,</td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"status\": 400,\n \"code\": \"NOTE_IS_PROTECTED\",\n \"message\": \"Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI\"\n}</code></pre></div></div></div></section></div><h3>Create an attachment</h3><p><code>POST /attachments</code> · <code>postAttachment</code></p><p>create an attachment</p><p><strong>Authorization</strong>: <code>EtapiTokenAuth</code> or <code>EtapiBasicAuth</code></p><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>CreateAttachment</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>ownerId</code></td><td><code>EntityId</code></td><td>identifies the owner of the attachment, is either noteId or revisionId</td></tr><tr><td><code>role</code></td><td><code>string</code></td><td></td></tr><tr><td><code>mime</code></td><td><code>string</code></td><td></td></tr><tr><td><code>title</code></td><td><code>string</code></td><td></td></tr><tr><td><code>content</code></td><td><code>string</code></td><td>Text content of the attachment, stored as-is. To store binary content, create the attachment without it, then upload the data with <code>PUT /attachments/{attachmentId}/content</code>.</td></tr><tr><td><code>position</code></td><td><code>integer (int32)</code></td><td></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"ownerId\": \"evnnmvHTCgIn\",\n \"role\": \"string\",\n \"mime\": \"string\",\n \"title\": \"string\",\n \"content\": \"string\",\n \"position\": 0\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 created</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Attachment</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>attachmentId</code></td><td><code>EntityId</code></td><td></td></tr><tr><td><code>ownerId</code></td><td><code>EntityId</code></td><td>identifies the owner of the attachment, is either noteId or revisionId</td></tr><tr><td><code>role</code></td><td><code>string</code></td><td></td></tr><tr><td><code>mime</code></td><td><code>string</code></td><td></td></tr><tr><td><code>title</code></td><td><code>string</code></td><td>Title of the attachment. Returned as \"[protected]\" for protected attachments, since ETAPI cannot open a protected session.</td></tr><tr><td><code>position</code></td><td><code>integer (int32)</code></td><td></td></tr><tr><td><code>blobId</code></td><td><code>string</code></td><td>ID of the blob object which effectively serves as a content hash</td></tr><tr><td><code>dateModified</code></td><td><code>LocalDateTime</code></td><td></td></tr><tr><td><code>utcDateModified</code></td><td><code>UtcDateTime</code></td><td></td></tr><tr><td><code>utcDateScheduledForErasureSince</code></td><td><code>UtcDateTime</code></td><td></td></tr><tr><td><code>contentLength</code></td><td><code>integer (int32)</code></td><td></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"attachmentId\": \"evnnmvHTCgIn\",\n \"ownerId\": \"evnnmvHTCgIn\",\n \"role\": \"string\",\n \"mime\": \"string\",\n \"title\": \"string\",\n \"position\": 0,\n \"blobId\": \"string\",\n \"dateModified\": \"2021-12-31 20:18:11.930+0100\",\n \"utcDateModified\": \"2021-12-31 19:18:11.930Z\",\n \"utcDateScheduledForErasureSince\": \"2021-12-31 19:18:11.930Z\",\n \"contentLength\": 0\n}</code></pre></div></div></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">default: unexpected error</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Error</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>status</code> <br><em>required</em></td><td><code>integer (int32)</code></td><td>HTTP status, identical to the one given in HTTP response</td></tr><tr><td><code>code</code> <br><em>required</em></td><td><code>string</code></td><td>stable string constant</td></tr><tr><td><code>message</code> <br><em>required</em></td><td><code>string</code></td><td>Human readable error, potentially with more details,</td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"status\": 400,\n \"code\": \"NOTE_IS_PROTECTED\",\n \"message\": \"Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI\"\n}</code></pre></div></div></div></section></div><h3>Get an attachment</h3><p><code>GET /attachments/{attachmentId}</code> · <code>getAttachmentById</code></p><p>Returns an attachment identified by its ID</p><p><strong>Authorization</strong>: <code>EtapiTokenAuth</code> or <code>EtapiBasicAuth</code></p><p><strong>Parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>In</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>attachmentId</code> <br><em>required</em></td><td>path</td><td><code>EntityId</code></td><td></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 response</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Attachment</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>attachmentId</code></td><td><code>EntityId</code></td><td></td></tr><tr><td><code>ownerId</code></td><td><code>EntityId</code></td><td>identifies the owner of the attachment, is either noteId or revisionId</td></tr><tr><td><code>role</code></td><td><code>string</code></td><td></td></tr><tr><td><code>mime</code></td><td><code>string</code></td><td></td></tr><tr><td><code>title</code></td><td><code>string</code></td><td>Title of the attachment. Returned as \"[protected]\" for protected attachments, since ETAPI cannot open a protected session.</td></tr><tr><td><code>position</code></td><td><code>integer (int32)</code></td><td></td></tr><tr><td><code>blobId</code></td><td><code>string</code></td><td>ID of the blob object which effectively serves as a content hash</td></tr><tr><td><code>dateModified</code></td><td><code>LocalDateTime</code></td><td></td></tr><tr><td><code>utcDateModified</code></td><td><code>UtcDateTime</code></td><td></td></tr><tr><td><code>utcDateScheduledForErasureSince</code></td><td><code>UtcDateTime</code></td><td></td></tr><tr><td><code>contentLength</code></td><td><code>integer (int32)</code></td><td></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"attachmentId\": \"evnnmvHTCgIn\",\n \"ownerId\": \"evnnmvHTCgIn\",\n \"role\": \"string\",\n \"mime\": \"string\",\n \"title\": \"string\",\n \"position\": 0,\n \"blobId\": \"string\",\n \"dateModified\": \"2021-12-31 20:18:11.930+0100\",\n \"utcDateModified\": \"2021-12-31 19:18:11.930Z\",\n \"utcDateScheduledForErasureSince\": \"2021-12-31 19:18:11.930Z\",\n \"contentLength\": 0\n}</code></pre></div></div></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">default: unexpected error</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Error</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>status</code> <br><em>required</em></td><td><code>integer (int32)</code></td><td>HTTP status, identical to the one given in HTTP response</td></tr><tr><td><code>code</code> <br><em>required</em></td><td><code>string</code></td><td>stable string constant</td></tr><tr><td><code>message</code> <br><em>required</em></td><td><code>string</code></td><td>Human readable error, potentially with more details,</td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"status\": 400,\n \"code\": \"NOTE_IS_PROTECTED\",\n \"message\": \"Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI\"\n}</code></pre></div></div></div></section></div><h3>Delete an attachment</h3><p><code>DELETE /attachments/{attachmentId}</code> · <code>deleteAttachmentById</code></p><p>deletes an attachment based on the attachmentId supplied.</p><p><strong>Authorization</strong>: <code>EtapiTokenAuth</code> or <code>EtapiBasicAuth</code></p><p><strong>Parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>In</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>attachmentId</code> <br><em>required</em></td><td>path</td><td><code>EntityId</code></td><td></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><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">default: unexpected error</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Error</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>status</code> <br><em>required</em></td><td><code>integer (int32)</code></td><td>HTTP status, identical to the one given in HTTP response</td></tr><tr><td><code>code</code> <br><em>required</em></td><td><code>string</code></td><td>stable string constant</td></tr><tr><td><code>message</code> <br><em>required</em></td><td><code>string</code></td><td>Human readable error, potentially with more details,</td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"status\": 400,\n \"code\": \"NOTE_IS_PROTECTED\",\n \"message\": \"Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI\"\n}</code></pre></div></div></div></section></div><h3>Update an attachment</h3><p><code>PATCH /attachments/{attachmentId}</code> · <code>patchAttachmentById</code></p><p>patch an attachment identified by the attachmentId with changes in the body. Only role, mime, title, and position are patchable.</p><p><strong>Authorization</strong>: <code>EtapiTokenAuth</code> or <code>EtapiBasicAuth</code></p><p><strong>Parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>In</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>attachmentId</code> <br><em>required</em></td><td>path</td><td><code>EntityId</code></td><td></td></tr></tbody></table></figure><p><strong>Request body</strong> (required)</p><ul><li><code>application/json</code>: <code>Attachment</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>attachmentId</code></td><td><code>EntityId</code></td><td></td></tr><tr><td><code>ownerId</code></td><td><code>EntityId</code></td><td>identifies the owner of the attachment, is either noteId or revisionId</td></tr><tr><td><code>role</code></td><td><code>string</code></td><td></td></tr><tr><td><code>mime</code></td><td><code>string</code></td><td></td></tr><tr><td><code>title</code></td><td><code>string</code></td><td>Title of the attachment. Returned as \"[protected]\" for protected attachments, since ETAPI cannot open a protected session.</td></tr><tr><td><code>position</code></td><td><code>integer (int32)</code></td><td></td></tr><tr><td><code>blobId</code></td><td><code>string</code></td><td>ID of the blob object which effectively serves as a content hash</td></tr><tr><td><code>dateModified</code></td><td><code>LocalDateTime</code></td><td></td></tr><tr><td><code>utcDateModified</code></td><td><code>UtcDateTime</code></td><td></td></tr><tr><td><code>utcDateScheduledForErasureSince</code></td><td><code>UtcDateTime</code></td><td></td></tr><tr><td><code>contentLength</code></td><td><code>integer (int32)</code></td><td></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"ownerId\": \"evnnmvHTCgIn\",\n \"role\": \"string\",\n \"mime\": \"string\",\n \"title\": \"string\",\n \"position\": 0,\n \"blobId\": \"string\",\n \"contentLength\": 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: attribute updated</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Attachment</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>attachmentId</code></td><td><code>EntityId</code></td><td></td></tr><tr><td><code>ownerId</code></td><td><code>EntityId</code></td><td>identifies the owner of the attachment, is either noteId or revisionId</td></tr><tr><td><code>role</code></td><td><code>string</code></td><td></td></tr><tr><td><code>mime</code></td><td><code>string</code></td><td></td></tr><tr><td><code>title</code></td><td><code>string</code></td><td>Title of the attachment. Returned as \"[protected]\" for protected attachments, since ETAPI cannot open a protected session.</td></tr><tr><td><code>position</code></td><td><code>integer (int32)</code></td><td></td></tr><tr><td><code>blobId</code></td><td><code>string</code></td><td>ID of the blob object which effectively serves as a content hash</td></tr><tr><td><code>dateModified</code></td><td><code>LocalDateTime</code></td><td></td></tr><tr><td><code>utcDateModified</code></td><td><code>UtcDateTime</code></td><td></td></tr><tr><td><code>utcDateScheduledForErasureSince</code></td><td><code>UtcDateTime</code></td><td></td></tr><tr><td><code>contentLength</code></td><td><code>integer (int32)</code></td><td></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"attachmentId\": \"evnnmvHTCgIn\",\n \"ownerId\": \"evnnmvHTCgIn\",\n \"role\": \"string\",\n \"mime\": \"string\",\n \"title\": \"string\",\n \"position\": 0,\n \"blobId\": \"string\",\n \"dateModified\": \"2021-12-31 20:18:11.930+0100\",\n \"utcDateModified\": \"2021-12-31 19:18:11.930Z\",\n \"utcDateScheduledForErasureSince\": \"2021-12-31 19:18:11.930Z\",\n \"contentLength\": 0\n}</code></pre></div></div></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">default: unexpected error</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Error</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>status</code> <br><em>required</em></td><td><code>integer (int32)</code></td><td>HTTP status, identical to the one given in HTTP response</td></tr><tr><td><code>code</code> <br><em>required</em></td><td><code>string</code></td><td>stable string constant</td></tr><tr><td><code>message</code> <br><em>required</em></td><td><code>string</code></td><td>Human readable error, potentially with more details,</td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"status\": 400,\n \"code\": \"NOTE_IS_PROTECTED\",\n \"message\": \"Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI\"\n}</code></pre></div></div></div></section></div><h3>Get the content of an attachment</h3><p><code>GET /attachments/{attachmentId}/content</code> · <code>getAttachmentContent</code></p><p>Returns attachment content identified by its ID. The response carries the attachment's MIME type as its <code>Content-Type</code>.</p><p><strong>Authorization</strong>: <code>EtapiTokenAuth</code> or <code>EtapiBasicAuth</code></p><p><strong>Parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>In</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>attachmentId</code> <br><em>required</em></td><td>path</td><td><code>EntityId</code></td><td></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>*/*</code>: <code>string (binary)</code></li></ul></div></section></div><h3>Replace the content of an attachment</h3><p><code>PUT /attachments/{attachmentId}/content</code> · <code>putAttachmentContentById</code></p><p>Updates attachment content identified by its ID</p><p><strong>Authorization</strong>: <code>EtapiTokenAuth</code> or <code>EtapiBasicAuth</code></p><p><strong>Parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>In</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>attachmentId</code> <br><em>required</em></td><td>path</td><td><code>EntityId</code></td><td></td></tr></tbody></table></figure><p><strong>Request body</strong> (required)</p><p>New content of the attachment. Send text as <code>text/plain</code> and binary data (such as an image or a PDF) as <code>application/octet-stream</code>; other content types are not accepted.</p><ul><li><code>text/plain</code>: <code>string</code></li><li><code>application/octet-stream</code>: <code>string (binary)</code></li></ul><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: attachment content updated</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section></div><h2>Revisions</h2><p>Snapshots of a note's content.</p><h3>Create a revision</h3><p><code>POST /notes/{noteId}/revision</code> · <code>createRevision</code></p><p>Create a note revision for the given note</p><p><strong>Authorization</strong>: <code>EtapiTokenAuth</code> or <code>EtapiBasicAuth</code></p><p><strong>Parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>In</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td>path</td><td><code>EntityId</code></td><td></td></tr><tr><td><code>format</code></td><td>query</td><td><code>any</code></td><td>One of <code>html</code>, <code>markdown</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 has been created</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">default: unexpected error</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Error</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>status</code> <br><em>required</em></td><td><code>integer (int32)</code></td><td>HTTP status, identical to the one given in HTTP response</td></tr><tr><td><code>code</code> <br><em>required</em></td><td><code>string</code></td><td>stable string constant</td></tr><tr><td><code>message</code> <br><em>required</em></td><td><code>string</code></td><td>Human readable error, potentially with more details,</td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"status\": 400,\n \"code\": \"NOTE_IS_PROTECTED\",\n \"message\": \"Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI\"\n}</code></pre></div></div></div></section></div><h3>List the revisions of a note</h3><p><code>GET /notes/{noteId}/revisions</code> · <code>getNoteRevisions</code></p><p>Returns the revisions of a note identified by its ID. Protected revisions are omitted, since they cannot be read through ETAPI individually either.</p><p><strong>Authorization</strong>: <code>EtapiTokenAuth</code> or <code>EtapiBasicAuth</code></p><p><strong>Parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>In</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code> <br><em>required</em></td><td>path</td><td><code>EntityId</code></td><td></td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: list of revisions</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>array of Revision</code></li></ul><pre><code class=\"language-application-json\">[\n {\n \"revisionId\": \"evnnmvHTCgIn\",\n \"noteId\": \"evnnmvHTCgIn\",\n \"type\": \"text\",\n \"mime\": \"string\",\n \"isProtected\": true,\n \"title\": \"string\",\n \"blobId\": \"string\",\n \"dateLastEdited\": \"2021-12-31 20:18:11.930+0100\",\n \"dateCreated\": \"2021-12-31 20:18:11.930+0100\",\n \"utcDateLastEdited\": \"2021-12-31 19:18:11.930Z\",\n \"utcDateCreated\": \"2021-12-31 19:18:11.930Z\",\n \"utcDateModified\": \"2021-12-31 19:18:11.930Z\",\n \"contentLength\": 0\n }\n]</code></pre></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">default: unexpected error</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Error</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>status</code> <br><em>required</em></td><td><code>integer (int32)</code></td><td>HTTP status, identical to the one given in HTTP response</td></tr><tr><td><code>code</code> <br><em>required</em></td><td><code>string</code></td><td>stable string constant</td></tr><tr><td><code>message</code> <br><em>required</em></td><td><code>string</code></td><td>Human readable error, potentially with more details,</td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"status\": 400,\n \"code\": \"NOTE_IS_PROTECTED\",\n \"message\": \"Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI\"\n}</code></pre></div></div></div></section></div><h3>Get a revision</h3><p><code>GET /revisions/{revisionId}</code> · <code>getRevisionById</code></p><p>Returns a revision identified by its ID</p><p><strong>Authorization</strong>: <code>EtapiTokenAuth</code> or <code>EtapiBasicAuth</code></p><p><strong>Parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>In</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>revisionId</code> <br><em>required</em></td><td>path</td><td><code>EntityId</code></td><td></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 response</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Revision</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>revisionId</code></td><td><code>EntityId</code></td><td></td></tr><tr><td><code>noteId</code></td><td><code>EntityId</code></td><td></td></tr><tr><td><code>type</code></td><td><code>string</code></td><td>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>webView</code>, <code>shortcut</code>, <code>doc</code>, <code>contentWidget</code>, <code>launcher</code>.</td></tr><tr><td><code>mime</code></td><td><code>string</code></td><td></td></tr><tr><td><code>isProtected</code></td><td><code>boolean</code></td><td></td></tr><tr><td><code>title</code></td><td><code>string</code></td><td></td></tr><tr><td><code>blobId</code></td><td><code>string</code></td><td>ID of the blob object which effectively serves as a content hash</td></tr><tr><td><code>dateLastEdited</code></td><td><code>LocalDateTime</code></td><td></td></tr><tr><td><code>dateCreated</code></td><td><code>LocalDateTime</code></td><td></td></tr><tr><td><code>utcDateLastEdited</code></td><td><code>UtcDateTime</code></td><td></td></tr><tr><td><code>utcDateCreated</code></td><td><code>UtcDateTime</code></td><td></td></tr><tr><td><code>utcDateModified</code></td><td><code>UtcDateTime</code></td><td></td></tr><tr><td><code>contentLength</code></td><td><code>integer (int32)</code></td><td></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"revisionId\": \"evnnmvHTCgIn\",\n \"noteId\": \"evnnmvHTCgIn\",\n \"type\": \"text\",\n \"mime\": \"string\",\n \"isProtected\": true,\n \"title\": \"string\",\n \"blobId\": \"string\",\n \"dateLastEdited\": \"2021-12-31 20:18:11.930+0100\",\n \"dateCreated\": \"2021-12-31 20:18:11.930+0100\",\n \"utcDateLastEdited\": \"2021-12-31 19:18:11.930Z\",\n \"utcDateCreated\": \"2021-12-31 19:18:11.930Z\",\n \"utcDateModified\": \"2021-12-31 19:18:11.930Z\",\n \"contentLength\": 0\n}</code></pre></div></div></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">default: unexpected error</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Error</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>status</code> <br><em>required</em></td><td><code>integer (int32)</code></td><td>HTTP status, identical to the one given in HTTP response</td></tr><tr><td><code>code</code> <br><em>required</em></td><td><code>string</code></td><td>stable string constant</td></tr><tr><td><code>message</code> <br><em>required</em></td><td><code>string</code></td><td>Human readable error, potentially with more details,</td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"status\": 400,\n \"code\": \"NOTE_IS_PROTECTED\",\n \"message\": \"Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI\"\n}</code></pre></div></div></div></section></div><h3>Get the content of a revision</h3><p><code>GET /revisions/{revisionId}/content</code> · <code>getRevisionContent</code></p><p>Returns revision content identified by its ID</p><p><strong>Authorization</strong>: <code>EtapiTokenAuth</code> or <code>EtapiBasicAuth</code></p><p><strong>Parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>In</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>revisionId</code> <br><em>required</em></td><td>path</td><td><code>EntityId</code></td><td></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 response</p><div class=\"trilium-tab-panel\"><ul><li><code>text/html</code>: <code>string</code></li></ul></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">default: unexpected error</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Error</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>status</code> <br><em>required</em></td><td><code>integer (int32)</code></td><td>HTTP status, identical to the one given in HTTP response</td></tr><tr><td><code>code</code> <br><em>required</em></td><td><code>string</code></td><td>stable string constant</td></tr><tr><td><code>message</code> <br><em>required</em></td><td><code>string</code></td><td>Human readable error, potentially with more details,</td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"status\": 400,\n \"code\": \"NOTE_IS_PROTECTED\",\n \"message\": \"Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI\"\n}</code></pre></div></div></div></section></div><h2>Calendar</h2><p>Day, week, month and year notes of the journal, and the inbox note.</p><h3>Get the inbox note</h3><p><code>GET /inbox/{date}</code> · <code>getInboxNote</code></p><p>returns an \"inbox\" note, into which note can be created. Date will be used depending on whether the inbox is a fixed note (identified with #inbox label) or a day note in a journal. A database with neither returns the root note, and ignores the date, rather than creating a journal to hold a day note.</p><p><strong>Authorization</strong>: <code>EtapiTokenAuth</code> or <code>EtapiBasicAuth</code></p><p><strong>Parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>In</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>date</code> <br><em>required</em></td><td>path</td><td><code>string (date)</code></td><td></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; charset=utf-8</code>: <code>Note</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code></td><td><code>EntityId</code></td><td></td></tr><tr><td><code>title</code></td><td><code>string</code></td><td>Title of the note. Returned as \"[protected]\" for protected notes, since ETAPI cannot open a protected session.</td></tr><tr><td><code>type</code></td><td><code>string</code></td><td>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>webView</code>, <code>shortcut</code>, <code>doc</code>, <code>contentWidget</code>, <code>launcher</code>.</td></tr><tr><td><code>mime</code></td><td><code>string</code></td><td></td></tr><tr><td><code>isProtected</code></td><td><code>boolean</code></td><td></td></tr><tr><td><code>blobId</code></td><td><code>string</code></td><td>ID of the blob object which effectively serves as a content hash</td></tr><tr><td><code>attributes</code></td><td><code>AttributeList</code></td><td></td></tr><tr><td><code>parentNoteIds</code></td><td><code>EntityIdList</code></td><td></td></tr><tr><td><code>childNoteIds</code></td><td><code>EntityIdList</code></td><td></td></tr><tr><td><code>parentBranchIds</code></td><td><code>EntityIdList</code></td><td></td></tr><tr><td><code>childBranchIds</code></td><td><code>EntityIdList</code></td><td></td></tr><tr><td><code>dateCreated</code></td><td><code>LocalDateTime</code></td><td></td></tr><tr><td><code>dateModified</code></td><td><code>LocalDateTime</code></td><td></td></tr><tr><td><code>utcDateCreated</code></td><td><code>UtcDateTime</code></td><td></td></tr><tr><td><code>utcDateModified</code></td><td><code>UtcDateTime</code></td><td>Writable through PATCH, e.g. to restore a migrated note's date after its content was rewritten. The local dateModified is derived from it.</td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"noteId\": \"evnnmvHTCgIn\",\n \"title\": \"string\",\n \"type\": \"text\",\n \"mime\": \"string\",\n \"isProtected\": true,\n \"blobId\": \"string\",\n \"attributes\": [\n {\n \"attributeId\": \"evnnmvHTCgIn\",\n \"noteId\": \"evnnmvHTCgIn\",\n \"type\": \"label\",\n \"name\": \"shareCss\",\n \"value\": \"string\",\n \"position\": 0,\n \"isInheritable\": true,\n \"utcDateModified\": \"2021-12-31 19:18:11.930Z\"\n }\n ],\n \"parentNoteIds\": [\n \"evnnmvHTCgIn\"\n ],\n \"childNoteIds\": [\n \"evnnmvHTCgIn\"\n ],\n \"parentBranchIds\": [\n \"evnnmvHTCgIn\"\n ],\n \"childBranchIds\": [\n \"evnnmvHTCgIn\"\n ],\n \"dateCreated\": \"2021-12-31 20:18:11.930+0100\",\n \"dateModified\": \"2021-12-31 20:18:11.930+0100\",\n \"utcDateCreated\": \"2021-12-31 19:18:11.930Z\",\n \"utcDateModified\": \"2021-12-31 19:18:11.930Z\"\n}</code></pre></div></div></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">default: unexpected error</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Error</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>status</code> <br><em>required</em></td><td><code>integer (int32)</code></td><td>HTTP status, identical to the one given in HTTP response</td></tr><tr><td><code>code</code> <br><em>required</em></td><td><code>string</code></td><td>stable string constant</td></tr><tr><td><code>message</code> <br><em>required</em></td><td><code>string</code></td><td>Human readable error, potentially with more details,</td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"status\": 400,\n \"code\": \"NOTE_IS_PROTECTED\",\n \"message\": \"Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI\"\n}</code></pre></div></div></div></section></div><h3>Get a day note</h3><p><code>GET /calendar/days/{date}</code> · <code>getDayNote</code></p><p>returns a day note for a given date. Gets created if doesn't exist.</p><p><strong>Authorization</strong>: <code>EtapiTokenAuth</code> or <code>EtapiBasicAuth</code></p><p><strong>Parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>In</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>date</code> <br><em>required</em></td><td>path</td><td><code>string (date)</code></td><td></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; charset=utf-8</code>: <code>Note</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code></td><td><code>EntityId</code></td><td></td></tr><tr><td><code>title</code></td><td><code>string</code></td><td>Title of the note. Returned as \"[protected]\" for protected notes, since ETAPI cannot open a protected session.</td></tr><tr><td><code>type</code></td><td><code>string</code></td><td>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>webView</code>, <code>shortcut</code>, <code>doc</code>, <code>contentWidget</code>, <code>launcher</code>.</td></tr><tr><td><code>mime</code></td><td><code>string</code></td><td></td></tr><tr><td><code>isProtected</code></td><td><code>boolean</code></td><td></td></tr><tr><td><code>blobId</code></td><td><code>string</code></td><td>ID of the blob object which effectively serves as a content hash</td></tr><tr><td><code>attributes</code></td><td><code>AttributeList</code></td><td></td></tr><tr><td><code>parentNoteIds</code></td><td><code>EntityIdList</code></td><td></td></tr><tr><td><code>childNoteIds</code></td><td><code>EntityIdList</code></td><td></td></tr><tr><td><code>parentBranchIds</code></td><td><code>EntityIdList</code></td><td></td></tr><tr><td><code>childBranchIds</code></td><td><code>EntityIdList</code></td><td></td></tr><tr><td><code>dateCreated</code></td><td><code>LocalDateTime</code></td><td></td></tr><tr><td><code>dateModified</code></td><td><code>LocalDateTime</code></td><td></td></tr><tr><td><code>utcDateCreated</code></td><td><code>UtcDateTime</code></td><td></td></tr><tr><td><code>utcDateModified</code></td><td><code>UtcDateTime</code></td><td>Writable through PATCH, e.g. to restore a migrated note's date after its content was rewritten. The local dateModified is derived from it.</td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"noteId\": \"evnnmvHTCgIn\",\n \"title\": \"string\",\n \"type\": \"text\",\n \"mime\": \"string\",\n \"isProtected\": true,\n \"blobId\": \"string\",\n \"attributes\": [\n {\n \"attributeId\": \"evnnmvHTCgIn\",\n \"noteId\": \"evnnmvHTCgIn\",\n \"type\": \"label\",\n \"name\": \"shareCss\",\n \"value\": \"string\",\n \"position\": 0,\n \"isInheritable\": true,\n \"utcDateModified\": \"2021-12-31 19:18:11.930Z\"\n }\n ],\n \"parentNoteIds\": [\n \"evnnmvHTCgIn\"\n ],\n \"childNoteIds\": [\n \"evnnmvHTCgIn\"\n ],\n \"parentBranchIds\": [\n \"evnnmvHTCgIn\"\n ],\n \"childBranchIds\": [\n \"evnnmvHTCgIn\"\n ],\n \"dateCreated\": \"2021-12-31 20:18:11.930+0100\",\n \"dateModified\": \"2021-12-31 20:18:11.930+0100\",\n \"utcDateCreated\": \"2021-12-31 19:18:11.930Z\",\n \"utcDateModified\": \"2021-12-31 19:18:11.930Z\"\n}</code></pre></div></div></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">default: unexpected error</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Error</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>status</code> <br><em>required</em></td><td><code>integer (int32)</code></td><td>HTTP status, identical to the one given in HTTP response</td></tr><tr><td><code>code</code> <br><em>required</em></td><td><code>string</code></td><td>stable string constant</td></tr><tr><td><code>message</code> <br><em>required</em></td><td><code>string</code></td><td>Human readable error, potentially with more details,</td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"status\": 400,\n \"code\": \"NOTE_IS_PROTECTED\",\n \"message\": \"Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI\"\n}</code></pre></div></div></div></section></div><h3>Get the day note starting the week</h3><p><code>GET /calendar/week-first-day/{date}</code> · <code>getWeekFirstDayNote</code></p><p>Returns the day note for the first day of the week containing the given date, honouring the configured first day of week. The note is created if it doesn't exist. This returns a day note, not a week note, so unlike /calendar/weeks/{week} it does not require the enableWeekNote label on the calendar root.</p><p><strong>Authorization</strong>: <code>EtapiTokenAuth</code> or <code>EtapiBasicAuth</code></p><p><strong>Parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>In</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>date</code> <br><em>required</em></td><td>path</td><td><code>string (date)</code></td><td>Any date within the week, in the format YYYY-MM-DD.</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 starting the week</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Note</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code></td><td><code>EntityId</code></td><td></td></tr><tr><td><code>title</code></td><td><code>string</code></td><td>Title of the note. Returned as \"[protected]\" for protected notes, since ETAPI cannot open a protected session.</td></tr><tr><td><code>type</code></td><td><code>string</code></td><td>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>webView</code>, <code>shortcut</code>, <code>doc</code>, <code>contentWidget</code>, <code>launcher</code>.</td></tr><tr><td><code>mime</code></td><td><code>string</code></td><td></td></tr><tr><td><code>isProtected</code></td><td><code>boolean</code></td><td></td></tr><tr><td><code>blobId</code></td><td><code>string</code></td><td>ID of the blob object which effectively serves as a content hash</td></tr><tr><td><code>attributes</code></td><td><code>AttributeList</code></td><td></td></tr><tr><td><code>parentNoteIds</code></td><td><code>EntityIdList</code></td><td></td></tr><tr><td><code>childNoteIds</code></td><td><code>EntityIdList</code></td><td></td></tr><tr><td><code>parentBranchIds</code></td><td><code>EntityIdList</code></td><td></td></tr><tr><td><code>childBranchIds</code></td><td><code>EntityIdList</code></td><td></td></tr><tr><td><code>dateCreated</code></td><td><code>LocalDateTime</code></td><td></td></tr><tr><td><code>dateModified</code></td><td><code>LocalDateTime</code></td><td></td></tr><tr><td><code>utcDateCreated</code></td><td><code>UtcDateTime</code></td><td></td></tr><tr><td><code>utcDateModified</code></td><td><code>UtcDateTime</code></td><td>Writable through PATCH, e.g. to restore a migrated note's date after its content was rewritten. The local dateModified is derived from it.</td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"noteId\": \"evnnmvHTCgIn\",\n \"title\": \"string\",\n \"type\": \"text\",\n \"mime\": \"string\",\n \"isProtected\": true,\n \"blobId\": \"string\",\n \"attributes\": [\n {\n \"attributeId\": \"evnnmvHTCgIn\",\n \"noteId\": \"evnnmvHTCgIn\",\n \"type\": \"label\",\n \"name\": \"shareCss\",\n \"value\": \"string\",\n \"position\": 0,\n \"isInheritable\": true,\n \"utcDateModified\": \"2021-12-31 19:18:11.930Z\"\n }\n ],\n \"parentNoteIds\": [\n \"evnnmvHTCgIn\"\n ],\n \"childNoteIds\": [\n \"evnnmvHTCgIn\"\n ],\n \"parentBranchIds\": [\n \"evnnmvHTCgIn\"\n ],\n \"childBranchIds\": [\n \"evnnmvHTCgIn\"\n ],\n \"dateCreated\": \"2021-12-31 20:18:11.930+0100\",\n \"dateModified\": \"2021-12-31 20:18:11.930+0100\",\n \"utcDateCreated\": \"2021-12-31 19:18:11.930Z\",\n \"utcDateModified\": \"2021-12-31 19:18:11.930Z\"\n}</code></pre></div></div></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">default: unexpected error</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Error</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>status</code> <br><em>required</em></td><td><code>integer (int32)</code></td><td>HTTP status, identical to the one given in HTTP response</td></tr><tr><td><code>code</code> <br><em>required</em></td><td><code>string</code></td><td>stable string constant</td></tr><tr><td><code>message</code> <br><em>required</em></td><td><code>string</code></td><td>Human readable error, potentially with more details,</td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"status\": 400,\n \"code\": \"NOTE_IS_PROTECTED\",\n \"message\": \"Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI\"\n}</code></pre></div></div></div></section></div><h3>Get a week note</h3><p><code>GET /calendar/weeks/{week}</code> · <code>getWeekNote</code></p><p>Returns a week note for a given ISO week (format YYYY-Www, e.g., 2025-W01). The note is created if it doesn't exist.</p><p><strong>Authorization</strong>: <code>EtapiTokenAuth</code> or <code>EtapiBasicAuth</code></p><p><strong>Parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>In</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>week</code> <br><em>required</em></td><td>path</td><td><code>string</code></td><td>The ISO 8601 week identifier (YYYY-Www).</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; charset=utf-8</code>: <code>Note</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code></td><td><code>EntityId</code></td><td></td></tr><tr><td><code>title</code></td><td><code>string</code></td><td>Title of the note. Returned as \"[protected]\" for protected notes, since ETAPI cannot open a protected session.</td></tr><tr><td><code>type</code></td><td><code>string</code></td><td>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>webView</code>, <code>shortcut</code>, <code>doc</code>, <code>contentWidget</code>, <code>launcher</code>.</td></tr><tr><td><code>mime</code></td><td><code>string</code></td><td></td></tr><tr><td><code>isProtected</code></td><td><code>boolean</code></td><td></td></tr><tr><td><code>blobId</code></td><td><code>string</code></td><td>ID of the blob object which effectively serves as a content hash</td></tr><tr><td><code>attributes</code></td><td><code>AttributeList</code></td><td></td></tr><tr><td><code>parentNoteIds</code></td><td><code>EntityIdList</code></td><td></td></tr><tr><td><code>childNoteIds</code></td><td><code>EntityIdList</code></td><td></td></tr><tr><td><code>parentBranchIds</code></td><td><code>EntityIdList</code></td><td></td></tr><tr><td><code>childBranchIds</code></td><td><code>EntityIdList</code></td><td></td></tr><tr><td><code>dateCreated</code></td><td><code>LocalDateTime</code></td><td></td></tr><tr><td><code>dateModified</code></td><td><code>LocalDateTime</code></td><td></td></tr><tr><td><code>utcDateCreated</code></td><td><code>UtcDateTime</code></td><td></td></tr><tr><td><code>utcDateModified</code></td><td><code>UtcDateTime</code></td><td>Writable through PATCH, e.g. to restore a migrated note's date after its content was rewritten. The local dateModified is derived from it.</td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"noteId\": \"evnnmvHTCgIn\",\n \"title\": \"string\",\n \"type\": \"text\",\n \"mime\": \"string\",\n \"isProtected\": true,\n \"blobId\": \"string\",\n \"attributes\": [\n {\n \"attributeId\": \"evnnmvHTCgIn\",\n \"noteId\": \"evnnmvHTCgIn\",\n \"type\": \"label\",\n \"name\": \"shareCss\",\n \"value\": \"string\",\n \"position\": 0,\n \"isInheritable\": true,\n \"utcDateModified\": \"2021-12-31 19:18:11.930Z\"\n }\n ],\n \"parentNoteIds\": [\n \"evnnmvHTCgIn\"\n ],\n \"childNoteIds\": [\n \"evnnmvHTCgIn\"\n ],\n \"parentBranchIds\": [\n \"evnnmvHTCgIn\"\n ],\n \"childBranchIds\": [\n \"evnnmvHTCgIn\"\n ],\n \"dateCreated\": \"2021-12-31 20:18:11.930+0100\",\n \"dateModified\": \"2021-12-31 20:18:11.930+0100\",\n \"utcDateCreated\": \"2021-12-31 19:18:11.930Z\",\n \"utcDateModified\": \"2021-12-31 19:18:11.930Z\"\n}</code></pre></div></div></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">default: unexpected error</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Error</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>status</code> <br><em>required</em></td><td><code>integer (int32)</code></td><td>HTTP status, identical to the one given in HTTP response</td></tr><tr><td><code>code</code> <br><em>required</em></td><td><code>string</code></td><td>stable string constant</td></tr><tr><td><code>message</code> <br><em>required</em></td><td><code>string</code></td><td>Human readable error, potentially with more details,</td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"status\": 400,\n \"code\": \"NOTE_IS_PROTECTED\",\n \"message\": \"Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI\"\n}</code></pre></div></div></div></section></div><h3>Get a month note</h3><p><code>GET /calendar/months/{month}</code> · <code>getMonthNote</code></p><p>Returns a month note for a given month (format YYYY-MM, e.g., 2022-02). The note is created if it doesn't exist.</p><p><strong>Authorization</strong>: <code>EtapiTokenAuth</code> or <code>EtapiBasicAuth</code></p><p><strong>Parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>In</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>month</code> <br><em>required</em></td><td>path</td><td><code>string</code></td><td></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; charset=utf-8</code>: <code>Note</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code></td><td><code>EntityId</code></td><td></td></tr><tr><td><code>title</code></td><td><code>string</code></td><td>Title of the note. Returned as \"[protected]\" for protected notes, since ETAPI cannot open a protected session.</td></tr><tr><td><code>type</code></td><td><code>string</code></td><td>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>webView</code>, <code>shortcut</code>, <code>doc</code>, <code>contentWidget</code>, <code>launcher</code>.</td></tr><tr><td><code>mime</code></td><td><code>string</code></td><td></td></tr><tr><td><code>isProtected</code></td><td><code>boolean</code></td><td></td></tr><tr><td><code>blobId</code></td><td><code>string</code></td><td>ID of the blob object which effectively serves as a content hash</td></tr><tr><td><code>attributes</code></td><td><code>AttributeList</code></td><td></td></tr><tr><td><code>parentNoteIds</code></td><td><code>EntityIdList</code></td><td></td></tr><tr><td><code>childNoteIds</code></td><td><code>EntityIdList</code></td><td></td></tr><tr><td><code>parentBranchIds</code></td><td><code>EntityIdList</code></td><td></td></tr><tr><td><code>childBranchIds</code></td><td><code>EntityIdList</code></td><td></td></tr><tr><td><code>dateCreated</code></td><td><code>LocalDateTime</code></td><td></td></tr><tr><td><code>dateModified</code></td><td><code>LocalDateTime</code></td><td></td></tr><tr><td><code>utcDateCreated</code></td><td><code>UtcDateTime</code></td><td></td></tr><tr><td><code>utcDateModified</code></td><td><code>UtcDateTime</code></td><td>Writable through PATCH, e.g. to restore a migrated note's date after its content was rewritten. The local dateModified is derived from it.</td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"noteId\": \"evnnmvHTCgIn\",\n \"title\": \"string\",\n \"type\": \"text\",\n \"mime\": \"string\",\n \"isProtected\": true,\n \"blobId\": \"string\",\n \"attributes\": [\n {\n \"attributeId\": \"evnnmvHTCgIn\",\n \"noteId\": \"evnnmvHTCgIn\",\n \"type\": \"label\",\n \"name\": \"shareCss\",\n \"value\": \"string\",\n \"position\": 0,\n \"isInheritable\": true,\n \"utcDateModified\": \"2021-12-31 19:18:11.930Z\"\n }\n ],\n \"parentNoteIds\": [\n \"evnnmvHTCgIn\"\n ],\n \"childNoteIds\": [\n \"evnnmvHTCgIn\"\n ],\n \"parentBranchIds\": [\n \"evnnmvHTCgIn\"\n ],\n \"childBranchIds\": [\n \"evnnmvHTCgIn\"\n ],\n \"dateCreated\": \"2021-12-31 20:18:11.930+0100\",\n \"dateModified\": \"2021-12-31 20:18:11.930+0100\",\n \"utcDateCreated\": \"2021-12-31 19:18:11.930Z\",\n \"utcDateModified\": \"2021-12-31 19:18:11.930Z\"\n}</code></pre></div></div></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">default: unexpected error</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Error</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>status</code> <br><em>required</em></td><td><code>integer (int32)</code></td><td>HTTP status, identical to the one given in HTTP response</td></tr><tr><td><code>code</code> <br><em>required</em></td><td><code>string</code></td><td>stable string constant</td></tr><tr><td><code>message</code> <br><em>required</em></td><td><code>string</code></td><td>Human readable error, potentially with more details,</td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"status\": 400,\n \"code\": \"NOTE_IS_PROTECTED\",\n \"message\": \"Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI\"\n}</code></pre></div></div></div></section></div><h3>Get a year note</h3><p><code>GET /calendar/years/{year}</code> · <code>getYearNote</code></p><p>Returns a year note for a given year (format YYYY, e.g., 2022). The note is created if it doesn't exist.</p><p><strong>Authorization</strong>: <code>EtapiTokenAuth</code> or <code>EtapiBasicAuth</code></p><p><strong>Parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>In</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>year</code> <br><em>required</em></td><td>path</td><td><code>string</code></td><td></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; charset=utf-8</code>: <code>Note</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code></td><td><code>EntityId</code></td><td></td></tr><tr><td><code>title</code></td><td><code>string</code></td><td>Title of the note. Returned as \"[protected]\" for protected notes, since ETAPI cannot open a protected session.</td></tr><tr><td><code>type</code></td><td><code>string</code></td><td>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>webView</code>, <code>shortcut</code>, <code>doc</code>, <code>contentWidget</code>, <code>launcher</code>.</td></tr><tr><td><code>mime</code></td><td><code>string</code></td><td></td></tr><tr><td><code>isProtected</code></td><td><code>boolean</code></td><td></td></tr><tr><td><code>blobId</code></td><td><code>string</code></td><td>ID of the blob object which effectively serves as a content hash</td></tr><tr><td><code>attributes</code></td><td><code>AttributeList</code></td><td></td></tr><tr><td><code>parentNoteIds</code></td><td><code>EntityIdList</code></td><td></td></tr><tr><td><code>childNoteIds</code></td><td><code>EntityIdList</code></td><td></td></tr><tr><td><code>parentBranchIds</code></td><td><code>EntityIdList</code></td><td></td></tr><tr><td><code>childBranchIds</code></td><td><code>EntityIdList</code></td><td></td></tr><tr><td><code>dateCreated</code></td><td><code>LocalDateTime</code></td><td></td></tr><tr><td><code>dateModified</code></td><td><code>LocalDateTime</code></td><td></td></tr><tr><td><code>utcDateCreated</code></td><td><code>UtcDateTime</code></td><td></td></tr><tr><td><code>utcDateModified</code></td><td><code>UtcDateTime</code></td><td>Writable through PATCH, e.g. to restore a migrated note's date after its content was rewritten. The local dateModified is derived from it.</td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"noteId\": \"evnnmvHTCgIn\",\n \"title\": \"string\",\n \"type\": \"text\",\n \"mime\": \"string\",\n \"isProtected\": true,\n \"blobId\": \"string\",\n \"attributes\": [\n {\n \"attributeId\": \"evnnmvHTCgIn\",\n \"noteId\": \"evnnmvHTCgIn\",\n \"type\": \"label\",\n \"name\": \"shareCss\",\n \"value\": \"string\",\n \"position\": 0,\n \"isInheritable\": true,\n \"utcDateModified\": \"2021-12-31 19:18:11.930Z\"\n }\n ],\n \"parentNoteIds\": [\n \"evnnmvHTCgIn\"\n ],\n \"childNoteIds\": [\n \"evnnmvHTCgIn\"\n ],\n \"parentBranchIds\": [\n \"evnnmvHTCgIn\"\n ],\n \"childBranchIds\": [\n \"evnnmvHTCgIn\"\n ],\n \"dateCreated\": \"2021-12-31 20:18:11.930+0100\",\n \"dateModified\": \"2021-12-31 20:18:11.930+0100\",\n \"utcDateCreated\": \"2021-12-31 19:18:11.930Z\",\n \"utcDateModified\": \"2021-12-31 19:18:11.930Z\"\n}</code></pre></div></div></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">default: unexpected error</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Error</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>status</code> <br><em>required</em></td><td><code>integer (int32)</code></td><td>HTTP status, identical to the one given in HTTP response</td></tr><tr><td><code>code</code> <br><em>required</em></td><td><code>string</code></td><td>stable string constant</td></tr><tr><td><code>message</code> <br><em>required</em></td><td><code>string</code></td><td>Human readable error, potentially with more details,</td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"status\": 400,\n \"code\": \"NOTE_IS_PROTECTED\",\n \"message\": \"Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI\"\n}</code></pre></div></div></div></section></div><h2>Tokens</h2><p>Obtaining and revoking ETAPI tokens with the password.</p><h3>Log in</h3><p><code>POST /auth/login</code> · <code>login</code></p><p>get an ETAPI token based on password for further use with ETAPI. Too many requests from one IP address within a short time, such as failed logins, block that address for a while.</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>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>password</code></td><td><code>string</code></td><td>user's password used to e.g. login to Trilium server and/or protect notes</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\">201: auth token</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>object</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>authToken</code></td><td><code>string</code></td><td></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"authToken\": \"Bc4bFn0Ffiok_4NpbVCDnFz7B2WU+pdhW8B5Ne3DiR5wXrEyqdjgRIsk=\"\n}</code></pre></div></div></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">429: too many requests</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">default: unexpected error</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Error</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>status</code> <br><em>required</em></td><td><code>integer (int32)</code></td><td>HTTP status, identical to the one given in HTTP response</td></tr><tr><td><code>code</code> <br><em>required</em></td><td><code>string</code></td><td>stable string constant</td></tr><tr><td><code>message</code> <br><em>required</em></td><td><code>string</code></td><td>Human readable error, potentially with more details,</td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"status\": 400,\n \"code\": \"NOTE_IS_PROTECTED\",\n \"message\": \"Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI\"\n}</code></pre></div></div></div></section></div><h3>Log out</h3><p><code>POST /auth/logout</code> · <code>logout</code></p><p>logout (delete/deactivate) an ETAPI token</p><p><strong>Authorization</strong>: <code>EtapiTokenAuth</code> or <code>EtapiBasicAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: logout successful</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">default: unexpected error</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Error</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>status</code> <br><em>required</em></td><td><code>integer (int32)</code></td><td>HTTP status, identical to the one given in HTTP response</td></tr><tr><td><code>code</code> <br><em>required</em></td><td><code>string</code></td><td>stable string constant</td></tr><tr><td><code>message</code> <br><em>required</em></td><td><code>string</code></td><td>Human readable error, potentially with more details,</td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"status\": 400,\n \"code\": \"NOTE_IS_PROTECTED\",\n \"message\": \"Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI\"\n}</code></pre></div></div></div></section></div><h2>Application</h2><p>Information about the instance, backups and metrics.</p><h3>Get application info</h3><p><code>GET /app-info</code> · <code>getAppInfo</code></p><p>returns information about the running Trilium instance</p><p><strong>Authorization</strong>: <code>EtapiTokenAuth</code> or <code>EtapiBasicAuth</code></p><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">200: app info</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>AppInfo</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>appVersion</code></td><td><code>string</code></td><td>Trilium version</td></tr><tr><td><code>dbVersion</code></td><td><code>integer (int32)</code></td><td>DB version</td></tr><tr><td><code>syncVersion</code></td><td><code>integer (int32)</code></td><td>Sync protocol version</td></tr><tr><td><code>buildDate</code></td><td><code>string (date-time)</code></td><td>build date</td></tr><tr><td><code>buildRevision</code></td><td><code>string</code></td><td>git build revision</td></tr><tr><td><code>dataDirectory</code></td><td><code>string</code></td><td>data directory where Trilium stores files</td></tr><tr><td><code>clipperProtocolVersion</code></td><td><code>string</code></td><td>version of the supported Trilium Web Clipper protocol</td></tr><tr><td><code>utcDateTime</code></td><td><code>string</code></td><td>current UTC date time</td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"appVersion\": \"0.50.2\",\n \"dbVersion\": 194,\n \"syncVersion\": 25,\n \"buildDate\": \"2022-02-09T22:52:36+01:00\",\n \"buildRevision\": \"23daaa2387a0655685377f0a541d154aeec2aae8\",\n \"dataDirectory\": \"/home/user/data\",\n \"clipperProtocolVersion\": 1.1,\n \"utcDateTime\": \"2022-03-07T21:54:25.277Z\"\n}</code></pre></div></div></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">default: unexpected error</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Error</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>status</code> <br><em>required</em></td><td><code>integer (int32)</code></td><td>HTTP status, identical to the one given in HTTP response</td></tr><tr><td><code>code</code> <br><em>required</em></td><td><code>string</code></td><td>stable string constant</td></tr><tr><td><code>message</code> <br><em>required</em></td><td><code>string</code></td><td>Human readable error, potentially with more details,</td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"status\": 400,\n \"code\": \"NOTE_IS_PROTECTED\",\n \"message\": \"Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI\"\n}</code></pre></div></div></div></section></div><h3>Create a backup</h3><p><code>PUT /backup/{backupName}</code> · <code>createBackup</code></p><p>Create a database backup under a given name</p><p><strong>Authorization</strong>: <code>EtapiTokenAuth</code> or <code>EtapiBasicAuth</code></p><p><strong>Parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>In</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>backupName</code> <br><em>required</em></td><td>path</td><td><code>StringId</code></td><td>If the backupName is e.g. \"now\", then the backup will be written to \"backup-now.db\" file</td></tr></tbody></table></figure><p><strong>Responses</strong></p><div class=\"trilium-tabs\"><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">204: backup has been created</p><div class=\"trilium-tab-panel\"><p>No content.</p></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">default: unexpected error</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Error</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>status</code> <br><em>required</em></td><td><code>integer (int32)</code></td><td>HTTP status, identical to the one given in HTTP response</td></tr><tr><td><code>code</code> <br><em>required</em></td><td><code>string</code></td><td>stable string constant</td></tr><tr><td><code>message</code> <br><em>required</em></td><td><code>string</code></td><td>Human readable error, potentially with more details,</td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"status\": 400,\n \"code\": \"NOTE_IS_PROTECTED\",\n \"message\": \"Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI\"\n}</code></pre></div></div></div></section></div><h3>Get instance metrics</h3><p><code>GET /metrics</code> · <code>getMetrics</code></p><p>Returns instance and database metrics for monitoring: note, attachment, revision, branch, attribute and blob counts, note and attachment type breakdowns, version information and database size. Counts only — no note titles, content or attributes.</p><p>The same data is served by GET /api/metrics to the web session.</p><p><strong>Authorization</strong>: <code>EtapiTokenAuth</code> or <code>EtapiBasicAuth</code></p><p><strong>Parameters</strong></p><figure class=\"table\"><table><thead><tr><th>Name</th><th>In</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>format</code></td><td>query</td><td><code>string</code></td><td>Response format. Defaults to Prometheus text. 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: instance metrics</p><div class=\"trilium-tab-panel\"><ul><li><code>text/plain</code>: <code>string</code></li><li><code>application/json</code>: <code>Metrics</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>version</code></td><td><code>object</code></td><td></td></tr><tr><td><code>database</code></td><td><code>object</code></td><td></td></tr><tr><td><code>noteTypes</code></td><td><code>object</code></td><td>Number of active notes per note type</td></tr><tr><td><code>attachmentTypes</code></td><td><code>object</code></td><td>Number of active attachments per MIME type</td></tr><tr><td><code>statistics</code></td><td><code>object</code></td><td></td></tr><tr><td><code>timestamp</code></td><td><code>string</code></td><td></td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"version\": {\n \"app\": \"0.99.3\",\n \"db\": 231,\n \"node\": \"v22.14.0\",\n \"sync\": 35,\n \"buildDate\": \"2024-09-07T18:36:34Z\",\n \"buildRevision\": \"7c0d6930fa8f20d269dcfbcbc8f636a25f6bb9a7\"\n },\n \"database\": {\n \"totalNotes\": 0,\n \"deletedNotes\": 0,\n \"activeNotes\": 0,\n \"protectedNotes\": 0,\n \"totalAttachments\": 0,\n \"deletedAttachments\": 0,\n \"activeAttachments\": 0,\n \"totalRevisions\": 0,\n \"totalBranches\": 0,\n \"totalAttributes\": 0,\n \"totalBlobs\": 0,\n \"totalEtapiTokens\": 0,\n \"totalRecentNotes\": 0\n },\n \"noteTypes\": {\n \"text\": 800,\n \"code\": 200\n },\n \"attachmentTypes\": {\n \"image/png\": 45,\n \"application/pdf\": 14\n },\n \"statistics\": {\n \"oldestNote\": \"string\",\n \"newestNote\": \"string\",\n \"lastModified\": \"string\",\n \"databaseSizeBytes\": 0\n },\n \"timestamp\": \"2024-12-01T12:00:00.000Z\"\n}</code></pre></div></div></div></section><section class=\"trilium-tab\"><p class=\"trilium-tab-title\">default: unexpected error</p><div class=\"trilium-tab-panel\"><ul><li><code>application/json; charset=utf-8</code>: <code>Error</code></li></ul><div class=\"trilium-multicolumn-layout\" data-trilium-column-ratios=\"1-1\"><div class=\"trilium-multicolumn-column\"><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>status</code> <br><em>required</em></td><td><code>integer (int32)</code></td><td>HTTP status, identical to the one given in HTTP response</td></tr><tr><td><code>code</code> <br><em>required</em></td><td><code>string</code></td><td>stable string constant</td></tr><tr><td><code>message</code> <br><em>required</em></td><td><code>string</code></td><td>Human readable error, potentially with more details,</td></tr></tbody></table></figure></div><div class=\"trilium-multicolumn-column\"><pre><code class=\"language-application-json\">{\n \"status\": 400,\n \"code\": \"NOTE_IS_PROTECTED\",\n \"message\": \"Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI\"\n}</code></pre></div></div></div></section></div><h2>Schemas</h2><h3><code>CreateNoteDef</code></h3><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>parentNoteId</code> <br><em>required</em></td><td><code>EntityId</code></td><td>Note ID of the parent note in the tree</td></tr><tr><td><code>title</code> <br><em>required</em></td><td><code>string</code></td><td></td></tr><tr><td><code>type</code> <br><em>required</em></td><td><code>string</code></td><td>One of <code>text</code>, <code>code</code>, <code>file</code>, <code>image</code>, <code>search</code>, <code>book</code>, <code>relationMap</code>, <code>render</code>.</td></tr><tr><td><code>mime</code></td><td><code>string</code></td><td>this needs to be specified only for note types 'code', 'file', 'image'.</td></tr><tr><td><code>content</code> <br><em>required</em></td><td><code>string</code></td><td></td></tr><tr><td><code>notePosition</code></td><td><code>integer</code></td><td>Position of the note in the parent. Normal ordering is 10, 20, 30 ... So if you want to create a note on the first position, use e.g. 5, for second position 15, for last e.g. 1000000</td></tr><tr><td><code>prefix</code></td><td><code>string</code></td><td>Prefix is branch (placement) specific title prefix for the note. Let's say you have your note placed into two different places in the tree, but you want to change the title a bit in one of the placements. For this you can use prefix.</td></tr><tr><td><code>isExpanded</code></td><td><code>boolean</code></td><td>true if this note (as a folder) should appear expanded</td></tr><tr><td><code>noteId</code></td><td><code>EntityId</code></td><td>DON'T specify unless you want to force a specific noteId</td></tr><tr><td><code>branchId</code></td><td><code>EntityId</code></td><td>DON'T specify unless you want to force a specific branchId</td></tr><tr><td><code>dateCreated</code></td><td><code>LocalDateTime</code></td><td>Local timestap of the note creation. Specify only if you want to override the default (current datetime in the current timezone/offset).</td></tr><tr><td><code>utcDateCreated</code></td><td><code>UtcDateTime</code></td><td>UTC timestap of the note creation. Specify only if you want to override the default (current datetime).</td></tr><tr><td><code>utcDateModified</code></td><td><code>UtcDateTime</code></td><td>UTC timestamp of the note's last modification, e.g. to keep the date of a note being migrated from another application. The local dateModified is derived from it. Specify only if you want to override the default (current datetime).</td></tr></tbody></table></figure><h3><code>Note</code></h3><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code></td><td><code>EntityId</code></td><td></td></tr><tr><td><code>title</code></td><td><code>string</code></td><td>Title of the note. Returned as \"[protected]\" for protected notes, since ETAPI cannot open a protected session.</td></tr><tr><td><code>type</code></td><td><code>string</code></td><td>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>webView</code>, <code>shortcut</code>, <code>doc</code>, <code>contentWidget</code>, <code>launcher</code>.</td></tr><tr><td><code>mime</code></td><td><code>string</code></td><td></td></tr><tr><td><code>isProtected</code></td><td><code>boolean</code></td><td></td></tr><tr><td><code>blobId</code></td><td><code>string</code></td><td>ID of the blob object which effectively serves as a content hash</td></tr><tr><td><code>attributes</code></td><td><code>AttributeList</code></td><td></td></tr><tr><td><code>parentNoteIds</code></td><td><code>EntityIdList</code></td><td></td></tr><tr><td><code>childNoteIds</code></td><td><code>EntityIdList</code></td><td></td></tr><tr><td><code>parentBranchIds</code></td><td><code>EntityIdList</code></td><td></td></tr><tr><td><code>childBranchIds</code></td><td><code>EntityIdList</code></td><td></td></tr><tr><td><code>dateCreated</code></td><td><code>LocalDateTime</code></td><td></td></tr><tr><td><code>dateModified</code></td><td><code>LocalDateTime</code></td><td></td></tr><tr><td><code>utcDateCreated</code></td><td><code>UtcDateTime</code></td><td></td></tr><tr><td><code>utcDateModified</code></td><td><code>UtcDateTime</code></td><td>Writable through PATCH, e.g. to restore a migrated note's date after its content was rewritten. The local dateModified is derived from it.</td></tr></tbody></table></figure><h3><code>Branch</code></h3><p>Branch places the note into the tree, it represents the relationship between a parent note and child note</p><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>branchId</code></td><td><code>EntityId</code></td><td></td></tr><tr><td><code>noteId</code></td><td><code>EntityId</code></td><td>identifies the child note</td></tr><tr><td><code>parentNoteId</code></td><td><code>EntityId</code></td><td>identifies the parent note</td></tr><tr><td><code>prefix</code></td><td><code>string</code></td><td></td></tr><tr><td><code>notePosition</code></td><td><code>integer (int32)</code></td><td></td></tr><tr><td><code>isExpanded</code></td><td><code>boolean</code></td><td></td></tr><tr><td><code>utcDateModified</code></td><td><code>UtcDateTime</code></td><td></td></tr></tbody></table></figure><h3><code>NoteWithBranch</code></h3><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>note</code></td><td><code>Note</code></td><td></td></tr><tr><td><code>branch</code></td><td><code>Branch</code></td><td>Branch places the note into the tree, it represents the relationship between a parent note and child note</td></tr></tbody></table></figure><h3><code>Attachment</code></h3><p>Attachment is owned by a note, has title and content</p><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>attachmentId</code></td><td><code>EntityId</code></td><td></td></tr><tr><td><code>ownerId</code></td><td><code>EntityId</code></td><td>identifies the owner of the attachment, is either noteId or revisionId</td></tr><tr><td><code>role</code></td><td><code>string</code></td><td></td></tr><tr><td><code>mime</code></td><td><code>string</code></td><td></td></tr><tr><td><code>title</code></td><td><code>string</code></td><td>Title of the attachment. Returned as \"[protected]\" for protected attachments, since ETAPI cannot open a protected session.</td></tr><tr><td><code>position</code></td><td><code>integer (int32)</code></td><td></td></tr><tr><td><code>blobId</code></td><td><code>string</code></td><td>ID of the blob object which effectively serves as a content hash</td></tr><tr><td><code>dateModified</code></td><td><code>LocalDateTime</code></td><td></td></tr><tr><td><code>utcDateModified</code></td><td><code>UtcDateTime</code></td><td></td></tr><tr><td><code>utcDateScheduledForErasureSince</code></td><td><code>UtcDateTime</code></td><td></td></tr><tr><td><code>contentLength</code></td><td><code>integer (int32)</code></td><td></td></tr></tbody></table></figure><h3><code>CreateAttachment</code></h3><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>ownerId</code></td><td><code>EntityId</code></td><td>identifies the owner of the attachment, is either noteId or revisionId</td></tr><tr><td><code>role</code></td><td><code>string</code></td><td></td></tr><tr><td><code>mime</code></td><td><code>string</code></td><td></td></tr><tr><td><code>title</code></td><td><code>string</code></td><td></td></tr><tr><td><code>content</code></td><td><code>string</code></td><td>Text content of the attachment, stored as-is. To store binary content, create the attachment without it, then upload the data with <code>PUT /attachments/{attachmentId}/content</code>.</td></tr><tr><td><code>position</code></td><td><code>integer (int32)</code></td><td></td></tr></tbody></table></figure><h3><code>Attribute</code></h3><p>Attribute (Label, Relation) is a key-value record attached to a note.</p><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>attributeId</code></td><td><code>EntityId</code></td><td></td></tr><tr><td><code>noteId</code></td><td><code>EntityId</code></td><td>identifies the child note</td></tr><tr><td><code>type</code></td><td><code>string</code></td><td>One of <code>label</code>, <code>relation</code>.</td></tr><tr><td><code>name</code></td><td><code>string</code></td><td></td></tr><tr><td><code>value</code></td><td><code>string</code></td><td></td></tr><tr><td><code>position</code></td><td><code>integer (int32)</code></td><td></td></tr><tr><td><code>isInheritable</code></td><td><code>boolean</code></td><td></td></tr><tr><td><code>utcDateModified</code></td><td><code>UtcDateTime</code></td><td></td></tr></tbody></table></figure><h3><code>AttributeList</code></h3><p>Type: <code>array of Attribute</code></p><h3><code>SearchResponse</code></h3><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>results</code> <br><em>required</em></td><td><code>array of Note</code></td><td></td></tr><tr><td><code>debugInfo</code></td><td><code>object</code></td><td>debugging info on parsing the search query enabled with &amp;debug=true parameter</td></tr></tbody></table></figure><h3><code>EntityId</code></h3><p>Type: <code>string</code></p><h3><code>StringId</code></h3><p>Type: <code>string</code></p><h3><code>EntityIdList</code></h3><p>Type: <code>array of EntityId</code></p><h3><code>LocalDateTime</code></h3><p>Type: <code>string</code></p><h3><code>UtcDateTime</code></h3><p>Type: <code>string</code></p><h3><code>AppInfo</code></h3><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>appVersion</code></td><td><code>string</code></td><td>Trilium version</td></tr><tr><td><code>dbVersion</code></td><td><code>integer (int32)</code></td><td>DB version</td></tr><tr><td><code>syncVersion</code></td><td><code>integer (int32)</code></td><td>Sync protocol version</td></tr><tr><td><code>buildDate</code></td><td><code>string (date-time)</code></td><td>build date</td></tr><tr><td><code>buildRevision</code></td><td><code>string</code></td><td>git build revision</td></tr><tr><td><code>dataDirectory</code></td><td><code>string</code></td><td>data directory where Trilium stores files</td></tr><tr><td><code>clipperProtocolVersion</code></td><td><code>string</code></td><td>version of the supported Trilium Web Clipper protocol</td></tr><tr><td><code>utcDateTime</code></td><td><code>string</code></td><td>current UTC date time</td></tr></tbody></table></figure><h3><code>Error</code></h3><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>status</code> <br><em>required</em></td><td><code>integer (int32)</code></td><td>HTTP status, identical to the one given in HTTP response</td></tr><tr><td><code>code</code> <br><em>required</em></td><td><code>string</code></td><td>stable string constant</td></tr><tr><td><code>message</code> <br><em>required</em></td><td><code>string</code></td><td>Human readable error, potentially with more details,</td></tr></tbody></table></figure><h3><code>Revision</code></h3><p>Revision represents a snapshot of note's title and content at some point in the past.</p><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>revisionId</code></td><td><code>EntityId</code></td><td></td></tr><tr><td><code>noteId</code></td><td><code>EntityId</code></td><td></td></tr><tr><td><code>type</code></td><td><code>string</code></td><td>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>webView</code>, <code>shortcut</code>, <code>doc</code>, <code>contentWidget</code>, <code>launcher</code>.</td></tr><tr><td><code>mime</code></td><td><code>string</code></td><td></td></tr><tr><td><code>isProtected</code></td><td><code>boolean</code></td><td></td></tr><tr><td><code>title</code></td><td><code>string</code></td><td></td></tr><tr><td><code>blobId</code></td><td><code>string</code></td><td>ID of the blob object which effectively serves as a content hash</td></tr><tr><td><code>dateLastEdited</code></td><td><code>LocalDateTime</code></td><td></td></tr><tr><td><code>dateCreated</code></td><td><code>LocalDateTime</code></td><td></td></tr><tr><td><code>utcDateLastEdited</code></td><td><code>UtcDateTime</code></td><td></td></tr><tr><td><code>utcDateCreated</code></td><td><code>UtcDateTime</code></td><td></td></tr><tr><td><code>utcDateModified</code></td><td><code>UtcDateTime</code></td><td></td></tr><tr><td><code>contentLength</code></td><td><code>integer (int32)</code></td><td></td></tr></tbody></table></figure><h3><code>RecentChange</code></h3><p>Represents a recent change event (creation, modification, or deletion).</p><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>noteId</code></td><td><code>EntityId</code></td><td></td></tr><tr><td><code>title</code></td><td><code>string</code></td><td>Title at the time of the change (may be \"[protected]\" for protected notes)</td></tr><tr><td><code>current_title</code></td><td><code>string</code></td><td>Current title of the note (may be \"[protected]\" for protected notes)</td></tr><tr><td><code>current_isDeleted</code></td><td><code>boolean</code></td><td>Whether the note is currently deleted</td></tr><tr><td><code>current_deleteId</code></td><td><code>string</code></td><td>Delete ID if the note is deleted</td></tr><tr><td><code>current_isProtected</code></td><td><code>boolean</code></td><td>Whether the note is protected</td></tr><tr><td><code>utcDate</code></td><td><code>UtcDateTime</code></td><td>UTC timestamp of the change</td></tr><tr><td><code>date</code></td><td><code>LocalDateTime</code></td><td>Local timestamp of the change</td></tr><tr><td><code>canBeUndeleted</code></td><td><code>boolean</code></td><td>Whether the note can be undeleted (only present for deleted notes)</td></tr></tbody></table></figure><h3><code>Metrics</code></h3><p>Instance and database metrics, as served by GET /etapi/metrics?format=json</p><figure class=\"table\"><table><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>version</code></td><td><code>object</code></td><td></td></tr><tr><td><code>database</code></td><td><code>object</code></td><td></td></tr><tr><td><code>noteTypes</code></td><td><code>object</code></td><td>Number of active notes per note type</td></tr><tr><td><code>attachmentTypes</code></td><td><code>object</code></td><td>Number of active attachments per MIME type</td></tr><tr><td><code>statistics</code></td><td><code>object</code></td><td></td></tr><tr><td><code>timestamp</code></td><td><code>string</code></td><td></td></tr></tbody></table></figure>",
"_help_47ZrP6FNuoG8": "<p>When a new note is created, its name is by default \"new note\". In some cases, it can be desirable to have a different or even a dynamic default note title.</p><p>For this use case, Trilium (since v0.52) supports <code>#titleTemplate</code> <a href=\"#root/_help_zEY4DaJG4YT5\">label</a>. You can create such a label for a given note, assign it a value, and this value will be used as a default title when creating child notes. As with other labels, you can make it inheritable to apply recursively, and you can even place it on the root note to have it applied globally everywhere.</p><p>As an example use case, imagine you collect books you've read in a given year like this:</p><ul><li>2022 Books<ul><li>Neal Stephenson: Anathem, 2008</li><li>Franz Kafka: Die Verwandlung, 1915</li></ul></li></ul><p>Now, to the parent note \"2022 Books\" you can assign label <code>#titleTemplate=\"[Author name]: [Book title], [Publication year]\"</code>.</p><p>And all children of \"2022 Books\" will be created with initial title \"[Author name]: [Book title], [Publication year]\". There's no artificial intelligence here, the idea is to just prompt you to manually fill in the pieces of information into the note title by yourself.</p><h2>Titles set by a template</h2><p>A template can name the notes created from it, wherever they are created. To do so, add a <code>#template:titleTemplate</code> label to the template note, for example <code>#template:titleTemplate=\"Meeting ${now.format('YYYY-MM-DD')}\"</code> on a <em>Meeting</em> template.</p><ul><li>It applies both when the template is picked explicitly and when it comes from a parent's <code>~child:template</code>. See <a class=\"reference-link\" href=\"#root/_help_KC1HB96bqqHX\">Templates</a>.</li><li>It takes precedence over the parent's <code>#titleTemplate</code>. A title typed in by the user always wins.</li><li>It can be inherited from the template's ancestors in the tree (for example, a folder holding several templates), in which case a label owned by the template itself takes precedence. A note created from a template and later marked as a template does not keep that template's title.</li><li>Its value is evaluated the same way as <code>#titleTemplate</code>, with <code>parentNote</code> being the parent of the new note.</li></ul><h2>Dynamic value</h2><p>The value of <code>#titleTemplate</code> is evaluated at the point of note's creation as a JavaScript string, which means it can be enriched with the help of JS string interpolation with dynamic data.</p><p>Second variable injected is <code>parentNote</code> which gives access to the parent <a href=\"{{helpAssets}}/User%20Guide/Scripting/Script%20API/Frontend%20API/FNote.dat\"><code>FNote</code></a>.</p><p>See also&nbsp;<a class=\"reference-link\" href=\"#root/_help_KC1HB96bqqHX\">Templates</a>&nbsp;which provides similar capabilities, including default note's content.</p><h3>Examples</h3><ul><li>Imagine you collect server outage incidents and write some notes. It looks like this:<ul><li>Incidents<ul><li>2022-05-09: System crash</li><li>2022-05-15: Backup delay</li></ul></li><li>You can automatize the date assignment by assigning a label <code>#titleTemplate=\"${now.format('YYYY-MM-DD')}: \"</code> to the parent note \"Incidents\". Whenever a new child note is created, the title template is evaluated with the injected <a href=\"https://day.js.org/docs/en/display/format\">now</a> object.</li></ul></li><li>To use a parent's attribute in the title of new notes: <code>#titleTemplate=\"${parentNote.getLabelValue('authorName')}'s literary works\"</code></li><li>To mirror the parent's note title: <code>${parentNote.title}</code></li></ul>",
"_help_wX4HbRucYSDD": "<p>Your Trilium data is stored in a <a href=\"https://www.sqlite.org\">SQLite</a> database which contains all notes, tree structure, metadata, and most of the configuration. The database file is named <code>document.db</code> and is stored in the application's default&nbsp;<a href=\"#root/_help_tAassRL4RSQL\">Data directory</a>.</p><h2>Demo Notes</h2><p>When first starting Trilium, it will provide a set of notes to showcase various features of the application.</p><p>For more information see&nbsp;<a class=\"reference-link\" href=\"#root/_help_6tZeKvSHEUiB\">Demo Notes</a>.</p><h2>Manually Modifying the Database</h2><p>Trilium provides a lot of flexibility, and with it, opportunities for advanced users to tweak it. If you need to explore or modify the database directly, you can use a tool such as <a href=\"https://sqlitebrowser.org/\">SQLite Browser</a> to work directly on the database file.</p><p>See&nbsp;<a href=\"#root/_help_oyIAJ9PvvwHX\">Manually altering the database</a>&nbsp;for more information.</p><h2>How to Reset the Database</h2><p>If you want to start again and:</p><ul><li>Create and switch to a new blank knowledge base</li><li>Use a different knowledge base synced from a server or desktop application</li><li>Restore a backup</li></ul><p>You can navigate to&nbsp;<a class=\"reference-link\" href=\"#root/_help_4TIF1oA4VQRO\">Options</a> → <em>Database</em> and click the <em>Start over</em> button. You'll be prompted to restart the application, with the option to back up your current database before proceeding.</p><aside class=\"admonition important\"><p>For the web client, Trilium cannot restart automatically. You'll need to manually restart the server/container and then reload the web application.</p></aside><p>After restarting, the setup screen will appear. You can choose to back up your existing database, then proceed with the setup menu as if it's a new installation. The existing database will only be overwritten after selecting to create a new database, sync with a server, or restore from a backup.</p><h3>The Legacy Method</h3><p>If you are experimenting with Trilium and want to return it to its original state, you can do that by deleting the current database. When you restart the application, it will generate a new database containing the original demo notes.</p><p>To delete the database, simply go to the <a href=\"#root/_help_tAassRL4RSQL\">data directory</a> and delete the <code>document.db</code> file (and any other files starting with <code>document.db</code>).</p><p>If you do not need to preserve any configurations that might be stored in the <code>config.ini</code> file, you can just delete all of the <a href=\"#root/_help_tAassRL4RSQL\">data directory's</a> contents to fully restore the application to its original state. You can also review the <a href=\"#root/_help_Gzjqa934BdH4\">configuration</a> file to provide all <code>config.ini</code> values as environment variables instead.</p>",
"_help_oyIAJ9PvvwHX": "<p>There are some situations where modifying the SQLite database that Trilium uses is desirable.</p><p>If you are doing any advanced development or troubleshooting where you manually modify the database, you might want to consider creating backups of your <code>document.db</code> file.</p><h2>Modifying it internally using the SQL Console</h2><p>The SQL Console is Trilium's built-in database editor.</p><p>See&nbsp;<a class=\"reference-link\" href=\"#root/_help_YKWqdJhzi2VY\">SQL Console</a>.</p><h2>Externally modifying the database</h2><p>Sometimes the SQL Console cannot be used (for example if the application cannot start).</p><p>When making external modifications, consider closing the desktop application. If modifying the server database, then stop the service or Docker container.</p><h3>Using DB Browser for SQLite</h3><p>DB Browser for SQLite is a cross-platform editor that can be used to alter the database using a graphical user interface.</p><p>To do so:</p><ol><li>In the main menu, select File → Open database… and navigate to the database in the&nbsp;<a href=\"#root/_help_tAassRL4RSQL\">Data directory</a>.</li><li>Select the <em>Execute SQL</em> tab.</li><li>Type in the desired SQL statement.</li><li>Press the \"Play\" button in the toolbar underneath the \"Execute SQL\" tab (or F5 key).</li><li>Press \"Write Changes\" in the main toolbar.</li><li>Close the application or close the database.</li></ol><p><img src=\"{{helpAssets}}/User%20Guide/Advanced%20Usage/Database/Manually%20altering%20the%20database_image.jpg\"></p><h3>Using the SQLite CLI</h3><p>First, start the SQLite 3 CLI by specifying the path to the database:</p><pre><code class=\"language-text-x-trilium-auto\">sqlite3 ~/.local/share/trilium-data/document.db</code></pre><ul><li>In the prompt simply type the statement and make sure it ends with a <code>;</code> character.</li><li>To exit, simply type <code>.quit</code> and enter.</li></ul>",
diff --git a/docs/User Guide/User Guide/Advanced Usage/ETAPI (REST API)/API Reference.md b/docs/User Guide/User Guide/Advanced Usage/ETAPI (REST API)/API Reference.md
index 5f330441f4..86071b1b49 100644
--- a/docs/User Guide/User Guide/Advanced Usage/ETAPI (REST API)/API Reference.md
+++ b/docs/User Guide/User Guide/Advanced Usage/ETAPI (REST API)/API Reference.md
@@ -29,6 +29,9 @@ Create a note and place it into the note tree
* `application/json`: `CreateNoteDef`
+<div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">
+<div class="trilium-multicolumn-column">
+
| Property | Type | Description |
| --- | --- | --- |
| `parentNoteId` <br>_required_ | `EntityId` | Note ID of the parent note in the tree |
@@ -45,6 +48,9 @@ Create a note and place it into the note tree
| `utcDateCreated` | `UtcDateTime` | UTC timestap of the note creation. Specify only if you want to override the default (current datetime). |
| `utcDateModified` | `UtcDateTime` | UTC timestamp of the note's last modification, e.g. to keep the date of a note being migrated from another application. The local dateModified is derived from it. Specify only if you want to override the default (current datetime). |
+</div>
+<div class="trilium-multicolumn-column">
+
```json
{
"parentNoteId": "evnnmvHTCgIn",
@@ -63,17 +69,26 @@ Create a note and place it into the note tree
}
```
+</div>
+</div>
+
**Responses**
=== "201: note created"
* `application/json; charset=utf-8`: `NoteWithBranch`
+ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">
+ <div class="trilium-multicolumn-column">
+
| Property | Type | Description |
| --- | --- | --- |
| `note` | `Note` | |
| `branch` | `Branch` | Branch places the note into the tree, it represents the relationship between a parent note and child note |
+ </div>
+ <div class="trilium-multicolumn-column">
+
```json
{
"note": {
@@ -124,16 +139,25 @@ Create a note and place it into the note tree
}
```
+ </div>
+ </div>
+
=== "default: unexpected error"
* `application/json; charset=utf-8`: `Error`
+ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">
+ <div class="trilium-multicolumn-column">
+
| Property | Type | Description |
| --- | --- | --- |
| `status` <br>_required_ | `integer (int32)` | HTTP status, identical to the one given in HTTP response |
| `code` <br>_required_ | `string` | stable string constant |
| `message` <br>_required_ | `string` | Human readable error, potentially with more details, |
+ </div>
+ <div class="trilium-multicolumn-column">
+
```json
{
"status": 400,
@@ -142,6 +166,9 @@ Create a note and place it into the note tree
}
```
+ </div>
+ </div>
+
### Search notes
`GET /notes` · `searchNotes`
@@ -170,11 +197,17 @@ Search notes
* `application/json; charset=utf-8`: `SearchResponse`
+ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">
+ <div class="trilium-multicolumn-column">
+
| Property | Type | Description |
| --- | --- | --- |
| `results` <br>_required_ | `array of Note` | |
| `debugInfo` | `object` | debugging info on parsing the search query enabled with &debug=true parameter |
+ </div>
+ <div class="trilium-multicolumn-column">
+
```json
{
"results": [
@@ -219,16 +252,25 @@ Search notes
}
```
+ </div>
+ </div>
+
=== "default: unexpected error"
* `application/json; charset=utf-8`: `Error`
+ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">
+ <div class="trilium-multicolumn-column">
+
| Property | Type | Description |
| --- | --- | --- |
| `status` <br>_required_ | `integer (int32)` | HTTP status, identical to the one given in HTTP response |
| `code` <br>_required_ | `string` | stable string constant |
| `message` <br>_required_ | `string` | Human readable error, potentially with more details, |
+ </div>
+ <div class="trilium-multicolumn-column">
+
```json
{
"status": 400,
@@ -237,6 +279,9 @@ Search notes
}
```
+ </div>
+ </div>
+
### Get a note
`GET /notes/{noteId}` · `getNoteById`
@@ -257,6 +302,9 @@ Returns a note identified by its ID
* `application/json; charset=utf-8`: `Note`
+ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">
+ <div class="trilium-multicolumn-column">
+
| Property | Type | Description |
| --- | --- | --- |
| `noteId` | `EntityId` | |
@@ -275,6 +323,9 @@ Returns a note identified by its ID
| `utcDateCreated` | `UtcDateTime` | |
| `utcDateModified` | `UtcDateTime` | Writable through PATCH, e.g. to restore a migrated note's date after its content was rewritten. The local dateModified is derived from it. |
+ </div>
+ <div class="trilium-multicolumn-column">
+
```json
{
"noteId": "evnnmvHTCgIn",
@@ -314,16 +365,25 @@ Returns a note identified by its ID
}
```
+ </div>
+ </div>
+
=== "default: unexpected error"
* `application/json; charset=utf-8`: `Error`
+ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">
+ <div class="trilium-multicolumn-column">
+
| Property | Type | Description |
| --- | --- | --- |
| `status` <br>_required_ | `integer (int32)` | HTTP status, identical to the one given in HTTP response |
| `code` <br>_required_ | `string` | stable string constant |
| `message` <br>_required_ | `string` | Human readable error, potentially with more details, |
+ </div>
+ <div class="trilium-multicolumn-column">
+
```json
{
"status": 400,
@@ -332,6 +392,9 @@ Returns a note identified by its ID
}
```
+ </div>
+ </div>
+
### Delete a note
`DELETE /notes/{noteId}` · `deleteNoteById`
@@ -356,12 +419,18 @@ deletes a single note based on the noteId supplied
* `application/json; charset=utf-8`: `Error`
+ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">
+ <div class="trilium-multicolumn-column">
+
| Property | Type | Description |
| --- | --- | --- |
| `status` <br>_required_ | `integer (int32)` | HTTP status, identical to the one given in HTTP response |
| `code` <br>_required_ | `string` | stable string constant |
| `message` <br>_required_ | `string` | Human readable error, potentially with more details, |
+ </div>
+ <div class="trilium-multicolumn-column">
+
```json
{
"status": 400,
@@ -370,6 +439,9 @@ deletes a single note based on the noteId supplied
}
```
+ </div>
+ </div>
+
### Update a note
`PATCH /notes/{noteId}` · `patchNoteById`
@@ -388,6 +460,9 @@ patch a note identified by the noteId with changes in the body
* `application/json`: `Note`
+<div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">
+<div class="trilium-multicolumn-column">
+
| Property | Type | Description |
| --- | --- | --- |
| `noteId` | `EntityId` | |
@@ -406,6 +481,9 @@ patch a note identified by the noteId with changes in the body
| `utcDateCreated` | `UtcDateTime` | |
| `utcDateModified` | `UtcDateTime` | Writable through PATCH, e.g. to restore a migrated note's date after its content was rewritten. The local dateModified is derived from it. |
+</div>
+<div class="trilium-multicolumn-column">
+
```json
{
"title": "string",
@@ -418,12 +496,18 @@ patch a note identified by the noteId with changes in the body
}
```
+</div>
+</div>
+
**Responses**
=== "200: note updated"
* `application/json; charset=utf-8`: `Note`
+ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">
+ <div class="trilium-multicolumn-column">
+
| Property | Type | Description |
| --- | --- | --- |
| `noteId` | `EntityId` | |
@@ -442,6 +526,9 @@ patch a note identified by the noteId with changes in the body
| `utcDateCreated` | `UtcDateTime` | |
| `utcDateModified` | `UtcDateTime` | Writable through PATCH, e.g. to restore a migrated note's date after its content was rewritten. The local dateModified is derived from it. |
+ </div>
+ <div class="trilium-multicolumn-column">
+
```json
{
"noteId": "evnnmvHTCgIn",
@@ -481,16 +568,25 @@ patch a note identified by the noteId with changes in the body
}
```
+ </div>
+ </div>
+
=== "default: unexpected error"
* `application/json; charset=utf-8`: `Error`
+ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">
+ <div class="trilium-multicolumn-column">
+
| Property | Type | Description |
| --- | --- | --- |
| `status` <br>_required_ | `integer (int32)` | HTTP status, identical to the one given in HTTP response |
| `code` <br>_required_ | `string` | stable string constant |
| `message` <br>_required_ | `string` | Human readable error, potentially with more details, |
+ </div>
+ <div class="trilium-multicolumn-column">
+
```json
{
"status": 400,
@@ -499,6 +595,9 @@ patch a note identified by the noteId with changes in the body
}
```
+ </div>
+ </div>
+
### Get the content of a note
`GET /notes/{noteId}/content` · `getNoteContent`
@@ -571,12 +670,18 @@ Exports ZIP file export of a given note subtree. To export whole document, use "
* `application/json; charset=utf-8`: `Error`
+ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">
+ <div class="trilium-multicolumn-column">
+
| Property | Type | Description |
| --- | --- | --- |
| `status` <br>_required_ | `integer (int32)` | HTTP status, identical to the one given in HTTP response |
| `code` <br>_required_ | `string` | stable string constant |
| `message` <br>_required_ | `string` | Human readable error, potentially with more details, |
+ </div>
+ <div class="trilium-multicolumn-column">
+
```json
{
"status": 400,
@@ -585,6 +690,9 @@ Exports ZIP file export of a given note subtree. To export whole document, use "
}
```
+ </div>
+ </div>
+
### Import a ZIP archive
`POST /notes/{noteId}/import` · `importZip`
@@ -605,11 +713,17 @@ Imports ZIP file into a given note.
* `application/json; charset=utf-8`: `NoteWithBranch`
+ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">
+ <div class="trilium-multicolumn-column">
+
| Property | Type | Description |
| --- | --- | --- |
| `note` | `Note` | |
| `branch` | `Branch` | Branch places the note into the tree, it represents the relationship between a parent note and child note |
+ </div>
+ <div class="trilium-multicolumn-column">
+
```json
{
"note": {
@@ -660,16 +774,25 @@ Imports ZIP file into a given note.
}
```
+ </div>
+ </div>
+
=== "default: unexpected error"
* `application/json; charset=utf-8`: `Error`
+ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">
+ <div class="trilium-multicolumn-column">
+
| Property | Type | Description |
| --- | --- | --- |
| `status` <br>_required_ | `integer (int32)` | HTTP status, identical to the one given in HTTP response |
| `code` <br>_required_ | `string` | stable string constant |
| `message` <br>_required_ | `string` | Human readable error, potentially with more details, |
+ </div>
+ <div class="trilium-multicolumn-column">
+
```json
{
"status": 400,
@@ -678,6 +801,9 @@ Imports ZIP file into a given note.
}
```
+ </div>
+ </div>
+
### Restore a deleted note
`POST /notes/{noteId}/undelete` · `undeleteNote`
@@ -698,26 +824,41 @@ Restore a deleted note. The note must be deleted and must have at least one unde
* `application/json; charset=utf-8`: `object`
+ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">
+ <div class="trilium-multicolumn-column">
+
| Property | Type | Description |
| --- | --- | --- |
| `success` | `boolean` | |
+ </div>
+ <div class="trilium-multicolumn-column">
+
```json
{
"success": true
}
```
+ </div>
+ </div>
+
=== "default: unexpected error"
* `application/json; charset=utf-8`: `Error`
+ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">
+ <div class="trilium-multicolumn-column">
+
| Property | Type | Description |
| --- | --- | --- |
| `status` <br>_required_ | `integer (int32)` | HTTP status, identical to the one given in HTTP response |
| `code` <br>_required_ | `string` | stable string constant |
| `message` <br>_required_ | `string` | Human readable error, potentially with more details, |
+ </div>
+ <div class="trilium-multicolumn-column">
+
```json
{
"status": 400,
@@ -726,6 +867,9 @@ Restore a deleted note. The note must be deleted and must have at least one unde
}
```
+ </div>
+ </div>
+
### List recent changes
`GET /notes/history` · `getNoteHistory`
@@ -766,12 +910,18 @@ Returns recent changes including note creations, modifications, and deletions
* `application/json; charset=utf-8`: `Error`
+ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">
+ <div class="trilium-multicolumn-column">
+
| Property | Type | Description |
| --- | --- | --- |
| `status` <br>_required_ | `integer (int32)` | HTTP status, identical to the one given in HTTP response |
| `code` <br>_required_ | `string` | stable string constant |
| `message` <br>_required_ | `string` | Human readable error, potentially with more details, |
+ </div>
+ <div class="trilium-multicolumn-column">
+
```json
{
"status": 400,
@@ -780,6 +930,9 @@ Returns recent changes including note creations, modifications, and deletions
}
```
+ </div>
+ </div>
+
## Branches
Branches place a note in the tree, under a parent note.
@@ -796,6 +949,9 @@ Create a branch (clone a note to a different location in the tree). In case ther
* `application/json`: `Branch`
+<div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">
+<div class="trilium-multicolumn-column">
+
| Property | Type | Description |
| --- | --- | --- |
| `branchId` | `EntityId` | |
@@ -806,6 +962,9 @@ Create a branch (clone a note to a different location in the tree). In case ther
| `isExpanded` | `boolean` | |
| `utcDateModified` | `UtcDateTime` | |
+</div>
+<div class="trilium-multicolumn-column">
+
```json
{
"branchId": "evnnmvHTCgIn",
@@ -815,12 +974,18 @@ Create a branch (clone a note to a different location in the tree). In case ther
}
```
+</div>
+</div>
+
**Responses**
=== "200: existing branch updated"
* `application/json; charset=utf-8`: `Branch`
+ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">
+ <div class="trilium-multicolumn-column">
+
| Property | Type | Description |
| --- | --- | --- |
| `branchId` | `EntityId` | |
@@ -831,6 +996,9 @@ Create a branch (clone a note to a different location in the tree). In case ther
| `isExpanded` | `boolean` | |
| `utcDateModified` | `UtcDateTime` | |
+ </div>
+ <div class="trilium-multicolumn-column">
+
```json
{
"branchId": "evnnmvHTCgIn",
@@ -843,10 +1011,16 @@ Create a branch (clone a note to a different location in the tree). In case ther
}
```
+ </div>
+ </div>
+
=== "201: branch created"
* `application/json; charset=utf-8`: `Branch`
+ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">
+ <div class="trilium-multicolumn-column">
+
| Property | Type | Description |
| --- | --- | --- |
| `branchId` | `EntityId` | |
@@ -857,6 +1031,9 @@ Create a branch (clone a note to a different location in the tree). In case ther
| `isExpanded` | `boolean` | |
| `utcDateModified` | `UtcDateTime` | |
+ </div>
+ <div class="trilium-multicolumn-column">
+
```json
{
"branchId": "evnnmvHTCgIn",
@@ -869,16 +1046,25 @@ Create a branch (clone a note to a different location in the tree). In case ther
}
```
+ </div>
+ </div>
+
=== "default: unexpected error"
* `application/json; charset=utf-8`: `Error`
+ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">
+ <div class="trilium-multicolumn-column">
+
| Property | Type | Description |
| --- | --- | --- |
| `status` <br>_required_ | `integer (int32)` | HTTP status, identical to the one given in HTTP response |
| `code` <br>_required_ | `string` | stable string constant |
| `message` <br>_required_ | `string` | Human readable error, potentially with more details, |
+ </div>
+ <div class="trilium-multicolumn-column">
+
```json
{
"status": 400,
@@ -887,6 +1073,9 @@ Create a branch (clone a note to a different location in the tree). In case ther
}
```
+ </div>
+ </div>
+
### Get a branch
`GET /branches/{branchId}` · `getBranchById`
@@ -907,6 +1096,9 @@ Returns a branch identified by its ID
* `application/json; charset=utf-8`: `Branch`
+ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">
+ <div class="trilium-multicolumn-column">
+
| Property | Type | Description |
| --- | --- | --- |
| `branchId` | `EntityId` | |
@@ -917,6 +1109,9 @@ Returns a branch identified by its ID
| `isExpanded` | `boolean` | |
| `utcDateModified` | `UtcDateTime` | |
+ </div>
+ <div class="trilium-multicolumn-column">
+
```json
{
"branchId": "evnnmvHTCgIn",
@@ -929,16 +1124,25 @@ Returns a branch identified by its ID
}
```
+ </div>
+ </div>
+
=== "default: unexpected error"
* `application/json; charset=utf-8`: `Error`
+ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">
+ <div class="trilium-multicolumn-column">
+
| Property | Type | Description |
| --- | --- | --- |
| `status` <br>_required_ | `integer (int32)` | HTTP status, identical to the one given in HTTP response |
| `code` <br>_required_ | `string` | stable string constant |
| `message` <br>_required_ | `string` | Human readable error, potentially with more details, |
+ </div>
+ <div class="trilium-multicolumn-column">
+
```json
{
"status": 400,
@@ -947,6 +1151,9 @@ Returns a branch identified by its ID
}
```
+ </div>
+ </div>
+
### Delete a branch
`DELETE /branches/{branchId}` · `deleteBranchById`
@@ -971,12 +1178,18 @@ deletes a branch based on the branchId supplied. If this is the last branch of t
* `application/json; charset=utf-8`: `Error`
+ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">
+ <div class="trilium-multicolumn-column">
+
| Property | Type | Description |
| --- | --- | --- |
| `status` <br>_required_ | `integer (int32)` | HTTP status, identical to the one given in HTTP response |
| `code` <br>_required_ | `string` | stable string constant |
| `message` <br>_required_ | `string` | Human readable error, potentially with more details, |
+ </div>
+ <div class="trilium-multicolumn-column">
+
```json
{
"status": 400,
@@ -985,6 +1198,9 @@ deletes a branch based on the branchId supplied. If this is the last branch of t
}
```
+ </div>
+ </div>
+
### Update a branch
`PATCH /branches/{branchId}` · `patchBranchById`
@@ -1003,6 +1219,9 @@ patch a branch identified by the branchId with changes in the body. Only prefix
* `application/json`: `Branch`
+<div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">
+<div class="trilium-multicolumn-column">
+
| Property | Type | Description |
| --- | --- | --- |
| `branchId` | `EntityId` | |
@@ -1013,6 +1232,9 @@ patch a branch identified by the branchId with changes in the body. Only prefix
| `isExpanded` | `boolean` | |
| `utcDateModified` | `UtcDateTime` | |
+</div>
+<div class="trilium-multicolumn-column">
+
```json
{
"branchId": "evnnmvHTCgIn",
@@ -1022,12 +1244,18 @@ patch a branch identified by the branchId with changes in the body. Only prefix
}
```
+</div>
+</div>
+
**Responses**
=== "200: branch updated"
* `application/json; charset=utf-8`: `Branch`
+ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">
+ <div class="trilium-multicolumn-column">
+
| Property | Type | Description |
| --- | --- | --- |
| `branchId` | `EntityId` | |
@@ -1038,6 +1266,9 @@ patch a branch identified by the branchId with changes in the body. Only prefix
| `isExpanded` | `boolean` | |
| `utcDateModified` | `UtcDateTime` | |
+ </div>
+ <div class="trilium-multicolumn-column">
+
```json
{
"branchId": "evnnmvHTCgIn",
@@ -1050,16 +1281,25 @@ patch a branch identified by the branchId with changes in the body. Only prefix
}
```
+ </div>
+ </div>
+
=== "default: unexpected error"
* `application/json; charset=utf-8`: `Error`
+ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">
+ <div class="trilium-multicolumn-column">
+
| Property | Type | Description |
| --- | --- | --- |
| `status` <br>_required_ | `integer (int32)` | HTTP status, identical to the one given in HTTP response |
| `code` <br>_required_ | `string` | stable string constant |
| `message` <br>_required_ | `string` | Human readable error, potentially with more details, |
+ </div>
+ <div class="trilium-multicolumn-column">
+
```json
{
"status": 400,
@@ -1068,6 +1308,9 @@ patch a branch identified by the branchId with changes in the body. Only prefix
}
```
+ </div>
+ </div>
+
### Refresh the order of child notes
`POST /refresh-note-ordering/{parentNoteId}` · `postRefreshNoteOrdering`
@@ -1092,12 +1335,18 @@ notePositions in branches are not automatically pushed to connected clients and
* `application/json; charset=utf-8`: `Error`
+ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">
+ <div class="trilium-multicolumn-column">
+
| Property | Type | Description |
| --- | --- | --- |
| `status` <br>_required_ | `integer (int32)` | HTTP status, identical to the one given in HTTP response |
| `code` <br>_required_ | `string` | stable string constant |
| `message` <br>_required_ | `string` | Human readable error, potentially with more details, |
+ </div>
+ <div class="trilium-multicolumn-column">
+
```json
{
"status": 400,
@@ -1106,6 +1355,9 @@ notePositions in branches are not automatically pushed to connected clients and
}
```
+ </div>
+ </div>
+
## Attributes
Labels and relations of a note.
@@ -1122,6 +1374,9 @@ create an attribute for a given note
* `application/json`: `Attribute`
+<div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">
+<div class="trilium-multicolumn-column">
+
| Property | Type | Description |
| --- | --- | --- |
| `attributeId` | `EntityId` | |
@@ -1133,6 +1388,9 @@ create an attribute for a given note
| `isInheritable` | `boolean` | |
| `utcDateModified` | `UtcDateTime` | |
+</div>
+<div class="trilium-multicolumn-column">
+
```json
{
"attributeId": "evnnmvHTCgIn",
@@ -1144,12 +1402,18 @@ create an attribute for a given note
}
```
+</div>
+</div>
+
**Responses**
=== "201: attribute created"
* `application/json; charset=utf-8`: `Attribute`
+ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">
+ <div class="trilium-multicolumn-column">
+
| Property | Type | Description |
| --- | --- | --- |
| `attributeId` | `EntityId` | |
@@ -1161,6 +1425,9 @@ create an attribute for a given note
| `isInheritable` | `boolean` | |
| `utcDateModified` | `UtcDateTime` | |
+ </div>
+ <div class="trilium-multicolumn-column">
+
```json
{
"attributeId": "evnnmvHTCgIn",
@@ -1174,16 +1441,25 @@ create an attribute for a given note
}
```
+ </div>
+ </div>
+
=== "default: unexpected error"
* `application/json; charset=utf-8`: `Error`
+ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">
+ <div class="trilium-multicolumn-column">
+
| Property | Type | Description |
| --- | --- | --- |
| `status` <br>_required_ | `integer (int32)` | HTTP status, identical to the one given in HTTP response |
| `code` <br>_required_ | `string` | stable string constant |
| `message` <br>_required_ | `string` | Human readable error, potentially with more details, |
+ </div>
+ <div class="trilium-multicolumn-column">
+
```json
{
"status": 400,
@@ -1192,6 +1468,9 @@ create an attribute for a given note
}
```
+ </div>
+ </div>
+
### Get an attribute
`GET /attributes/{attributeId}` · `getAttributeById`
@@ -1212,6 +1491,9 @@ Returns an attribute identified by its ID
* `application/json; charset=utf-8`: `Attribute`
+ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">
+ <div class="trilium-multicolumn-column">
+
| Property | Type | Description |
| --- | --- | --- |
| `attributeId` | `EntityId` | |
@@ -1223,6 +1505,9 @@ Returns an attribute identified by its ID
| `isInheritable` | `boolean` | |
| `utcDateModified` | `UtcDateTime` | |
+ </div>
+ <div class="trilium-multicolumn-column">
+
```json
{
"attributeId": "evnnmvHTCgIn",
@@ -1236,16 +1521,25 @@ Returns an attribute identified by its ID
}
```
+ </div>
+ </div>
+
=== "default: unexpected error"
* `application/json; charset=utf-8`: `Error`
+ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">
+ <div class="trilium-multicolumn-column">
+
| Property | Type | Description |
| --- | --- | --- |
| `status` <br>_required_ | `integer (int32)` | HTTP status, identical to the one given in HTTP response |
| `code` <br>_required_ | `string` | stable string constant |
| `message` <br>_required_ | `string` | Human readable error, potentially with more details, |
+ </div>
+ <div class="trilium-multicolumn-column">
+
```json
{
"status": 400,
@@ -1254,6 +1548,9 @@ Returns an attribute identified by its ID
}
```
+ </div>
+ </div>
+
### Delete an attribute
`DELETE /attributes/{attributeId}` · `deleteAttributeById`
@@ -1278,12 +1575,18 @@ deletes an attribute based on the attributeId supplied.
* `application/json; charset=utf-8`: `Error`
+ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">
+ <div class="trilium-multicolumn-column">
+
| Property | Type | Description |
| --- | --- | --- |
| `status` <br>_required_ | `integer (int32)` | HTTP status, identical to the one given in HTTP response |
| `code` <br>_required_ | `string` | stable string constant |
| `message` <br>_required_ | `string` | Human readable error, potentially with more details, |
+ </div>
+ <div class="trilium-multicolumn-column">
+
```json
{
"status": 400,
@@ -1292,6 +1595,9 @@ deletes an attribute based on the attributeId supplied.
}
```
+ </div>
+ </div>
+
### Update an attribute
`PATCH /attributes/{attributeId}` · `patchAttributeById`
@@ -1310,6 +1616,9 @@ patch an attribute identified by the attributeId with changes in the body. For l
* `application/json`: `Attribute`
+<div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">
+<div class="trilium-multicolumn-column">
+
| Property | Type | Description |
| --- | --- | --- |
| `attributeId` | `EntityId` | |
@@ -1321,6 +1630,9 @@ patch an attribute identified by the attributeId with changes in the body. For l
| `isInheritable` | `boolean` | |
| `utcDateModified` | `UtcDateTime` | |
+</div>
+<div class="trilium-multicolumn-column">
+
```json
{
"attributeId": "evnnmvHTCgIn",
@@ -1332,12 +1644,18 @@ patch an attribute identified by the attributeId with changes in the body. For l
}
```
+</div>
+</div>
+
**Responses**
=== "200: attribute updated"
* `application/json; charset=utf-8`: `Attribute`
+ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">
+ <div class="trilium-multicolumn-column">
+
| Property | Type | Description |
| --- | --- | --- |
| `attributeId` | `EntityId` | |
@@ -1349,6 +1667,9 @@ patch an attribute identified by the attributeId with changes in the body. For l
| `isInheritable` | `boolean` | |
| `utcDateModified` | `UtcDateTime` | |
+ </div>
+ <div class="trilium-multicolumn-column">
+
```json
{
"attributeId": "evnnmvHTCgIn",
@@ -1362,16 +1683,25 @@ patch an attribute identified by the attributeId with changes in the body. For l
}
```
+ </div>
+ </div>
+
=== "default: unexpected error"
* `application/json; charset=utf-8`: `Error`
+ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">
+ <div class="trilium-multicolumn-column">
+
| Property | Type | Description |
| --- | --- | --- |
| `status` <br>_required_ | `integer (int32)` | HTTP status, identical to the one given in HTTP response |
| `code` <br>_required_ | `string` | stable string constant |
| `message` <br>_required_ | `string` | Human readable error, potentially with more details, |
+ </div>
+ <div class="trilium-multicolumn-column">
+
```json
{
"status": 400,
@@ -1380,6 +1710,9 @@ patch an attribute identified by the attributeId with changes in the body. For l
}
```
+ </div>
+ </div>
+
## Attachments
Files attached to a note.
@@ -1426,12 +1759,18 @@ Returns all attachments for a note identified by its ID
* `application/json; charset=utf-8`: `Error`
+ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">
+ <div class="trilium-multicolumn-column">
+
| Property | Type | Description |
| --- | --- | --- |
| `status` <br>_required_ | `integer (int32)` | HTTP status, identical to the one given in HTTP response |
| `code` <br>_required_ | `string` | stable string constant |
| `message` <br>_required_ | `string` | Human readable error, potentially with more details, |
+ </div>
+ <div class="trilium-multicolumn-column">
+
```json
{
"status": 400,
@@ -1440,6 +1779,9 @@ Returns all attachments for a note identified by its ID
}
```
+ </div>
+ </div>
+
### Create an attachment
`POST /attachments` · `postAttachment`
@@ -1452,6 +1794,9 @@ create an attachment
* `application/json`: `CreateAttachment`
+<div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">
+<div class="trilium-multicolumn-column">
+
| Property | Type | Description |
| --- | --- | --- |
| `ownerId` | `EntityId` | identifies the owner of the attachment, is either noteId or revisionId |
@@ -1461,6 +1806,9 @@ create an attachment
| `content` | `string` | Text content of the attachment, stored as-is. To store binary content, create the attachment without it, then upload the data with `PUT /attachments/{attachmentId}/content`. |
| `position` | `integer (int32)` | |
+</div>
+<div class="trilium-multicolumn-column">
+
```json
{
"ownerId": "evnnmvHTCgIn",
@@ -1472,12 +1820,18 @@ create an attachment
}
```
+</div>
+</div>
+
**Responses**
=== "201: attachment created"
* `application/json; charset=utf-8`: `Attachment`
+ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">
+ <div class="trilium-multicolumn-column">
+
| Property | Type | Description |
| --- | --- | --- |
| `attachmentId` | `EntityId` | |
@@ -1492,6 +1846,9 @@ create an attachment
| `utcDateScheduledForErasureSince` | `UtcDateTime` | |
| `contentLength` | `integer (int32)` | |
+ </div>
+ <div class="trilium-multicolumn-column">
+
```json
{
"attachmentId": "evnnmvHTCgIn",
@@ -1508,16 +1865,25 @@ create an attachment
}
```
+ </div>
+ </div>
+
=== "default: unexpected error"
* `application/json; charset=utf-8`: `Error`
+ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">
+ <div class="trilium-multicolumn-column">
+
| Property | Type | Description |
| --- | --- | --- |
| `status` <br>_required_ | `integer (int32)` | HTTP status, identical to the one given in HTTP response |
| `code` <br>_required_ | `string` | stable string constant |
| `message` <br>_required_ | `string` | Human readable error, potentially with more details, |
+ </div>
+ <div class="trilium-multicolumn-column">
+
```json
{
"status": 400,
@@ -1526,6 +1892,9 @@ create an attachment
}
```
+ </div>
+ </div>
+
### Get an attachment
`GET /attachments/{attachmentId}` · `getAttachmentById`
@@ -1546,6 +1915,9 @@ Returns an attachment identified by its ID
* `application/json; charset=utf-8`: `Attachment`
+ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">
+ <div class="trilium-multicolumn-column">
+
| Property | Type | Description |
| --- | --- | --- |
| `attachmentId` | `EntityId` | |
@@ -1560,6 +1932,9 @@ Returns an attachment identified by its ID
| `utcDateScheduledForErasureSince` | `UtcDateTime` | |
| `contentLength` | `integer (int32)` | |
+ </div>
+ <div class="trilium-multicolumn-column">
+
```json
{
"attachmentId": "evnnmvHTCgIn",
@@ -1576,16 +1951,25 @@ Returns an attachment identified by its ID
}
```
+ </div>
+ </div>
+
=== "default: unexpected error"
* `application/json; charset=utf-8`: `Error`
+ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">
+ <div class="trilium-multicolumn-column">
+
| Property | Type | Description |
| --- | --- | --- |
| `status` <br>_required_ | `integer (int32)` | HTTP status, identical to the one given in HTTP response |
| `code` <br>_required_ | `string` | stable string constant |
| `message` <br>_required_ | `string` | Human readable error, potentially with more details, |
+ </div>
+ <div class="trilium-multicolumn-column">
+
```json
{
"status": 400,
@@ -1594,6 +1978,9 @@ Returns an attachment identified by its ID
}
```
+ </div>
+ </div>
+
### Delete an attachment
`DELETE /attachments/{attachmentId}` · `deleteAttachmentById`
@@ -1618,12 +2005,18 @@ deletes an attachment based on the attachmentId supplied.
* `application/json; charset=utf-8`: `Error`
+ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">
+ <div class="trilium-multicolumn-column">
+
| Property | Type | Description |
| --- | --- | --- |
| `status` <br>_required_ | `integer (int32)` | HTTP status, identical to the one given in HTTP response |
| `code` <br>_required_ | `string` | stable string constant |
| `message` <br>_required_ | `string` | Human readable error, potentially with more details, |
+ </div>
+ <div class="trilium-multicolumn-column">
+
```json
{
"status": 400,
@@ -1632,6 +2025,9 @@ deletes an attachment based on the attachmentId supplied.
}
```
+ </div>
+ </div>
+
### Update an attachment
`PATCH /attachments/{attachmentId}` · `patchAttachmentById`
@@ -1650,6 +2046,9 @@ patch an attachment identified by the attachmentId with changes in the body. Onl
* `application/json`: `Attachment`
+<div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">
+<div class="trilium-multicolumn-column">
+
| Property | Type | Description |
| --- | --- | --- |
| `attachmentId` | `EntityId` | |
@@ -1664,6 +2063,9 @@ patch an attachment identified by the attachmentId with changes in the body. Onl
| `utcDateScheduledForErasureSince` | `UtcDateTime` | |
| `contentLength` | `integer (int32)` | |
+</div>
+<div class="trilium-multicolumn-column">
+
```json
{
"ownerId": "evnnmvHTCgIn",
@@ -1676,12 +2078,18 @@ patch an attachment identified by the attachmentId with changes in the body. Onl
}
```
+</div>
+</div>
+
**Responses**
=== "200: attribute updated"
* `application/json; charset=utf-8`: `Attachment`
+ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">
+ <div class="trilium-multicolumn-column">
+
| Property | Type | Description |
| --- | --- | --- |
| `attachmentId` | `EntityId` | |
@@ -1696,6 +2104,9 @@ patch an attachment identified by the attachmentId with changes in the body. Onl
| `utcDateScheduledForErasureSince` | `UtcDateTime` | |
| `contentLength` | `integer (int32)` | |
+ </div>
+ <div class="trilium-multicolumn-column">
+
```json
{
"attachmentId": "evnnmvHTCgIn",
@@ -1712,16 +2123,25 @@ patch an attachment identified by the attachmentId with changes in the body. Onl
}
```
+ </div>
+ </div>
+
=== "default: unexpected error"
* `application/json; charset=utf-8`: `Error`
+ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">
+ <div class="trilium-multicolumn-column">
+
| Property | Type | Description |
| --- | --- | --- |
| `status` <br>_required_ | `integer (int32)` | HTTP status, identical to the one given in HTTP response |
| `code` <br>_required_ | `string` | stable string constant |
| `message` <br>_required_ | `string` | Human readable error, potentially with more details, |
+ </div>
+ <div class="trilium-multicolumn-column">
+
```json
{
"status": 400,
@@ -1730,6 +2150,9 @@ patch an attachment identified by the attachmentId with changes in the body. Onl
}
```
+ </div>
+ </div>
+
### Get the content of an attachment
`GET /attachments/{attachmentId}/content` · `getAttachmentContent`
@@ -1806,12 +2229,18 @@ Create a note revision for the given note
* `application/json; charset=utf-8`: `Error`
+ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">
+ <div class="trilium-multicolumn-column">
+
| Property | Type | Description |
| --- | --- | --- |
| `status` <br>_required_ | `integer (int32)` | HTTP status, identical to the one given in HTTP response |
| `code` <br>_required_ | `string` | stable string constant |
| `message` <br>_required_ | `string` | Human readable error, potentially with more details, |
+ </div>
+ <div class="trilium-multicolumn-column">
+
```json
{
"status": 400,
@@ -1820,6 +2249,9 @@ Create a note revision for the given note
}
```
+ </div>
+ </div>
+
### List the revisions of a note
`GET /notes/{noteId}/revisions` · `getNoteRevisions`
@@ -1864,12 +2296,18 @@ Returns the revisions of a note identified by its ID. Protected revisions are om
* `application/json; charset=utf-8`: `Error`
+ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">
+ <div class="trilium-multicolumn-column">
+
| Property | Type | Description |
| --- | --- | --- |
| `status` <br>_required_ | `integer (int32)` | HTTP status, identical to the one given in HTTP response |
| `code` <br>_required_ | `string` | stable string constant |
| `message` <br>_required_ | `string` | Human readable error, potentially with more details, |
+ </div>
+ <div class="trilium-multicolumn-column">
+
```json
{
"status": 400,
@@ -1878,6 +2316,9 @@ Returns the revisions of a note identified by its ID. Protected revisions are om
}
```
+ </div>
+ </div>
+
### Get a revision
`GET /revisions/{revisionId}` · `getRevisionById`
@@ -1898,6 +2339,9 @@ Returns a revision identified by its ID
* `application/json; charset=utf-8`: `Revision`
+ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">
+ <div class="trilium-multicolumn-column">
+
| Property | Type | Description |
| --- | --- | --- |
| `revisionId` | `EntityId` | |
@@ -1914,6 +2358,9 @@ Returns a revision identified by its ID
| `utcDateModified` | `UtcDateTime` | |
| `contentLength` | `integer (int32)` | |
+ </div>
+ <div class="trilium-multicolumn-column">
+
```json
{
"revisionId": "evnnmvHTCgIn",
@@ -1932,16 +2379,25 @@ Returns a revision identified by its ID
}
```
+ </div>
+ </div>
+
=== "default: unexpected error"
* `application/json; charset=utf-8`: `Error`
+ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">
+ <div class="trilium-multicolumn-column">
+
| Property | Type | Description |
| --- | --- | --- |
| `status` <br>_required_ | `integer (int32)` | HTTP status, identical to the one given in HTTP response |
| `code` <br>_required_ | `string` | stable string constant |
| `message` <br>_required_ | `string` | Human readable error, potentially with more details, |
+ </div>
+ <div class="trilium-multicolumn-column">
+
```json
{
"status": 400,
@@ -1950,6 +2406,9 @@ Returns a revision identified by its ID
}
```
+ </div>
+ </div>
+
### Get the content of a revision
`GET /revisions/{revisionId}/content` · `getRevisionContent`
@@ -1974,12 +2433,18 @@ Returns revision content identified by its ID
* `application/json; charset=utf-8`: `Error`
+ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">
+ <div class="trilium-multicolumn-column">
+
| Property | Type | Description |
| --- | --- | --- |
| `status` <br>_required_ | `integer (int32)` | HTTP status, identical to the one given in HTTP response |
| `code` <br>_required_ | `string` | stable string constant |
| `message` <br>_required_ | `string` | Human readable error, potentially with more details, |
+ </div>
+ <div class="trilium-multicolumn-column">
+
```json
{
"status": 400,
@@ -1988,6 +2453,9 @@ Returns revision content identified by its ID
}
```
+ </div>
+ </div>
+
## Calendar
Day, week, month and year notes of the journal, and the inbox note.
@@ -2012,6 +2480,9 @@ returns an "inbox" note, into which note can be created. Date will be used depen
* `application/json; charset=utf-8`: `Note`
+ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">
+ <div class="trilium-multicolumn-column">
+
| Property | Type | Description |
| --- | --- | --- |
| `noteId` | `EntityId` | |
@@ -2030,6 +2501,9 @@ returns an "inbox" note, into which note can be created. Date will be used depen
| `utcDateCreated` | `UtcDateTime` | |
| `utcDateModified` | `UtcDateTime` | Writable through PATCH, e.g. to restore a migrated note's date after its content was rewritten. The local dateModified is derived from it. |
+ </div>
+ <div class="trilium-multicolumn-column">
+
```json
{
"noteId": "evnnmvHTCgIn",
@@ -2069,16 +2543,25 @@ returns an "inbox" note, into which note can be created. Date will be used depen
}
```
+ </div>
+ </div>
+
=== "default: unexpected error"
* `application/json; charset=utf-8`: `Error`
+ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">
+ <div class="trilium-multicolumn-column">
+
| Property | Type | Description |
| --- | --- | --- |
| `status` <br>_required_ | `integer (int32)` | HTTP status, identical to the one given in HTTP response |
| `code` <br>_required_ | `string` | stable string constant |
| `message` <br>_required_ | `string` | Human readable error, potentially with more details, |
+ </div>
+ <div class="trilium-multicolumn-column">
+
```json
{
"status": 400,
@@ -2087,6 +2570,9 @@ returns an "inbox" note, into which note can be created. Date will be used depen
}
```
+ </div>
+ </div>
+
### Get a day note
`GET /calendar/days/{date}` · `getDayNote`
@@ -2107,6 +2593,9 @@ returns a day note for a given date. Gets created if doesn't exist.
* `application/json; charset=utf-8`: `Note`
+ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">
+ <div class="trilium-multicolumn-column">
+
| Property | Type | Description |
| --- | --- | --- |
| `noteId` | `EntityId` | |
@@ -2125,6 +2614,9 @@ returns a day note for a given date. Gets created if doesn't exist.
| `utcDateCreated` | `UtcDateTime` | |
| `utcDateModified` | `UtcDateTime` | Writable through PATCH, e.g. to restore a migrated note's date after its content was rewritten. The local dateModified is derived from it. |
+ </div>
+ <div class="trilium-multicolumn-column">
+
```json
{
"noteId": "evnnmvHTCgIn",
@@ -2164,16 +2656,25 @@ returns a day note for a given date. Gets created if doesn't exist.
}
```
+ </div>
+ </div>
+
=== "default: unexpected error"
* `application/json; charset=utf-8`: `Error`
+ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">
+ <div class="trilium-multicolumn-column">
+
| Property | Type | Description |
| --- | --- | --- |
| `status` <br>_required_ | `integer (int32)` | HTTP status, identical to the one given in HTTP response |
| `code` <br>_required_ | `string` | stable string constant |
| `message` <br>_required_ | `string` | Human readable error, potentially with more details, |
+ </div>
+ <div class="trilium-multicolumn-column">
+
```json
{
"status": 400,
@@ -2182,6 +2683,9 @@ returns a day note for a given date. Gets created if doesn't exist.
}
```
+ </div>
+ </div>
+
### Get the day note starting the week
`GET /calendar/week-first-day/{date}` · `getWeekFirstDayNote`
@@ -2202,6 +2706,9 @@ Returns the day note for the first day of the week containing the given date, ho
* `application/json; charset=utf-8`: `Note`
+ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">
+ <div class="trilium-multicolumn-column">
+
| Property | Type | Description |
| --- | --- | --- |
| `noteId` | `EntityId` | |
@@ -2220,6 +2727,9 @@ Returns the day note for the first day of the week containing the given date, ho
| `utcDateCreated` | `UtcDateTime` | |
| `utcDateModified` | `UtcDateTime` | Writable through PATCH, e.g. to restore a migrated note's date after its content was rewritten. The local dateModified is derived from it. |
+ </div>
+ <div class="trilium-multicolumn-column">
+
```json
{
"noteId": "evnnmvHTCgIn",
@@ -2259,16 +2769,25 @@ Returns the day note for the first day of the week containing the given date, ho
}
```
+ </div>
+ </div>
+
=== "default: unexpected error"
* `application/json; charset=utf-8`: `Error`
+ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">
+ <div class="trilium-multicolumn-column">
+
| Property | Type | Description |
| --- | --- | --- |
| `status` <br>_required_ | `integer (int32)` | HTTP status, identical to the one given in HTTP response |
| `code` <br>_required_ | `string` | stable string constant |
| `message` <br>_required_ | `string` | Human readable error, potentially with more details, |
+ </div>
+ <div class="trilium-multicolumn-column">
+
```json
{
"status": 400,
@@ -2277,6 +2796,9 @@ Returns the day note for the first day of the week containing the given date, ho
}
```
+ </div>
+ </div>
+
### Get a week note
`GET /calendar/weeks/{week}` · `getWeekNote`
@@ -2297,6 +2819,9 @@ Returns a week note for a given ISO week (format YYYY-Www, e.g., 2025-W01). The
* `application/json; charset=utf-8`: `Note`
+ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">
+ <div class="trilium-multicolumn-column">
+
| Property | Type | Description |
| --- | --- | --- |
| `noteId` | `EntityId` | |
@@ -2315,6 +2840,9 @@ Returns a week note for a given ISO week (format YYYY-Www, e.g., 2025-W01). The
| `utcDateCreated` | `UtcDateTime` | |
| `utcDateModified` | `UtcDateTime` | Writable through PATCH, e.g. to restore a migrated note's date after its content was rewritten. The local dateModified is derived from it. |
+ </div>
+ <div class="trilium-multicolumn-column">
+
```json
{
"noteId": "evnnmvHTCgIn",
@@ -2354,16 +2882,25 @@ Returns a week note for a given ISO week (format YYYY-Www, e.g., 2025-W01). The
}
```
+ </div>
+ </div>
+
=== "default: unexpected error"
* `application/json; charset=utf-8`: `Error`
+ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">
+ <div class="trilium-multicolumn-column">
+
| Property | Type | Description |
| --- | --- | --- |
| `status` <br>_required_ | `integer (int32)` | HTTP status, identical to the one given in HTTP response |
| `code` <br>_required_ | `string` | stable string constant |
| `message` <br>_required_ | `string` | Human readable error, potentially with more details, |
+ </div>
+ <div class="trilium-multicolumn-column">
+
```json
{
"status": 400,
@@ -2372,6 +2909,9 @@ Returns a week note for a given ISO week (format YYYY-Www, e.g., 2025-W01). The
}
```
+ </div>
+ </div>
+
### Get a month note
`GET /calendar/months/{month}` · `getMonthNote`
@@ -2392,6 +2932,9 @@ Returns a month note for a given month (format YYYY-MM, e.g., 2022-02). The note
* `application/json; charset=utf-8`: `Note`
+ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">
+ <div class="trilium-multicolumn-column">
+
| Property | Type | Description |
| --- | --- | --- |
| `noteId` | `EntityId` | |
@@ -2410,6 +2953,9 @@ Returns a month note for a given month (format YYYY-MM, e.g., 2022-02). The note
| `utcDateCreated` | `UtcDateTime` | |
| `utcDateModified` | `UtcDateTime` | Writable through PATCH, e.g. to restore a migrated note's date after its content was rewritten. The local dateModified is derived from it. |
+ </div>
+ <div class="trilium-multicolumn-column">
+
```json
{
"noteId": "evnnmvHTCgIn",
@@ -2449,16 +2995,25 @@ Returns a month note for a given month (format YYYY-MM, e.g., 2022-02). The note
}
```
+ </div>
+ </div>
+
=== "default: unexpected error"
* `application/json; charset=utf-8`: `Error`
+ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">
+ <div class="trilium-multicolumn-column">
+
| Property | Type | Description |
| --- | --- | --- |
| `status` <br>_required_ | `integer (int32)` | HTTP status, identical to the one given in HTTP response |
| `code` <br>_required_ | `string` | stable string constant |
| `message` <br>_required_ | `string` | Human readable error, potentially with more details, |
+ </div>
+ <div class="trilium-multicolumn-column">
+
```json
{
"status": 400,
@@ -2467,6 +3022,9 @@ Returns a month note for a given month (format YYYY-MM, e.g., 2022-02). The note
}
```
+ </div>
+ </div>
+
### Get a year note
`GET /calendar/years/{year}` · `getYearNote`
@@ -2487,6 +3045,9 @@ Returns a year note for a given year (format YYYY, e.g., 2022). The note is crea
* `application/json; charset=utf-8`: `Note`
+ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">
+ <div class="trilium-multicolumn-column">
+
| Property | Type | Description |
| --- | --- | --- |
| `noteId` | `EntityId` | |
@@ -2505,6 +3066,9 @@ Returns a year note for a given year (format YYYY, e.g., 2022). The note is crea
| `utcDateCreated` | `UtcDateTime` | |
| `utcDateModified` | `UtcDateTime` | Writable through PATCH, e.g. to restore a migrated note's date after its content was rewritten. The local dateModified is derived from it. |
+ </div>
+ <div class="trilium-multicolumn-column">
+
```json
{
"noteId": "evnnmvHTCgIn",
@@ -2544,16 +3108,25 @@ Returns a year note for a given year (format YYYY, e.g., 2022). The note is crea
}
```
+ </div>
+ </div>
+
=== "default: unexpected error"
* `application/json; charset=utf-8`: `Error`
+ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">
+ <div class="trilium-multicolumn-column">
+
| Property | Type | Description |
| --- | --- | --- |
| `status` <br>_required_ | `integer (int32)` | HTTP status, identical to the one given in HTTP response |
| `code` <br>_required_ | `string` | stable string constant |
| `message` <br>_required_ | `string` | Human readable error, potentially with more details, |
+ </div>
+ <div class="trilium-multicolumn-column">
+
```json
{
"status": 400,
@@ -2562,6 +3135,9 @@ Returns a year note for a given year (format YYYY, e.g., 2022). The note is crea
}
```
+ </div>
+ </div>
+
## Tokens
Obtaining and revoking ETAPI tokens with the password.
@@ -2578,32 +3154,50 @@ get an ETAPI token based on password for further use with ETAPI. Too many reques
* `application/json`: `object`
+<div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">
+<div class="trilium-multicolumn-column">
+
| Property | Type | Description |
| --- | --- | --- |
| `password` | `string` | user's password used to e.g. login to Trilium server and/or protect notes |
+</div>
+<div class="trilium-multicolumn-column">
+
```json
{
"password": "string"
}
```
+</div>
+</div>
+
**Responses**
=== "201: auth token"
* `application/json; charset=utf-8`: `object`
+ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">
+ <div class="trilium-multicolumn-column">
+
| Property | Type | Description |
| --- | --- | --- |
| `authToken` | `string` | |
+ </div>
+ <div class="trilium-multicolumn-column">
+
```json
{
"authToken": "Bc4bFn0Ffiok_4NpbVCDnFz7B2WU+pdhW8B5Ne3DiR5wXrEyqdjgRIsk="
}
```
+ </div>
+ </div>
+
=== "429: too many requests"
No content.
@@ -2612,12 +3206,18 @@ get an ETAPI token based on password for further use with ETAPI. Too many reques
* `application/json; charset=utf-8`: `Error`
+ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">
+ <div class="trilium-multicolumn-column">
+
| Property | Type | Description |
| --- | --- | --- |
| `status` <br>_required_ | `integer (int32)` | HTTP status, identical to the one given in HTTP response |
| `code` <br>_required_ | `string` | stable string constant |
| `message` <br>_required_ | `string` | Human readable error, potentially with more details, |
+ </div>
+ <div class="trilium-multicolumn-column">
+
```json
{
"status": 400,
@@ -2626,6 +3226,9 @@ get an ETAPI token based on password for further use with ETAPI. Too many reques
}
```
+ </div>
+ </div>
+
### Log out
`POST /auth/logout` · `logout`
@@ -2644,12 +3247,18 @@ logout (delete/deactivate) an ETAPI token
* `application/json; charset=utf-8`: `Error`
+ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">
+ <div class="trilium-multicolumn-column">
+
| Property | Type | Description |
| --- | --- | --- |
| `status` <br>_required_ | `integer (int32)` | HTTP status, identical to the one given in HTTP response |
| `code` <br>_required_ | `string` | stable string constant |
| `message` <br>_required_ | `string` | Human readable error, potentially with more details, |
+ </div>
+ <div class="trilium-multicolumn-column">
+
```json
{
"status": 400,
@@ -2658,6 +3267,9 @@ logout (delete/deactivate) an ETAPI token
}
```
+ </div>
+ </div>
+
## Application
Information about the instance, backups and metrics.
@@ -2676,6 +3288,9 @@ returns information about the running Trilium instance
* `application/json; charset=utf-8`: `AppInfo`
+ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">
+ <div class="trilium-multicolumn-column">
+
| Property | Type | Description |
| --- | --- | --- |
| `appVersion` | `string` | Trilium version |
@@ -2687,6 +3302,9 @@ returns information about the running Trilium instance
| `clipperProtocolVersion` | `string` | version of the supported Trilium Web Clipper protocol |
| `utcDateTime` | `string` | current UTC date time |
+ </div>
+ <div class="trilium-multicolumn-column">
+
```json
{
"appVersion": "0.50.2",
@@ -2700,16 +3318,25 @@ returns information about the running Trilium instance
}
```
+ </div>
+ </div>
+
=== "default: unexpected error"
* `application/json; charset=utf-8`: `Error`
+ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">
+ <div class="trilium-multicolumn-column">
+
| Property | Type | Description |
| --- | --- | --- |
| `status` <br>_required_ | `integer (int32)` | HTTP status, identical to the one given in HTTP response |
| `code` <br>_required_ | `string` | stable string constant |
| `message` <br>_required_ | `string` | Human readable error, potentially with more details, |
+ </div>
+ <div class="trilium-multicolumn-column">
+
```json
{
"status": 400,
@@ -2718,6 +3345,9 @@ returns information about the running Trilium instance
}
```
+ </div>
+ </div>
+
### Create a backup
`PUT /backup/{backupName}` · `createBackup`
@@ -2742,12 +3372,18 @@ Create a database backup under a given name
* `application/json; charset=utf-8`: `Error`
+ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">
+ <div class="trilium-multicolumn-column">
+
| Property | Type | Description |
| --- | --- | --- |
| `status` <br>_required_ | `integer (int32)` | HTTP status, identical to the one given in HTTP response |
| `code` <br>_required_ | `string` | stable string constant |
| `message` <br>_required_ | `string` | Human readable error, potentially with more details, |
+ </div>
+ <div class="trilium-multicolumn-column">
+
```json
{
"status": 400,
@@ -2756,6 +3392,9 @@ Create a database backup under a given name
}
```
+ </div>
+ </div>
+
### Get instance metrics
`GET /metrics` · `getMetrics`
@@ -2779,6 +3418,9 @@ The same data is served by GET /api/metrics to the web session.
* `text/plain`: `string`
* `application/json`: `Metrics`
+ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">
+ <div class="trilium-multicolumn-column">
+
| Property | Type | Description |
| --- | --- | --- |
| `version` | `object` | |
@@ -2788,6 +3430,9 @@ The same data is served by GET /api/metrics to the web session.
| `statistics` | `object` | |
| `timestamp` | `string` | |
+ </div>
+ <div class="trilium-multicolumn-column">
+
```json
{
"version": {
@@ -2831,16 +3476,25 @@ The same data is served by GET /api/metrics to the web session.
}
```
+ </div>
+ </div>
+
=== "default: unexpected error"
* `application/json; charset=utf-8`: `Error`
+ <div class="trilium-multicolumn-layout" data-trilium-column-ratios="1-1">
+ <div class="trilium-multicolumn-column">
+
| Property | Type | Description |
| --- | --- | --- |
| `status` <br>_required_ | `integer (int32)` | HTTP status, identical to the one given in HTTP response |
| `code` <br>_required_ | `string` | stable string constant |
| `message` <br>_required_ | `string` | Human readable error, potentially with more details, |
+ </div>
+ <div class="trilium-multicolumn-column">
+
```json
{
"status": 400,
@@ -2849,6 +3503,9 @@ The same data is served by GET /api/metrics to the web session.
}
```
+ </div>
+ </div>
+
## Schemas
### `CreateNoteDef`