API Reference
This is the internal API used by the Trilium Notes client application.
Important: This API is primarily intended for internal use by the Trilium client. For external integrations, please use the ETAPI (External Trilium API) instead.
Signing in
Most endpoints require session-based authentication. You can authenticate using:
- Password login: POST to
/loginwith password - Token authentication: Generate a token via
/api/login/token - Sync authentication: Use document secret for sync operations
Rate Limiting
Authentication endpoints are rate-limited to prevent brute force attacks.
CSRF Protection
State-changing operations require CSRF tokens when using session authentication.
Authentication
sessionAuth
API key in the trilium.sid cookie.
Session cookie obtained from login
tokenAuth
API key in the Authorization header.
API token in format "Bearer {token}"
Sessions
Login, logout, and session management
Login with password
POST /login · login
Responds with 401 when the password is wrong or, with two-factor authentication enabled, the TOTP token is missing or wrong.
Authorization: none
Request body (required)
application/x-www-form-urlencoded:object
| Property | Description |
|---|---|
password required | string (password) |
totpToken | string TOTP token if 2FA is enabled |
Responses
200: Login successful
Response headers
| Name | Description |
|---|---|
Set-Cookie | string Example: trilium.sid=s%3A... |
No content.
401: Invalid credentials
No content.
Generate API token
POST /api/login/token · generateToken
Authorization: none
Request body (required)
application/json:object
| Property | Description |
|---|---|
password required | string (password) |
tokenName | string Optional name for the token |
{
"password": "string",
"tokenName": "string"
}Responses
201: Token created
application/json:object
| Property | Description |
|---|---|
authToken | string API authentication token |
{
"authToken": "string"
}Sync login using document secret
POST /api/login/sync · loginSync
Authorization: none
Request body (required)
application/json:object
| Property | Description |
|---|---|
timestamp required | string (date-time) |
hash required | string HMAC hash of document secret and timestamp |
syncVersion required | integer |
{
"timestamp": "2019-08-24T14:15:22Z",
"hash": "string",
"syncVersion": 0
}Responses
200: Login successful
application/json:object
| Property | Description |
|---|---|
instanceId | string |
maxEntityChangeId | string |
{
"instanceId": "string",
"maxEntityChangeId": "string"
}400: Sync version / document secret mismatch
application/json:object
| Property | Description |
|---|---|
message | string |
{
"message": "Non-matching sync versions, local is version ${server syncVersion}, remote is ${requested syncVersion}. It is recommended to run same version of Trilium on both sides of sync"
}401: Timestamp mismatch
application/json:object
| Property | Description |
|---|---|
message | string |
{
"message": "Auth request time is out of sync, please check that both client and server have correct time. The difference between clocks has to be smaller than 5 minutes"
}Enter protected session
POST /api/login/protected · enterProtectedSession
Authorization: sessionAuth or tokenAuth
Request body (required)
application/json:object
| Property | Description |
|---|---|
password required | string (password) |
{
"password": "string"
}Responses
200: Protected session entered
No content.
401: Invalid password
No content.
Exit protected session
POST /api/logout/protected · exitProtectedSession
Authorization: sessionAuth or tokenAuth
Responses
204: Protected session exited
No content.
Keep protected session alive
POST /api/login/protected/touch · touchProtectedSession
Authorization: sessionAuth or tokenAuth
Responses
204: Session refreshed
No content.
Get OAuth status
GET /api/oauth/status · getOAuthStatus
Authorization: sessionAuth or tokenAuth
Responses
200: OAuth status
application/json:object
| Property | Description |
|---|---|
enabled | boolean |
configured | boolean |
providers | array of string |
{
"enabled": true,
"configured": true,
"providers": [
"string"
]
}Validate OAuth configuration
GET /api/oauth/validate · validateOAuth
Authorization: sessionAuth or tokenAuth
Responses
200: OAuth validation result
application/json:object
| Property | Description |
|---|---|
valid | boolean |
errors | array of string |
{
"valid": true,
"errors": [
"string"
]
}Notes
Core note operations
Get note metadata
GET /api/notes/{noteId} · getNote
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
noteId required | string 12-character note ID |
Responses
200: Note metadata
application/json:Note
| Property | Description |
|---|---|
noteId required | string 12-character note ID |
title required | string Note title |
type required | NoteType One of text, code, render, file, image, search, relationMap, book, noteMap, mermaid, canvas, webView, launcher, doc, contentWidget, mindMap, geoMap. |
mime required | string MIME type |
isProtected required | boolean Whether note is protected |
blobId | string ID of content blob |
dateCreated | DateTime |
dateModified | DateTime |
utcDateCreated | UtcDateTime Result of new Date().toISOString().replace('T', ' ') |
utcDateModified | UtcDateTime Result of new Date().toISOString().replace('T', ' ') |
{
"noteId": "ur11rSfHkzeV",
"title": "string",
"type": "text",
"mime": "text/html",
"isProtected": true,
"blobId": "string",
"dateCreated": "2025-02-14 08:19:59.203+0100",
"dateModified": "2025-02-14 08:19:59.203+0100",
"utcDateCreated": "2025-02-13 07:42:47.698Z",
"utcDateModified": "2025-02-13 07:42:47.698Z"
}404: Note not found
No content.
Delete note
DELETE /api/notes/{noteId} · deleteNote
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
noteId required | string 12-character note ID |
Query parameters
| Name | Description |
|---|---|
taskId required | string Task group identifier |
eraseNotes | boolean |
last required | boolean Whether this is the last request of this task group |
Responses
204: Note deleted
No content.
404: Note not found
No content.
Get note content
GET /api/notes/{noteId}/blob · getNoteContent
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
noteId required | string 12-character note ID |
Responses
200: Note content
application/json:Blob
| Property | Description |
|---|---|
blobId | string |
content | string | null null if not text. |
contentLength | integer |
dateModified | DateTime |
utcDateModified | UtcDateTime Result of new Date().toISOString().replace('T', ' ') |
{
"blobId": "8iqMIB8eiY1tPYmElfjm",
"content": "string",
"contentLength": 0,
"dateModified": "2025-02-14 08:19:59.203+0100",
"utcDateModified": "2025-02-13 07:42:47.698Z"
}404: Note not found
No content.
Update note content
PUT /api/notes/{noteId}/data · updateNoteContent
Saves the content of a note. A save with base names the version that the content is based on: it is refused with 409, and saves nothing, when the note has another format (type, or Markdown and other code) or another blob, or when an attachment row does not hold. In such a save, a row with attachmentId replaces that attachment only while it is at blobId, and a row without one creates an attachment of its title, refused when the note has one. The answer is what the next save is based on. A save without base is unconditional, and answers 204.
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
noteId required | string 12-character note ID |
Request body (required)
application/json:object
| Property | Description |
|---|---|
content required | string |
attachments | array of SavedAttachmentRow |
base | NoteSaveBase What a save of the content of a note is based on |
keepOther | boolean Saves over the version that base names, which another writer saved, after the note keeps that version as a revision |
{
"content": "string",
"attachments": [
{
"attachmentId": "string",
"blobId": "string",
"role": "string",
"title": "string",
"mime": "string",
"content": "string",
"position": 0,
"encoding": "base64"
}
],
"base": {
"blobId": "string",
"type": "string",
"mime": "string"
},
"keepOther": true
}Responses
200: Content updated, by a save with base
application/json:object
| Property | Description |
|---|---|
blobId required | string |
attachments required | array of SavedAttachmentBase The attachments that the save created or replaced |
content | string The content as stored, when the server changed what was sent |
{
"blobId": "string",
"attachments": [
{
"attachmentId": "string",
"title": "string",
"blobId": "string"
}
],
"content": "string"
}204: Content updated, by a save without base
No content.
400: A malformed base, or keepOther without base
No content.
404: Note not found
No content.
409: The note has another format or version than the save is based on
application/json:SaveConflict
| Property | Description |
|---|---|
reason required | string One of format, version. |
message required | string |
blobId required | string The blob of the note now, which a save that keeps its version names |
type required | string |
mime required | string |
isVersioned required | boolean Whether the note keeps revisions |
attachments required | array of SavedAttachmentBase The attachments that the save names, by ID or by title, as the note has them now. A save that keeps its version replaces them at these blobs. |
{
"reason": "format",
"message": "string",
"blobId": "string",
"type": "string",
"mime": "string",
"isVersioned": true,
"attachments": [
{
"attachmentId": "string",
"title": "string",
"blobId": "string"
}
]
}Get note timestamps
GET /api/notes/{noteId}/metadata · getNoteMetadata
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
noteId required | string 12-character note ID |
Responses
200: Note timestamps
application/json:Timestamps
| Property | Description |
|---|---|
dateCreated | DateTime |
dateModified | DateTime |
utcDateCreated | UtcDateTime Result of new Date().toISOString().replace('T', ' ') |
utcDateModified | UtcDateTime Result of new Date().toISOString().replace('T', ' ') |
{
"dateCreated": "2025-02-14 08:19:59.203+0100",
"dateModified": "2025-02-14 08:19:59.203+0100",
"utcDateCreated": "2025-02-13 07:42:47.698Z",
"utcDateModified": "2025-02-13 07:42:47.698Z"
}404: Note not found
No content.
Get blocks of a text note
GET /api/notes/{noteId}/blocks · getNoteBlocks
The blocks of a text note that block points at, as their exact HTML source, so that an excerpt can edit them apart from the rest of the note. The range must be a run of whole sibling blocks. A run of list items comes inside a copy of its list, numbered as in the note.
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
noteId required | string 12-character note ID |
Query parameters
| Name | Description |
|---|---|
block required | string The block id of one block, or the ids of the first and the last block of a range joined with : |
Responses
200: The HTML of the blocks
application/json:object
| Property | Description |
|---|---|
content required | string |
hash required | string The hash of content, which a save of the blocks is based on |
note required | string The whole note that content was read from, which a draft of the blocks goes into |
{
"content": "<p data-trilium-block-id=\"eaJkN47U8kI4\">First paragraph</p>",
"hash": "string",
"note": "string"
}400: No block parameter, a note that is not a text note, or a protected note without a protected session
No content.
404: The note or a block of the range does not exist, or the range is not a run of whole sibling blocks
No content.
Replace blocks of a text note
PUT /api/notes/{noteId}/blocks · updateNoteBlocks
Replaces the blocks that block points at with content and saves the note as PUT /api/notes/{noteId}/data does, with a revision when one is due. The rest of the note keeps its bytes. Block ids in content that the note holds outside the range are removed. For a run of list items, content is a list: when its tag and class match the original list, its items replace the run and its other attributes apply to the whole list; otherwise the original list is split around content. block is the range as the note stores it before the change; once the blocks at its edges change, later requests use the new range.
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
noteId required | string 12-character note ID |
Query parameters
| Name | Description |
|---|---|
block required | string The block id of one block, or the ids of the first and the last block of a range joined with : |
Request body (required)
application/json:object
| Property | Description |
|---|---|
content required | string The HTML of the blocks |
attachments | array of SavedAttachmentRow |
base | object The hash of the blocks as read. The save is refused with 409 when the blocks have changed since; a change elsewhere in the note goes through. |
base.hash required | string |
keepOther | boolean Saves over the blocks that base names, after the note keeps its version as a revision |
block | string The range of the blocks after the save, when it differs from block |
{
"content": "<p data-trilium-block-id=\"eaJkN47U8kI4\">First paragraph</p>",
"attachments": [
{
"attachmentId": "string",
"blobId": "string",
"role": "string",
"title": "string",
"mime": "string",
"content": "string",
"position": 0,
"encoding": "base64"
}
],
"base": {
"hash": "string"
},
"keepOther": true,
"block": "string"
}Responses
200: Blocks replaced, by a save with base
application/json:object
| Property | Description |
|---|---|
hash required | string | null The hash of the blocks as saved, null when they cannot be read apart |
note required | string The whole note as the save left it, which a draft of the blocks goes into |
attachments required | array of SavedAttachmentBase The attachments that the save created or replaced |
{
"hash": "string",
"note": "string",
"attachments": [
{
"attachmentId": "string",
"title": "string",
"blobId": "string"
}
]
}204: Blocks replaced, by a save without base
No content.
400: No block parameter, no content, a malformed base, keepOther without base, a note that is not a text note in a save without base, or a protected note without a protected session
No content.
404: The note or a block of the range does not exist, or the range is not a run of whole sibling blocks
No content.
409: The blocks, or an attachment that the save replaces, changed since they were read (version), or the blocks can no longer be saved apart (format, range)
application/json:BlocksVersionConflict|BlocksGoneConflict
{
"reason": "version",
"message": "string",
"hash": "string",
"attachments": [
{
"attachmentId": "string",
"title": "string",
"blobId": "string"
}
],
"isVersioned": true
}List the places inside a note that a link can point at
GET /api/notes/{noteId}/references · getNoteReferences
The targets of a note, such as the headings and anchors of a text note, in the order that the link lists show them, the targets of each kind together. A link points at a target by adding its params to the path of the note: a heading of a text note through ?block= and its block id, an anchor through ?bookmark=. A target without params needs a reference first, which POST /api/notes/{noteId}/references creates. Such a target is listed only when the note can take one. Titles are plain text, never HTML. A note whose type has no targets lists none. The headings of a PDF file, the headings and bookmarks of a Word (DOCX) or OpenDocument text (ODT) file, and the entries of an EPUB e-book's table of contents come from its ToC cache, which the server builds when it is missing or stale. Where the server cannot read PDFs (standalone, mobile), the answer for a PDF lists none and carries pendingToc until the viewer of the file has built the cache. A DOCX, ODT or EPUB file links a heading through ?heading=, and a DOCX or ODT file a bookmark through ?bookmark=. An entry of an EPUB's table of contents that its preview does not show is not listed.
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
noteId required | string 12-character note ID |
Responses
200: The targets of the note
application/json:NoteReferences
| Property | Description |
|---|---|
targets required | array of ReferenceTarget |
blobId | string The blob of the note that the targets were read from |
pendingToc | PendingToc A table of contents that the viewer of the document builds |
{
"targets": [
{
"kind": "heading",
"title": "Installation",
"level": 2,
"params": {
"block": "eaJkN47U8kI4"
}
}
],
"blobId": "string",
"pendingToc": {
"format": "pdf"
}
}400: A protected note without a protected session
No content.
404: Note not found
No content.
Give a target a reference
POST /api/notes/{noteId}/references · createNoteReference
Gives a target that GET /api/notes/{noteId}/references lists without params a reference, unless it has one, and returns the link parameters that point at it. A request names the target by exactly one of index and line. By index, the target is the one at that position among the targets of its kind while its title is still title, otherwise the only target of that kind with that title. By line, which only Markdown notes take, it is the only heading whose block starts on that source line, while its title is title. A request that names the blobId of its listing is refused with 409, reason listing, when the note has another blob: the targets are then listed again. For a heading of a text note, the reference is a block id. Read-only notes get the reference too. It is the only change to the content, and no revision is saved.
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
noteId required | string 12-character note ID |
Request body (required)
application/json:object
| Property | Description |
|---|---|
kind required | ReferenceKind The kind of a target, which sets how the link lists show it. One of heading, anchor. |
index | integer The position of the target among the targets of its kind. Not sent with line. |
line | integer The 1-based source line where the block of a heading of a Markdown note starts, in the blob blobId. Not sent with index, and requires blobId. |
title required | string The title of the target there |
blobId | string The blobId of the listing that the target was picked from. Required with line. |
{
"kind": "heading",
"index": 0,
"line": 12,
"title": "Installation",
"blobId": "string"
}Responses
200: The link parameters of the target
application/json:object
| Property | Description |
|---|---|
params required | ReferenceParams The parameters of a link that point at a target, not encoded |
{
"params": {
"block": "eaJkN47U8kI4"
}
}400: A malformed request, a note whose targets take no reference, a line for a note that is not Markdown, a protected note without a protected session, or a note whose content cannot be changed, such as a help page
No content.
404: Note not found
No content.
409: No target matches, because the targets changed since they were listed, or the listing was read from another blob (reason listing)
No content.
List the headings of a text note with its content marked by their positions
GET /api/notes/{noteId}/references/marked · getMarkedNoteHeadings
For a read-only view of a text note, which parses the content otherwise than the server. Answers the heading targets as GET /api/notes/{noteId}/references lists them, before any filtering, and the content with data-trilium-heading-index on the opening tag of each of them, valued <markToken>.<position>. The position is the index that POST /api/notes/{noteId}/references takes. markToken is drawn for each answer and occurs nowhere in the content. Writes nothing.
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
noteId required | string 12-character note ID |
Responses
200: The headings and the marked content
application/json:object
| Property | Description |
|---|---|
blobId | string The blob that the headings and the content were read from, absent for a note without one |
headings required | array of ReferenceTarget |
markedContent required | string The content with each heading marked; never saved |
markToken required | string The token that every mark of this answer starts with |
{
"blobId": "string",
"headings": [
{
"kind": "heading",
"title": "Installation",
"level": 2,
"params": {
"block": "eaJkN47U8kI4"
}
}
],
"markedContent": "string",
"markToken": "Xb2kQ9pLm4Rt"
}400: A note that is not a text note, or a protected note without a protected session
No content.
404: Note not found
No content.
Read the ToC cache of a note
GET /api/notes/{noteId}/toc · getNoteToc
The table of contents that the ToC cache of a note holds, such as the outline of a PDF file, the headings of a DOCX or ODT file or the entries of an EPUB e-book's table of contents, without building it or writing anything. ready is a cache of the note as it is, stale one of an earlier blob, missing a note without a cache that can be read, unavailable a note that is gone or protected without a protected session, and none a note that has no table of contents. pendingToc tells that the viewer of the document builds the cache, since the server cannot read the format. Each heading carries the params of a link to it.
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
noteId required | string 12-character note ID |
Responses
200: The cached table of contents
application/json:CachedToc
| Property | Description |
|---|---|
status required | string One of ready, stale, missing, unreadable, unavailable, none. |
blobId | string For ready and stale, the blob that the headings were read from |
headings | array of TocHeading |
pendingToc | PendingToc A table of contents that the viewer of the document builds |
{
"status": "ready",
"blobId": "string",
"headings": [
{
"id": "0k3x9aa1h7q2mz",
"title": "Installation",
"level": 1,
"params": {
"page": "4",
"heading": "0k3x9aa1h7q2mz"
}
}
],
"pendingToc": {
"format": "pdf"
}
}Save the table of contents that the viewer read
PUT /api/notes/{noteId}/toc · saveNoteToc
Saves the table of contents that the viewer of a document read, where the server cannot read the format itself, which is PDF on standalone and mobile. The server checks it, normalizes the titles and computes the ids of the headings. A valid cache that exists already is kept.
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
noteId required | string 12-character note ID |
Request body (required)
application/json:ClientToc
| Property | Description |
|---|---|
targetBlobHash required | string The blobId of the bytes that the viewer read, from their digest |
headings required | array of object In document order, without ids: title (at most 500 characters), level (1 for the first heading, at most one more than the heading before), and the fields of the format |
properties | object The properties of the format, such as { "reader": 2 } |
isCut | boolean Whether the viewer stopped reading at 20,000 headings, before another one. The ids of every heading of a cut table of contents are bound to the blob. |
elapsedMs required | number How long the viewer took, for the log |
{
"targetBlobHash": "string",
"headings": [
{}
],
"properties": {},
"isCut": true,
"elapsedMs": 0
}Responses
200: The saved cache
application/json:CachedToc
| Property | Description |
|---|---|
status required | string One of ready, stale, missing, unreadable, unavailable, none. |
blobId | string For ready and stale, the blob that the headings were read from |
headings | array of TocHeading |
pendingToc | PendingToc A table of contents that the viewer of the document builds |
{
"status": "ready",
"blobId": "string",
"headings": [
{
"id": "0k3x9aa1h7q2mz",
"title": "Installation",
"level": 1,
"params": {
"page": "4",
"heading": "0k3x9aa1h7q2mz"
}
}
],
"pendingToc": {
"format": "pdf"
}
}400: A malformed table of contents, a note without a table of contents format, a protected note without a protected session, or a server that reads the format itself
No content.
404: Note not found
No content.
409: The note has another blob than the one the viewer read (reason changed)
No content.
Build the ToC cache of a note
POST /api/notes/{noteId}/toc/build · buildNoteToc
Answers the ToC cache of a note, and builds and saves it first when it is not valid and the server can read the format. Where only the viewer can read it (PDF on standalone and mobile), answers as GET /api/notes/{noteId}/toc does, with pendingToc. unreadable is a file whose table of contents cannot be read.
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
noteId required | string 12-character note ID |
Responses
200: The table of contents
application/json:CachedToc
| Property | Description |
|---|---|
status required | string One of ready, stale, missing, unreadable, unavailable, none. |
blobId | string For ready and stale, the blob that the headings were read from |
headings | array of TocHeading |
pendingToc | PendingToc A table of contents that the viewer of the document builds |
{
"status": "ready",
"blobId": "string",
"headings": [
{
"id": "0k3x9aa1h7q2mz",
"title": "Installation",
"level": 1,
"params": {
"page": "4",
"heading": "0k3x9aa1h7q2mz"
}
}
],
"pendingToc": {
"format": "pdf"
}
}409: The note changed during two builds in a row
No content.
Change note title
PUT /api/notes/{noteId}/title · updateNoteTitle
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
noteId required | string 12-character note ID |
Request body (required)
application/json:object
| Property | Description |
|---|---|
title required | string |
{
"title": "string"
}Responses
204: Title updated
No content.
404: Note not found
No content.
Change note type and MIME
PUT /api/notes/{noteId}/type · updateNoteType
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
noteId required | string 12-character note ID |
Request body (required)
application/json:object
| Property | Description |
|---|---|
type required | NoteType One of text, code, render, file, image, search, relationMap, book, noteMap, mermaid, canvas, webView, launcher, doc, contentWidget, mindMap, geoMap. |
mime required | string |
{
"type": "text",
"mime": "string"
}Responses
204: Type updated
No content.
404: Note not found
No content.
Protect or unprotect note
PUT /api/notes/{noteId}/protect/{isProtected} · protectNote
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
noteId required | string 12-character note ID |
isProtected required | boolean |
Query parameters
| Name | Description |
|---|---|
subtree | boolean |
Responses
204: Protection status updated
No content.
404: Note not found
No content.
Undelete note
PUT /api/notes/{noteId}/undelete · undeleteNote
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
noteId required | string 12-character note ID |
Responses
204: Note undeleted
No content.
404: Note not found
No content.
Create new note
POST /api/notes/{parentNoteId}/children · createNote
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
parentNoteId required | string |
Query parameters
| Name | Description |
|---|---|
target | string One of after, into. |
targetBranchId | string |
Request body (required)
application/json:CreateNoteRequest
| Property | Description |
|---|---|
title required | string |
content | string |
type required | NoteType One of text, code, render, file, image, search, relationMap, book, noteMap, mermaid, canvas, webView, launcher, doc, contentWidget, mindMap, geoMap. |
mime | string |
isProtected | boolean |
isExpanded | boolean |
notePosition | integer |
prefix | string |
parentNoteId | string |
templateNoteId | string |
{
"title": "string",
"content": "string",
"type": "text",
"mime": "string",
"isProtected": true,
"isExpanded": true,
"notePosition": 0,
"prefix": "string",
"parentNoteId": "string",
"templateNoteId": "string"
}Responses
201: Note created
application/json:object
{
"note": {
"noteId": "ur11rSfHkzeV",
"title": "string",
"type": "text",
"mime": "text/html",
"isProtected": true,
"blobId": "string",
"dateCreated": "2025-02-14 08:19:59.203+0100",
"dateModified": "2025-02-14 08:19:59.203+0100",
"utcDateCreated": "2025-02-13 07:42:47.698Z",
"utcDateModified": "2025-02-13 07:42:47.698Z"
},
"branch": {
"branchId": "string",
"noteId": "string",
"parentNoteId": "string",
"notePosition": 0,
"prefix": "string",
"isExpanded": true
}
}Duplicate note subtree
POST /api/notes/{noteId}/duplicate/{parentNoteId} · duplicateNote
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
noteId required | string 12-character note ID |
parentNoteId required | string |
Responses
201: Note duplicated
application/json:Note
| Property | Description |
|---|---|
noteId required | string 12-character note ID |
title required | string Note title |
type required | NoteType One of text, code, render, file, image, search, relationMap, book, noteMap, mermaid, canvas, webView, launcher, doc, contentWidget, mindMap, geoMap. |
mime required | string MIME type |
isProtected required | boolean Whether note is protected |
blobId | string ID of content blob |
dateCreated | DateTime |
dateModified | DateTime |
utcDateCreated | UtcDateTime Result of new Date().toISOString().replace('T', ' ') |
utcDateModified | UtcDateTime Result of new Date().toISOString().replace('T', ' ') |
{
"noteId": "ur11rSfHkzeV",
"title": "string",
"type": "text",
"mime": "text/html",
"isProtected": true,
"blobId": "string",
"dateCreated": "2025-02-14 08:19:59.203+0100",
"dateModified": "2025-02-14 08:19:59.203+0100",
"utcDateCreated": "2025-02-13 07:42:47.698Z",
"utcDateModified": "2025-02-13 07:42:47.698Z"
}Force save revision
POST /api/notes/{noteId}/revision · saveRevision
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
noteId required | string 12-character note ID |
Responses
201: Revision saved
application/json:Revision
| Property | Description |
|---|---|
revisionId | string |
noteId | string |
title | string |
type | NoteType One of text, code, render, file, image, search, relationMap, book, noteMap, mermaid, canvas, webView, launcher, doc, contentWidget, mindMap, geoMap. |
mime | string |
dateCreated | DateTime |
utcDateCreated | UtcDateTime Result of new Date().toISOString().replace('T', ' ') |
{
"revisionId": "string",
"noteId": "string",
"title": "string",
"type": "text",
"mime": "string",
"dateCreated": "2025-02-14 08:19:59.203+0100",
"utcDateCreated": "2025-02-13 07:42:47.698Z"
}Sort child notes
PUT /api/notes/{noteId}/sort-children · sortChildren
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
noteId required | string 12-character note ID |
Request body (required)
application/json:object
| Property | Description |
|---|---|
sortBy | string One of title, dateCreated, dateModified. |
sortDirection | string One of asc, desc. |
foldersFirst | boolean |
sortNatural | boolean |
sortLocale | string |
{
"sortBy": "title",
"sortDirection": "asc",
"foldersFirst": true,
"sortNatural": true,
"sortLocale": "string"
}Responses
204: Children sorted
No content.
Convert note to attachment
POST /api/notes/{noteId}/convert-to-attachment · convertToAttachment
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
noteId required | string 12-character note ID |
Responses
200: Note converted to attachment
application/json:Attachment
| Property | Description |
|---|---|
attachmentId required | string |
ownerId required | string |
role required | string One of image, file. |
mime required | string |
title required | string |
blobId | string |
dateModified | DateTime |
utcDateModified | UtcDateTime Result of new Date().toISOString().replace('T', ' ') |
{
"attachmentId": "string",
"ownerId": "string",
"role": "image",
"mime": "string",
"title": "string",
"blobId": "string",
"dateModified": "2025-02-14 08:19:59.203+0100",
"utcDateModified": "2025-02-13 07:42:47.698Z"
}Upload file to note
PUT /api/notes/{noteId}/file · uploadFileToNote
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
noteId required | string 12-character note ID |
Request body (required)
multipart/form-data:object
| Property | Description |
|---|---|
upload | string (binary) |
Responses
200: File uploaded
application/json:FileUploaded
| Property | Description |
|---|---|
uploaded required | boolean |
blobId | string The blob that the upload wrote |
message | string Why nothing was uploaded |
{
"uploaded": true,
"blobId": "string",
"message": "string"
}Open file note
GET /api/notes/{noteId}/open · openFileNote
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
noteId required | string 12-character note ID |
Query parameters
| Name | Description |
|---|---|
blobId | string The blob that the caller expects. When the content holds another one, the route answers 409 without the content. |
Responses
200: File content
application/octet-stream:string (binary)
409: The note holds another blob than blobId
No content.
Download file note
GET /api/notes/download/{noteId} · downloadFileNote
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
noteId required | string 12-character note ID |
Responses
200: File content
Response headers
| Name | Description |
|---|---|
Content-Disposition | string Example: attachment; filename="document.pdf" |
application/octet-stream:string (binary)
Download file note (alternative path)
GET /api/notes/{noteId}/download · downloadFileNoteAlt
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
noteId required | string 12-character note ID |
Responses
200: File content
Response headers
| Name | Description |
|---|---|
Content-Disposition | string Example: attachment; filename="document.pdf" |
application/octet-stream:string (binary)
Save note to temp directory
POST /api/notes/{noteId}/save-to-tmp-dir · saveToTmpDir
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
noteId required | string 12-character note ID |
Responses
200: File saved to temp directory
application/json:object
| Property | Description |
|---|---|
filePath | string |
{
"filePath": "string"
}Update note from modified temp file
POST /api/notes/{noteId}/upload-modified-file · uploadModifiedFile
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
noteId required | string 12-character note ID |
Request body (required)
application/json:object
| Property | Description |
|---|---|
filePath required | string |
{
"filePath": "string"
}Responses
204: Note updated from file
No content.
Retrieve the timestamps of several notes at once
POST /api/notes/metadata · notesMetadata
Authorization: sessionAuth or tokenAuth
Request body (required)
application/json:object
| Property | Description |
|---|---|
noteIds | array of string |
{
"noteIds": [
"string"
]
}Responses
200: The timestamps of each note found, keyed by note ID
application/json:object
{}Get image from note
GET /api/images/{noteId}/{filename} · getNoteImage
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
noteId required | string 12-character note ID |
filename required | string |
Responses
200: Image content
image/*:string (binary)
Update image note
PUT /api/images/{noteId} · updateImageNote
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
noteId required | string 12-character note ID |
Request body (required)
multipart/form-data:object
| Property | Description |
|---|---|
upload | string (binary) |
Responses
204: Image updated
No content.
Execute bulk action
POST /api/bulk-action/execute · executeBulkAction
Authorization: sessionAuth or tokenAuth
Request body (required)
application/json:object
| Property | Description |
|---|---|
action | string |
noteIds | array of string |
{
"action": "string",
"noteIds": [
"string"
]
}Responses
200: Bulk action results
No content.
Get affected notes count
POST /api/bulk-action/affected-notes · getAffectedNotesCount
Authorization: sessionAuth or tokenAuth
Request body (required)
application/json:object
| Property | Description |
|---|---|
action | string |
noteIds | array of string |
{
"action": "string",
"noteIds": [
"string"
]
}Responses
200: Affected notes count
application/json:object
| Property | Description |
|---|---|
count | integer |
{
"count": 0
}Preview note deletion
POST /api/delete-notes-preview · previewNoteDeletion
Authorization: sessionAuth or tokenAuth
Request body (required)
application/json:object
| Property | Description |
|---|---|
branchIdsToDelete | array of string |
deleteAllClones | boolean |
{
"branchIdsToDelete": [
"string"
],
"deleteAllClones": true
}Responses
200: Deletion preview
application/json:object
| Property | Description |
|---|---|
notesToDelete | array of string |
{
"notesToDelete": [
"string"
]
}Erase deleted notes
POST /api/notes/erase-deleted-notes-now · eraseDeletedNotes
Authorization: sessionAuth or tokenAuth
Responses
204: Deleted notes erased
No content.
Tree
Note tree structure and branches
Get tree structure
GET /api/tree · getTree
Authorization: sessionAuth or tokenAuth
Query parameters
| Name | Description |
|---|---|
subTreeNoteId | string Limit tree to this note and descendants |
Responses
200: Tree structure
application/json:object
{
"notes": [
{
"noteId": "ur11rSfHkzeV",
"title": "string",
"type": "text",
"mime": "text/html",
"isProtected": true,
"blobId": "string",
"dateCreated": "2025-02-14 08:19:59.203+0100",
"dateModified": "2025-02-14 08:19:59.203+0100",
"utcDateCreated": "2025-02-13 07:42:47.698Z",
"utcDateModified": "2025-02-13 07:42:47.698Z"
}
],
"branches": [
{
"branchId": "string",
"noteId": "string",
"parentNoteId": "string",
"notePosition": 0,
"prefix": "string",
"isExpanded": true
}
],
"attributes": [
{
"attributeId": "string",
"noteId": "string",
"type": "label",
"name": "string",
"value": "string",
"position": 0,
"isInheritable": true
}
]
}Load specific notes
POST /api/tree/load · loadNotes
Authorization: sessionAuth or tokenAuth
Request body (required)
application/json:object
| Property | Description |
|---|---|
noteIds required | array of string |
{
"noteIds": [
"string"
]
}Responses
200: Loaded notes
application/json:object
{
"notes": [
{
"noteId": "ur11rSfHkzeV",
"title": "string",
"type": "text",
"mime": "text/html",
"isProtected": true,
"blobId": "string",
"dateCreated": "2025-02-14 08:19:59.203+0100",
"dateModified": "2025-02-14 08:19:59.203+0100",
"utcDateCreated": "2025-02-13 07:42:47.698Z",
"utcDateModified": "2025-02-13 07:42:47.698Z"
}
],
"branches": [
{
"branchId": "string",
"noteId": "string",
"parentNoteId": "string",
"notePosition": 0,
"prefix": "string",
"isExpanded": true
}
],
"attributes": [
{
"attributeId": "string",
"noteId": "string",
"type": "label",
"name": "string",
"value": "string",
"position": 0,
"isInheritable": true
}
]
}Delete branch
DELETE /api/branches/{branchId} · deleteBranch
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
branchId required | string |
Query parameters
| Name | Description |
|---|---|
taskId required | string Task group identifier |
eraseNotes | boolean |
last required | boolean Whether this is the last request of this task group |
Responses
200: Branch deleted
application/json:object
| Property | Description |
|---|---|
noteDeleted | boolean Whether the last note clone was deleted |
{
"noteDeleted": true
}Move branch to new parent
PUT /api/branches/{branchId}/move-to/{parentBranchId} · moveBranchToParent
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
branchId required | string |
parentBranchId required | string |
Responses
204: Branch moved
No content.
Move branch before another
PUT /api/branches/{branchId}/move-before/{beforeBranchId} · moveBranchBefore
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
branchId required | string |
beforeBranchId required | string |
Responses
204: Branch moved
No content.
Move branch after another
PUT /api/branches/{branchId}/move-after/{afterBranchId} · moveBranchAfter
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
branchId required | string |
afterBranchId required | string |
Responses
204: Branch moved
No content.
Set branch expanded state
PUT /api/branches/{branchId}/expanded/{expanded} · setBranchExpanded
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
branchId required | string |
expanded required | boolean |
Responses
204: Expanded state updated
No content.
Set subtree expanded state
PUT /api/branches/{branchId}/expanded-subtree/{expanded} · setSubtreeExpanded
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
branchId required | string |
expanded required | boolean |
Responses
204: Subtree expanded state updated
No content.
Set branch prefix
PUT /api/branches/{branchId}/set-prefix · setBranchPrefix
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
branchId required | string |
Request body (required)
application/json:object
| Property | Description |
|---|---|
prefix | string | null |
{
"prefix": "string"
}Responses
204: Prefix updated
No content.
Clone note to branch
PUT /api/notes/{noteId}/clone-to-branch/{parentBranchId} · cloneToBranch
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
noteId required | string 12-character note ID |
parentBranchId required | string |
Responses
200: Note cloned
application/json:Branch
| Property | Description |
|---|---|
branchId required | string Branch ID (parentNoteId_noteId) |
noteId required | string |
parentNoteId required | string |
notePosition required | integer |
prefix | string | null |
isExpanded | boolean |
{
"branchId": "string",
"noteId": "string",
"parentNoteId": "string",
"notePosition": 0,
"prefix": "string",
"isExpanded": true
}Clone note to parent note
PUT /api/notes/{noteId}/clone-to-note/{parentNoteId} · cloneToNote
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
noteId required | string 12-character note ID |
parentNoteId required | string |
Responses
200: Note cloned
application/json:Branch
| Property | Description |
|---|---|
branchId required | string Branch ID (parentNoteId_noteId) |
noteId required | string |
parentNoteId required | string |
notePosition required | integer |
prefix | string | null |
isExpanded | boolean |
{
"branchId": "string",
"noteId": "string",
"parentNoteId": "string",
"notePosition": 0,
"prefix": "string",
"isExpanded": true
}Clone note after branch
PUT /api/notes/{noteId}/clone-after/{afterBranchId} · cloneAfterBranch
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
noteId required | string 12-character note ID |
afterBranchId required | string |
Responses
200: Note cloned
application/json:Branch
| Property | Description |
|---|---|
branchId required | string Branch ID (parentNoteId_noteId) |
noteId required | string |
parentNoteId required | string |
notePosition required | integer |
prefix | string | null |
isExpanded | boolean |
{
"branchId": "string",
"noteId": "string",
"parentNoteId": "string",
"notePosition": 0,
"prefix": "string",
"isExpanded": true
}Clone note before branch
PUT /api/notes/{noteId}/clone-before/{beforeBranchId} · cloneBeforeBranch
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
noteId required | string 12-character note ID |
beforeBranchId required | string |
Responses
200: Note cloned
application/json:Branch
| Property | Description |
|---|---|
branchId required | string Branch ID (parentNoteId_noteId) |
noteId required | string |
parentNoteId required | string |
notePosition required | integer |
prefix | string | null |
isExpanded | boolean |
{
"branchId": "string",
"noteId": "string",
"parentNoteId": "string",
"notePosition": 0,
"prefix": "string",
"isExpanded": true
}Toggle note presence in parent
PUT /api/notes/{noteId}/toggle-in-parent/{parentNoteId}/{present} · toggleInParent
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
noteId required | string 12-character note ID |
parentNoteId required | string |
present required | boolean |
Responses
204: Presence toggled
No content.
Attributes
Note attributes and metadata
Get effective note attributes
GET /api/notes/{noteId}/attributes · getNoteAttributes
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
noteId required | string 12-character note ID |
Responses
200: Note attributes
application/json: array ofAttribute
[
{
"attributeId": "string",
"noteId": "string",
"type": "label",
"name": "string",
"value": "string",
"position": 0,
"isInheritable": true
}
]Update all note attributes
PUT /api/notes/{noteId}/attributes · updateNoteAttributes
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
noteId required | string 12-character note ID |
Request body (required)
application/json: array ofAttribute
[
{
"attributeId": "string",
"noteId": "string",
"type": "label",
"name": "string",
"value": "string",
"position": 0,
"isInheritable": true
}
]Responses
204: Attributes updated
No content.
Add note attribute
POST /api/notes/{noteId}/attributes · addNoteAttribute
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
noteId required | string 12-character note ID |
Request body (required)
application/json:Attribute
| Property | Description |
|---|---|
attributeId required | string |
noteId required | string |
type required | string One of label, relation. |
name required | string |
value required | string |
position | integer |
isInheritable | boolean |
{
"attributeId": "string",
"noteId": "string",
"type": "label",
"name": "string",
"value": "string",
"position": 0,
"isInheritable": true
}Responses
201: Attribute added
application/json:Attribute
| Property | Description |
|---|---|
attributeId required | string |
noteId required | string |
type required | string One of label, relation. |
name required | string |
value required | string |
position | integer |
isInheritable | boolean |
{
"attributeId": "string",
"noteId": "string",
"type": "label",
"name": "string",
"value": "string",
"position": 0,
"isInheritable": true
}Delete attribute
DELETE /api/notes/{noteId}/attributes/{attributeId} · deleteAttribute
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
noteId required | string 12-character note ID |
attributeId required | string |
Responses
204: Attribute deleted
No content.
Update single attribute
PUT /api/notes/{noteId}/attribute · updateAttribute
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
noteId required | string 12-character note ID |
Request body (required)
application/json:Attribute
| Property | Description |
|---|---|
attributeId required | string |
noteId required | string |
type required | string One of label, relation. |
name required | string |
value required | string |
position | integer |
isInheritable | boolean |
{
"attributeId": "string",
"noteId": "string",
"type": "label",
"name": "string",
"value": "string",
"position": 0,
"isInheritable": true
}Responses
204: Attribute updated
No content.
Set attribute value
PUT /api/notes/{noteId}/set-attribute · setAttribute
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
noteId required | string 12-character note ID |
Request body (required)
application/json:object
| Property | Description |
|---|---|
type required | string One of label, relation. |
name required | string |
value required | string |
{
"type": "label",
"name": "string",
"value": "string"
}Responses
204: Attribute set
No content.
Create relation
PUT /api/notes/{noteId}/relations/{name}/to/{targetNoteId} · createRelation
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
noteId required | string 12-character note ID |
name required | string |
targetNoteId required | string |
Responses
204: Relation created
No content.
Delete relation
DELETE /api/notes/{noteId}/relations/{name}/to/{targetNoteId} · deleteRelation
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
noteId required | string 12-character note ID |
name required | string |
targetNoteId required | string |
Responses
204: Relation deleted
No content.
Get attribute name suggestions
GET /api/attribute-names · getAttributeNames
Authorization: sessionAuth or tokenAuth
Query parameters
| Name | Description |
|---|---|
type required | string One of label, relation. |
query | string |
Responses
200: Attribute names
application/json:array of string
[
"string"
]Get values for attribute
GET /api/attribute-values/{attributeName} · getAttributeValues
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
attributeName required | string |
Responses
200: Attribute values
application/json:array of string
[
"string"
]Attachments
File attachments
Stream file with partial content support
GET /api/attachments/{attachmentId}/open-partial · openPartialFileAttachment
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
attachmentId required | string |
Header parameters
| Name | Description |
|---|---|
Range | string |
Responses
206: Partial content
Response headers
| Name | Description |
|---|---|
Content-Range | string Example: bytes 0-1023/146515 |
application/octet-stream:string (binary)
Get note attachments
GET /api/notes/{noteId}/attachments · getNoteAttachments
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
noteId required | string 12-character note ID |
Responses
200: Note attachments
application/json: array ofAttachment
[
{
"attachmentId": "string",
"ownerId": "string",
"role": "image",
"mime": "string",
"title": "string",
"blobId": "string",
"dateModified": "2025-02-14 08:19:59.203+0100",
"utcDateModified": "2025-02-13 07:42:47.698Z"
}
]Save attachment
POST /api/notes/{noteId}/attachments · saveAttachment
Saves an attachment of the note, replacing the one that matchBy finds or creating one. A save with blobId names the blob that the replaced attachment was read at: it is refused with 409, and saves nothing, when that attachment has another blob now. The answer is what the next save is based on. A save without blobId is unconditional, and answers 204.
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
noteId required | string 12-character note ID |
Query parameters
| Name | Description |
|---|---|
matchBy | string How the attachment to replace is found: by attachmentId (the default) or by title. One of attachmentId, title. |
Request body (required)
application/json:object
| Property | Description |
|---|---|
attachmentId | string |
role required | string |
mime required | string |
title required | string |
content | string |
blobId | string The blob that the replaced attachment was read at |
keepOther | boolean Saves over the attachment that another writer saved, after the note keeps its version as a revision |
{
"attachmentId": "string",
"role": "string",
"mime": "string",
"title": "string",
"content": "string",
"blobId": "string",
"keepOther": true
}Responses
200: Attachment saved, by a save with blobId
application/json:SavedAttachmentBase
| Property | Description |
|---|---|
attachmentId required | string |
title required | string |
blobId required | string |
{
"attachmentId": "string",
"title": "string",
"blobId": "string"
}204: Attachment saved, by a save without blobId
No content.
400: A blobId that is not a string, or keepOther without blobId
No content.
404: Note not found
No content.
409: The replaced attachment has another blob than the save is based on. attachments holds that attachment as it is now.
application/json:SaveConflict
| Property | Description |
|---|---|
reason required | string One of format, version. |
message required | string |
blobId required | string The blob of the note now, which a save that keeps its version names |
type required | string |
mime required | string |
isVersioned required | boolean Whether the note keeps revisions |
attachments required | array of SavedAttachmentBase The attachments that the save names, by ID or by title, as the note has them now. A save that keeps its version replaces them at these blobs. |
{
"reason": "format",
"message": "string",
"blobId": "string",
"type": "string",
"mime": "string",
"isVersioned": true,
"attachments": [
{
"attachmentId": "string",
"title": "string",
"blobId": "string"
}
]
}Upload attachment file
POST /api/notes/{noteId}/attachments/upload · uploadAttachment
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
noteId required | string 12-character note ID |
Query parameters
| Name | Description |
|---|---|
link | boolean true answers with a link to the attachment instead of an image URL, and stores a picture as uploaded, without compressing it or shortening its name. |
Request body (required)
multipart/form-data:object
| Property | Description |
|---|---|
upload | string (binary) |
Responses
201: Attachment uploaded
application/json:Attachment
| Property | Description |
|---|---|
attachmentId required | string |
ownerId required | string |
role required | string One of image, file. |
mime required | string |
title required | string |
blobId | string |
dateModified | DateTime |
utcDateModified | UtcDateTime Result of new Date().toISOString().replace('T', ' ') |
{
"attachmentId": "string",
"ownerId": "string",
"role": "image",
"mime": "string",
"title": "string",
"blobId": "string",
"dateModified": "2025-02-14 08:19:59.203+0100",
"utcDateModified": "2025-02-13 07:42:47.698Z"
}Get attachment metadata
GET /api/attachments/{attachmentId} · getAttachment
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
attachmentId required | string |
Responses
200: Attachment metadata
application/json:Attachment
| Property | Description |
|---|---|
attachmentId required | string |
ownerId required | string |
role required | string One of image, file. |
mime required | string |
title required | string |
blobId | string |
dateModified | DateTime |
utcDateModified | UtcDateTime Result of new Date().toISOString().replace('T', ' ') |
{
"attachmentId": "string",
"ownerId": "string",
"role": "image",
"mime": "string",
"title": "string",
"blobId": "string",
"dateModified": "2025-02-14 08:19:59.203+0100",
"utcDateModified": "2025-02-13 07:42:47.698Z"
}Delete attachment
DELETE /api/attachments/{attachmentId} · deleteAttachment
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
attachmentId required | string |
Responses
204: Attachment deleted
No content.
Get attachment content
GET /api/attachments/{attachmentId}/blob · getAttachmentBlob
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
attachmentId required | string |
Query parameters
| Name | Description |
|---|---|
preview | boolean |
Responses
200: Attachment content
application/octet-stream:string (binary)
List the places inside an attachment that a link can point at
GET /api/attachments/{attachmentId}/references · getAttachmentReferences
The twin of GET /api/notes/{noteId}/references for an attachment, such as the headings of a PDF, DOCX or ODT file or the entries of an EPUB e-book's table of contents. The ToC cache of an attachment is kept on its note.
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
attachmentId required | string |
Responses
200: The targets of the attachment
application/json:NoteReferences
| Property | Description |
|---|---|
targets required | array of ReferenceTarget |
blobId | string The blob of the note that the targets were read from |
pendingToc | PendingToc A table of contents that the viewer of the document builds |
{
"targets": [
{
"kind": "heading",
"title": "Installation",
"level": 2,
"params": {
"block": "eaJkN47U8kI4"
}
}
],
"blobId": "string",
"pendingToc": {
"format": "pdf"
}
}400: A protected attachment without a protected session
No content.
404: Attachment not found
No content.
Read the ToC cache of an attachment
GET /api/attachments/{attachmentId}/toc · getAttachmentToc
The twin of GET /api/notes/{noteId}/toc for an attachment.
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
attachmentId required | string |
Responses
200: The cached table of contents
application/json:CachedToc
| Property | Description |
|---|---|
status required | string One of ready, stale, missing, unreadable, unavailable, none. |
blobId | string For ready and stale, the blob that the headings were read from |
headings | array of TocHeading |
pendingToc | PendingToc A table of contents that the viewer of the document builds |
{
"status": "ready",
"blobId": "string",
"headings": [
{
"id": "0k3x9aa1h7q2mz",
"title": "Installation",
"level": 1,
"params": {
"page": "4",
"heading": "0k3x9aa1h7q2mz"
}
}
],
"pendingToc": {
"format": "pdf"
}
}Save the table of contents that the viewer of an attachment read
PUT /api/attachments/{attachmentId}/toc · saveAttachmentToc
The twin of PUT /api/notes/{noteId}/toc for an attachment.
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
attachmentId required | string |
Request body (required)
application/json:ClientToc
| Property | Description |
|---|---|
targetBlobHash required | string The blobId of the bytes that the viewer read, from their digest |
headings required | array of object In document order, without ids: title (at most 500 characters), level (1 for the first heading, at most one more than the heading before), and the fields of the format |
properties | object The properties of the format, such as { "reader": 2 } |
isCut | boolean Whether the viewer stopped reading at 20,000 headings, before another one. The ids of every heading of a cut table of contents are bound to the blob. |
elapsedMs required | number How long the viewer took, for the log |
{
"targetBlobHash": "string",
"headings": [
{}
],
"properties": {},
"isCut": true,
"elapsedMs": 0
}Responses
200: The saved cache
application/json:CachedToc
| Property | Description |
|---|---|
status required | string One of ready, stale, missing, unreadable, unavailable, none. |
blobId | string For ready and stale, the blob that the headings were read from |
headings | array of TocHeading |
pendingToc | PendingToc A table of contents that the viewer of the document builds |
{
"status": "ready",
"blobId": "string",
"headings": [
{
"id": "0k3x9aa1h7q2mz",
"title": "Installation",
"level": 1,
"params": {
"page": "4",
"heading": "0k3x9aa1h7q2mz"
}
}
],
"pendingToc": {
"format": "pdf"
}
}400: A malformed table of contents, or one the server does not take
No content.
404: Attachment not found
No content.
409: The attachment has another blob than the one the viewer read (reason changed)
No content.
Build the ToC cache of an attachment
POST /api/attachments/{attachmentId}/toc/build · buildAttachmentToc
The twin of POST /api/notes/{noteId}/toc/build for an attachment.
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
attachmentId required | string |
Responses
200: The table of contents
application/json:CachedToc
| Property | Description |
|---|---|
status required | string One of ready, stale, missing, unreadable, unavailable, none. |
blobId | string For ready and stale, the blob that the headings were read from |
headings | array of TocHeading |
pendingToc | PendingToc A table of contents that the viewer of the document builds |
{
"status": "ready",
"blobId": "string",
"headings": [
{
"id": "0k3x9aa1h7q2mz",
"title": "Installation",
"level": 1,
"params": {
"page": "4",
"heading": "0k3x9aa1h7q2mz"
}
}
],
"pendingToc": {
"format": "pdf"
}
}409: The attachment changed during two builds in a row
No content.
Rename attachment
PUT /api/attachments/{attachmentId}/rename · renameAttachment
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
attachmentId required | string |
Request body (required)
application/json:object
| Property | Description |
|---|---|
title required | string |
{
"title": "string"
}Responses
204: Attachment renamed
No content.
Convert attachment to note
POST /api/attachments/{attachmentId}/convert-to-note · convertAttachmentToNote
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
attachmentId required | string |
Responses
200: Attachment converted to note
application/json:Note
| Property | Description |
|---|---|
noteId required | string 12-character note ID |
title required | string Note title |
type required | NoteType One of text, code, render, file, image, search, relationMap, book, noteMap, mermaid, canvas, webView, launcher, doc, contentWidget, mindMap, geoMap. |
mime required | string MIME type |
isProtected required | boolean Whether note is protected |
blobId | string ID of content blob |
dateCreated | DateTime |
dateModified | DateTime |
utcDateCreated | UtcDateTime Result of new Date().toISOString().replace('T', ' ') |
utcDateModified | UtcDateTime Result of new Date().toISOString().replace('T', ' ') |
{
"noteId": "ur11rSfHkzeV",
"title": "string",
"type": "text",
"mime": "text/html",
"isProtected": true,
"blobId": "string",
"dateCreated": "2025-02-14 08:19:59.203+0100",
"dateModified": "2025-02-14 08:19:59.203+0100",
"utcDateCreated": "2025-02-13 07:42:47.698Z",
"utcDateModified": "2025-02-13 07:42:47.698Z"
}Update attachment file
PUT /api/attachments/{attachmentId}/file · updateAttachmentFile
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
attachmentId required | string |
Request body (required)
multipart/form-data:object
| Property | Description |
|---|---|
upload | string (binary) |
Responses
200: Attachment file updated
application/json:FileUploaded
| Property | Description |
|---|---|
uploaded required | boolean |
blobId | string The blob that the upload wrote |
message | string Why nothing was uploaded |
{
"uploaded": true,
"blobId": "string",
"message": "string"
}Open attachment
GET /api/attachments/{attachmentId}/open · openAttachment
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
attachmentId required | string |
Query parameters
| Name | Description |
|---|---|
blobId | string The blob that the caller expects. When the content holds another one, the route answers 409 without the content. |
Responses
200: Attachment content
application/octet-stream:string (binary)
409: The attachment holds another blob than blobId
No content.
Download attachment
GET /api/attachments/download/{attachmentId} · downloadAttachment
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
attachmentId required | string |
Responses
200: Attachment content
Response headers
| Name | Description |
|---|---|
Content-Disposition | string Example: attachment; filename="document.pdf" |
application/octet-stream:string (binary)
Download attachment (alternative path)
GET /api/attachments/{attachmentId}/download · downloadAttachmentAlt
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
attachmentId required | string |
Responses
200: Attachment content
Response headers
| Name | Description |
|---|---|
Content-Disposition | string Example: attachment; filename="document.pdf" |
application/octet-stream:string (binary)
Get all attachment information
GET /api/attachments/{attachmentId}/all · getAllAttachmentInfo
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
attachmentId required | string |
Responses
200: Attachment information
application/json:object
| Property | Description |
|---|---|
attachmentId | string |
title | string |
mime | string |
isProtected | boolean |
position | integer |
contentLength | integer |
ownerId | string |
dateCreated | string (date-time) |
dateModified | string (date-time) |
{
"attachmentId": "string",
"title": "string",
"mime": "string",
"isProtected": true,
"position": 0,
"contentLength": 0,
"ownerId": "string",
"dateCreated": "2019-08-24T14:15:22Z",
"dateModified": "2019-08-24T14:15:22Z"
}Save attachment to temporary directory
POST /api/attachments/{attachmentId}/save-to-tmp-dir · saveAttachmentToTmpDir
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
attachmentId required | string |
Responses
200: Attachment saved
application/json:object
| Property | Description |
|---|---|
tmpPath | string Path to temporary file |
success | boolean |
{
"tmpPath": "string",
"success": true
}Upload modified attachment file
POST /api/attachments/{attachmentId}/upload-modified-file · uploadModifiedAttachmentFile
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
attachmentId required | string |
Request body (required)
multipart/form-data:object
| Property | Description |
|---|---|
upload | string (binary) |
Responses
200: Modified file uploaded
application/json:object
| Property | Description |
|---|---|
success | boolean |
{
"success": true
}Get attached image
GET /api/attachments/{attachmentId}/image/{filename} · getAttachmentImage
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
attachmentId required | string |
filename required | string |
Responses
200: Image content
image/*:string (binary)
Erase unused attachments
POST /api/notes/erase-unused-attachments-now · eraseUnusedAttachments
Authorization: sessionAuth or tokenAuth
Responses
204: Unused attachments erased
No content.
Revisions
Note revision history
Get note revisions
GET /api/notes/{noteId}/revisions · getNoteRevisions
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
noteId required | string 12-character note ID |
Responses
200: Note revisions
application/json: array ofRevision
[
{
"revisionId": "string",
"noteId": "string",
"title": "string",
"type": "text",
"mime": "string",
"dateCreated": "2025-02-14 08:19:59.203+0100",
"utcDateCreated": "2025-02-13 07:42:47.698Z"
}
]Erase all note revisions
DELETE /api/notes/{noteId}/revisions · eraseNoteRevisions
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
noteId required | string 12-character note ID |
Responses
204: Revisions erased
No content.
Keep unsaved changes as a revision
POST /api/notes/{noteId}/revisions/draft · saveDraftRevision
Keeps the changes that an editor could not save, after a conflict or a conversion of the note, as a revision in the format they were written in, with their attachment edits written into the copies of the attachments. A draft of an excerpt is put into fragment.base.note, the note as its editor read it, not as it is now. Without a base, or where that note no longer holds the blocks with the hash fragment.base.hash, the revision holds the blocks alone, with the source fragment, and cannot be restored. A repeated request with the same revisionId makes one revision. A note that keeps no revisions keeps no draft.
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
noteId required | string 12-character note ID |
Request body (required)
application/json:object
| Property | Description |
|---|---|
revisionId required | string Drawn by the client once for each draft |
type required | string |
mime required | string |
content | string The content of the whole note; or fragment |
fragment | object The edited blocks of an excerpt, and the range they replace |
fragment.content required | string |
fragment.block required | string |
fragment.base | object The note that the blocks were read from |
fragment.base.note required | string The content of the whole note, as the editor last read or saved it |
fragment.base.hash required | string The hash of the blocks of the range in note |
attachments | array of SavedAttachmentRow |
{
"revisionId": "string",
"type": "string",
"mime": "string",
"content": "string",
"fragment": {
"content": "string",
"block": "string",
"base": {
"note": "string",
"hash": "string"
}
},
"attachments": [
{
"attachmentId": "string",
"blobId": "string",
"role": "string",
"title": "string",
"mime": "string",
"content": "string",
"position": 0,
"encoding": "base64"
}
]
}Responses
200: The revision of the draft
application/json:object
| Property | Description |
|---|---|
revisionId required | string |
isKept required | boolean Whether the note keeps the revision |
isFragment required | boolean Whether the revision holds the blocks alone |
{
"revisionId": "string",
"isKept": true,
"isFragment": true
}400: A malformed draft, a revision ID of another note, or a note whose content is not available
No content.
404: Note not found
No content.
Get revision details
GET /api/revisions/{revisionId} · getRevision
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
revisionId required | string |
Responses
200: Revision details
application/json:Revision
| Property | Description |
|---|---|
revisionId | string |
noteId | string |
title | string |
type | NoteType One of text, code, render, file, image, search, relationMap, book, noteMap, mermaid, canvas, webView, launcher, doc, contentWidget, mindMap, geoMap. |
mime | string |
dateCreated | DateTime |
utcDateCreated | UtcDateTime Result of new Date().toISOString().replace('T', ' ') |
{
"revisionId": "string",
"noteId": "string",
"title": "string",
"type": "text",
"mime": "string",
"dateCreated": "2025-02-14 08:19:59.203+0100",
"utcDateCreated": "2025-02-13 07:42:47.698Z"
}Erase revision
DELETE /api/revisions/{revisionId} · eraseRevision
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
revisionId required | string |
Responses
204: Revision erased
No content.
Get revision content
GET /api/revisions/{revisionId}/blob · getRevisionBlob
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
revisionId required | string |
Query parameters
| Name | Description |
|---|---|
preview | boolean |
Responses
200: Revision content
text/html:stringtext/plain:stringapplication/octet-stream:string (binary)
Restore revision
POST /api/revisions/{revisionId}/restore · restoreRevision
Restores the revision as the content of its note, with its attachments, and the links and relations of that content.
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
revisionId required | string |
Responses
204: Revision restored, or there is no revision of that ID
No content.
400: A revision of the source fragment, which holds blocks of the note alone
No content.
Download revision
GET /api/revisions/{revisionId}/download · downloadRevision
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
revisionId required | string |
Responses
200: Revision content
Response headers
| Name | Description |
|---|---|
Content-Disposition | string |
application/octet-stream:string (binary)
Cleanup old revisions
POST /api/revisions/erase-all-excess-revisions · eraseExcessRevisions
Authorization: sessionAuth or tokenAuth
Request body
application/json:object
| Property | Description |
|---|---|
snapshotsToKeep | integer Snapshots to keep per note, standing in for the revisionSnapshotNumberLimit option. -1 keeps every snapshot, 0 keeps none. Omitted, the option applies. A note carrying a valid #versioningLimit follows its own label instead. |
keepNamedSnapshots | boolean Spare named snapshots (those with a description) from erasure and leave them out of the count, so the limit governs the automatic snapshots alone. |
{
"snapshotsToKeep": 0,
"keepNamedSnapshots": true
}Responses
200: Excess revisions erased
application/json:object
| Property | Description |
|---|---|
erasedCount | integer |
{
"erasedCount": 0
}400: Invalid options
No content.
Get notes edited on date
GET /api/edited-notes/{date} · getEditedNotes
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
date required | string (date) |
Responses
200: Edited notes
application/json: array ofNote
[
{
"noteId": "ur11rSfHkzeV",
"title": "string",
"type": "text",
"mime": "text/html",
"isProtected": true,
"blobId": "string",
"dateCreated": "2025-02-14 08:19:59.203+0100",
"dateModified": "2025-02-14 08:19:59.203+0100",
"utcDateCreated": "2025-02-13 07:42:47.698Z",
"utcDateModified": "2025-02-13 07:42:47.698Z"
}
]Get image from revision
GET /api/revisions/{revisionId}/image/{filename} · getRevisionImage
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
revisionId required | string |
filename required | string |
Responses
200: Image content
image/*:string (binary)
Search
Search and discovery
Full text search
GET /api/search · search
Authorization: sessionAuth or tokenAuth
Query parameters
| Name | Description |
|---|---|
searchString required | string |
Responses
200: Search results
application/json: array ofSearchResult
[
{
"noteId": "string",
"title": "string",
"path": "string",
"score": 0,
"highlights": [
"string"
]
}
]400: Missing or empty search string
No content.
Quick search with highlighting
GET /api/quick-search · quickSearch
Authorization: sessionAuth or tokenAuth
Query parameters
| Name | Description |
|---|---|
searchString required | string |
Responses
200: Quick search results
application/json: array ofSearchResult
[
{
"noteId": "string",
"title": "string",
"path": "string",
"score": 0,
"highlights": [
"string"
]
}
]400: Missing or empty search string
No content.
Execute search note
GET /api/search-note/{noteId} · executeSearchNote
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
noteId required | string 12-character note ID |
Responses
200: Search results
application/json: array ofSearchResult
[
{
"noteId": "string",
"title": "string",
"path": "string",
"score": 0,
"highlights": [
"string"
]
}
]Search and execute actions
POST /api/search-and-execute-note/{noteId} · searchAndExecute
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
noteId required | string 12-character note ID |
Responses
200: Execution results
No content.
Find related notes by attributes
POST /api/search-related · searchRelated
Authorization: sessionAuth or tokenAuth
Request body (required)
application/json:Attribute
| Property | Description |
|---|---|
attributeId required | string |
noteId required | string |
type required | string One of label, relation. |
name required | string |
value required | string |
position | integer |
isInheritable | boolean |
{
"attributeId": "string",
"noteId": "string",
"type": "label",
"name": "string",
"value": "string",
"position": 0,
"isInheritable": true
}Responses
200: Related notes
application/json:object
| Property | Description |
|---|---|
count required | integer Distinct notes matching, counted before the twenty-result cap. |
results required | array of object At most twenty, name-and-value matches ahead of name-only ones. |
results[].notePathArray required | array of string Note IDs from the root down to the matched note. |
results[].score required | number Search relevance, higher is better. |
{
"count": 0,
"results": [
{
"notePathArray": [
"string"
],
"score": 0
}
]
}Search template notes
GET /api/search-templates · searchTemplates
Authorization: sessionAuth or tokenAuth
Responses
200: Template notes
application/json: array ofNote
[
{
"noteId": "ur11rSfHkzeV",
"title": "string",
"type": "text",
"mime": "text/html",
"isProtected": true,
"blobId": "string",
"dateCreated": "2025-02-14 08:19:59.203+0100",
"dateModified": "2025-02-14 08:19:59.203+0100",
"utcDateCreated": "2025-02-13 07:42:47.698Z",
"utcDateModified": "2025-02-13 07:42:47.698Z"
}
]Get autocomplete suggestions
GET /api/autocomplete · autocomplete
Authorization: sessionAuth or tokenAuth
Query parameters
| Name | Description |
|---|---|
query required | string |
fastSearch | boolean |
activeNoteId | string |
Responses
200: Autocomplete suggestions
application/json:array of object
[
{
"noteId": "_help_gcI7RPbaNSh3",
"notePath": "root/_hidden/_help/_help_CdNpE2pqjmI6/_help_yIhgI5H7A2Sm/_help_4Gn3psZKsfSm/_help_gcI7RPbaNSh3",
"noteTitle": "Analog Watch",
"notePathTitle": "Hidden Notes › User Guide › Scripting › Frontend Basics › Launch Bar Widgets › Analog Watch",
"highlightedNotePathTitle": "Hidden Notes › User Guide › Scripting › Frontend Basics › Launch Bar Widgets › Analog <b>Wat</b>ch",
"highlightedNoteTitle": "Analog <b>Wat</b>ch",
"highlightedParentPathTitle": "Hidden Notes › User Guide › Scripting › Frontend Basics › Launch Bar Widgets",
"contentSnippet": "This is a more intricate example of a basic widget, which displays an analog watch in the launch bar.",
"highlightedContentSnippet": "This is a more intricate example of a basic widget, which displays an analog <b>wat</b>ch in the launch bar.",
"contentSnippetTruncated": true,
"attributeSnippet": "",
"matchedTerms": [
"wat"
],
"icon": "tn-icon bx bx-file"
}
]Find similar notes
GET /api/similar-notes/{noteId} · findSimilarNotes
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
noteId required | string 12-character note ID |
Responses
200: Similar notes
application/json:array of object
[
{
"noteId": "string",
"title": "string",
"similarity": 0
}
]Import/Export
Import and export operations
Export branch
GET /api/branches/{branchId}/export/{type}/{format}/{taskId} · exportBranch
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
branchId required | string |
type required | string One of subtree, single. |
format required | string One of html, markdown, opml. |
taskId required | string |
Responses
200: Exported content
application/octet-stream:string (binary)
Import notes
POST /api/notes/{parentNoteId}/notes-import · importNotes
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
parentNoteId required | string |
Request body (required)
multipart/form-data:object
| Property | Description |
|---|---|
upload | string (binary) |
safeImport | boolean |
shrinkImages | boolean |
textImportedAsText | boolean |
codeImportedAsCode | boolean |
explodeArchives | boolean |
replaceUnderscoresWithSpaces | boolean |
Responses
200: Import results
application/json:object
| Property | Description |
|---|---|
noteId | string |
note | Note |
{
"noteId": "string",
"note": {
"noteId": "ur11rSfHkzeV",
"title": "string",
"type": "text",
"mime": "text/html",
"isProtected": true,
"blobId": "string",
"dateCreated": "2025-02-14 08:19:59.203+0100",
"dateModified": "2025-02-14 08:19:59.203+0100",
"utcDateCreated": "2025-02-13 07:42:47.698Z",
"utcDateModified": "2025-02-13 07:42:47.698Z"
}
}Import attachments
POST /api/notes/{parentNoteId}/attachments-import · importAttachments
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
parentNoteId required | string |
Request body (required)
multipart/form-data:object
| Property | Description |
|---|---|
upload | array of string (binary) |
Responses
200: Import results
No content.
OCR
Text recognition
Process OCR for a specific note
POST /api/ocr/process-note/{noteId} · ocrProcessNote
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
noteId required | string 12-character note ID |
Request body
application/json:object
| Property | Description |
|---|---|
language | string Tesseract language code to use (e.g. 'eng', 'fra', 'deu', 'eng+fra'). If omitted, the language is resolved automatically from the note's language label, the enabled content languages, or the UI locale. |
forceReprocess | boolean Force reprocessing even if OCR already exists |
{
"language": "string",
"forceReprocess": false
}Responses
200: OCR processing completed successfully
No content.
400: Bad request - unsupported file type
No content.
404: Note not found
No content.
500: Internal server error
No content.
Process OCR for a specific attachment
POST /api/ocr/process-attachment/{attachmentId} · ocrProcessAttachment
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
attachmentId required | string ID of the attachment to process |
Request body
application/json:object
| Property | Description |
|---|---|
language | string Tesseract language code to use (e.g. 'eng', 'fra', 'deu', 'eng+fra'). If omitted, the language is resolved automatically from the owner note's language label, the enabled content languages, or the UI locale. |
forceReprocess | boolean Force reprocessing even if OCR already exists |
{
"language": "string",
"forceReprocess": false
}Responses
200: OCR processing completed successfully
No content.
400: Bad request - unsupported file type
No content.
404: Attachment not found
No content.
500: Internal server error
No content.
Process OCR for all images without existing OCR results
POST /api/ocr/batch-process · ocrBatchProcess
Authorization: sessionAuth or tokenAuth
Responses
200: Batch processing initiated successfully
No content.
400: Bad request - OCR disabled or already processing
No content.
500: Internal server error
No content.
Get batch OCR processing progress
GET /api/ocr/batch-progress · ocrBatchProgress
Authorization: sessionAuth or tokenAuth
Responses
200: Batch processing progress information
No content.
500: Internal server error
No content.
Sync
Synchronization between instances
Test sync connection
POST /api/sync/test · testSync
Authorization: sessionAuth or tokenAuth
Responses
200: Sync test results
No content.
Trigger sync now
POST /api/sync/now · syncNow
Authorization: sessionAuth or tokenAuth
Responses
200: Sync started
No content.
Get sync status
GET /api/sync/check · checkSync
Authorization: sessionAuth or tokenAuth
Responses
200: Sync status
application/json:object
| Property | Description |
|---|---|
synced | boolean |
lastSyncedPush | string (date-time) |
lastSyncedPull | string (date-time) |
{
"synced": true,
"lastSyncedPush": "2019-08-24T14:15:22Z",
"lastSyncedPull": "2019-08-24T14:15:22Z"
}Get sync changes
GET /api/sync/changed · getSyncChanges
Authorization: sessionAuth or tokenAuth
Query parameters
| Name | Description |
|---|---|
instanceId required | string |
lastEntityChangeId required | integer |
logMarkerId required | string |
maxBlobContentSize | integer If set, blob rows whose content exceeds this many bytes are returned with empty content; the entity_change metadata (including its hash) is unaffected. |
Responses
200: Sync changes
application/json:object
| Property | Description |
|---|---|
entityChanges | array of EntityChange |
lastEntityChangeId | integer If outstandingPullCount > 0, pass this as parameter in your next request to continue. |
outstandingPullCount | integer Number of changes not yet returned by the remote. |
{
"entityChanges": [
{
"entityChange": {
"entityName": "string",
"changeId": "string"
},
"entity": {}
}
],
"lastEntityChangeId": 0,
"outstandingPullCount": 0
}Push sync changes
PUT /api/sync/update · pushSyncChanges
Basic usage: set pageCount = 1, pageIndex = 0, and omit requestId. Supply your entity changes in the request body.
Authorization: sessionAuth or tokenAuth
Query parameters
| Name | Description |
|---|---|
logMarkerId required | string |
Header parameters
| Name | Description |
|---|---|
pageCount required | integer |
pageIndex required | integer |
requestId | string |
Request body (required)
application/json:object
| Property | Description |
|---|---|
instanceId | string |
entities | array of EntityChange |
{
"instanceId": "string",
"entities": [
{
"entityChange": {
"entityName": "string",
"changeId": "string"
},
"entity": {}
}
]
}Responses
200: Changes processed
No content.
Mark sync as finished
POST /api/sync/finished · finishSync
Authorization: sessionAuth or tokenAuth
Responses
204: Sync finished
No content.
Get sync statistics
GET /api/sync/stats · getSyncStats
Authorization: none
Responses
200: Sync statistics
application/json:object
| Property | Description |
|---|---|
initialized | boolean |
stats | object |
{
"initialized": true,
"stats": {}
}Fill entity changes
POST /api/sync/fill-entity-changes · fillEntityChanges
Authorization: sessionAuth or tokenAuth
Responses
204: Entity changes filled
No content.
Force full sync
POST /api/sync/force-full-sync · forceFullSync
Authorization: sessionAuth or tokenAuth
Responses
204: Full sync forced
No content.
Check entity changes consistency
POST /api/sync/check-entity-changes · checkEntityChanges
Authorization: sessionAuth or tokenAuth
Responses
200: Consistency check results
No content.
Queue sector for sync
POST /api/sync/queue-sector/{entityName}/{sector} · queueSyncSector
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
entityName required | string |
sector required | string |
Responses
204: Sector queued
No content.
Scripting
Script execution and automation
Execute script
POST /api/script/exec · executeScript
Authorization: sessionAuth or tokenAuth
Request body (required)
application/json:object
| Property | Description |
|---|---|
script required | string |
params | array of string |
startNoteId | string |
currentNoteId | string |
originEntityName | string |
originEntityId | string |
transactional | boolean |
{
"script": "string",
"params": [
"string"
],
"startNoteId": "string",
"currentNoteId": "string",
"originEntityName": "string",
"originEntityId": "string",
"transactional": true
}Responses
200: Script execution results
application/json:object
{}Run script note
POST /api/script/run/{noteId} · runScriptNote
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
noteId required | string 12-character note ID |
Responses
200: Script execution results
No content.
Get startup script bundles
GET /api/script/startup · getStartupScripts
Authorization: sessionAuth or tokenAuth
Query parameters
| Name | Description |
|---|---|
mobile | boolean |
Responses
200: Startup scripts
application/json: array ofScriptBundle
[
{
"noteId": "string",
"script": "string",
"html": "string",
"css": "string"
}
]Get widget script bundles
GET /api/script/widgets · getWidgetScripts
Authorization: sessionAuth or tokenAuth
Responses
200: Widget scripts
application/json: array ofScriptBundle
[
{
"noteId": "string",
"script": "string",
"html": "string",
"css": "string"
}
]Get script bundle for note
POST /api/script/bundle/{noteId} · getScriptBundle
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
noteId required | string 12-character note ID |
Responses
200: Script bundle
application/json:ScriptBundle
| Property | Description |
|---|---|
noteId | string |
script | string |
html | string |
css | string |
{
"noteId": "string",
"script": "string",
"html": "string",
"css": "string"
}Get relation script bundles
GET /api/script/relation/{noteId}/{relationName} · getRelationScripts
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
noteId required | string 12-character note ID |
relationName required | string |
Responses
200: Relation scripts
application/json: array ofScriptBundle
[
{
"noteId": "string",
"script": "string",
"html": "string",
"css": "string"
}
]Configuration
System options and settings
Get application information
GET /api/app-info · getAppInfo
Authorization: sessionAuth or tokenAuth
Responses
200: Application information
application/json:AppInfo
| Property | Description |
|---|---|
appVersion | string |
dbVersion | integer |
nodeVersion | string |
syncVersion | integer |
buildDate | string (date-time) |
buildRevision | string |
dataDirectory | string |
clipperProtocolVersion | string |
utcDateTime | string (date-time) |
{
"appVersion": "0.91.6",
"dbVersion": 228,
"nodeVersion": "string",
"syncVersion": 34,
"buildDate": "2019-08-24T14:15:22Z",
"buildRevision": "string",
"dataDirectory": "string",
"clipperProtocolVersion": "string",
"utcDateTime": "2019-08-24T14:15:22Z"
}Get setup status
GET /api/setup/status · getSetupStatus
Authorization: none
Responses
200: Setup status
application/json:object
| Property | Description |
|---|---|
isInitialized | boolean |
schemaExists | boolean |
syncVersion | integer |
{
"isInitialized": true,
"schemaExists": true,
"syncVersion": 0
}Initialize new document
POST /api/setup/new-document · initNewDocument
Authorization: none
Request body (required)
application/json:object
| Property | Description |
|---|---|
password required | string (password) |
theme | string |
{
"password": "string",
"theme": "string"
}Responses
201: Document initialized
No content.
Setup sync from server
POST /api/setup/sync-from-server · setupSyncFromServer
Authorization: none
Request body (required)
application/json:object
| Property | Description |
|---|---|
syncServerHost required | string (uri) |
syncProxy | string |
password required | string (password) |
{
"syncServerHost": "string",
"syncProxy": "string",
"password": "string"
}Responses
200: Sync setup successful
No content.
Get sync seed for setup
GET /api/setup/sync-seed · getSyncSeed
Authorization: none
Responses
200: Sync seed information
application/json:object
| Property | Description |
|---|---|
options required | array of object |
options[].name required | string Either "documentId" or "documentSecret". |
options[].value required | string |
syncVersion required | integer |
{
"options": [
{
"name": "string",
"value": "string"
}
],
"syncVersion": 0
}Get system options
GET /api/options · getOptions
Authorization: sessionAuth or tokenAuth
Responses
200: System options
application/json:object
{}Update multiple options
PUT /api/options · updateOptions
Authorization: sessionAuth or tokenAuth
Request body (required)
application/json:object
{}Responses
204: Options updated
No content.
Update single option
PUT /api/options/{name}/{value} · updateOption
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
name required | string |
value required | string |
Responses
204: Option updated
No content.
Get user-defined themes
GET /api/options/user-themes · getUserThemes
Authorization: sessionAuth or tokenAuth
Responses
200: User themes
application/json:array of object
[
{
"name": "string",
"label": "string"
}
]Get supported locales
GET /api/options/locales · getLocales
Authorization: sessionAuth or tokenAuth
Responses
200: Supported locales
application/json:array of object
[
{
"code": "string",
"name": "string"
}
]Database
Database operations
Get database schema
GET /api/sql/schema · getDatabaseSchema
Authorization: sessionAuth or tokenAuth
Responses
200: Database schema
text/plain:string
Execute SQL from note
POST /api/sql/execute/{noteId} · executeSql
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
noteId required | string 12-character note ID |
Responses
200: SQL execution results
application/json:array of object
[
{}
]Create database backup
POST /api/database/backup-database · backupDatabase
Authorization: sessionAuth or tokenAuth
Responses
204: Backup created
No content.
List existing backups
GET /api/database/backups · listBackups
Authorization: sessionAuth or tokenAuth
Responses
200: Backup list
application/json:object
| Property | Description |
|---|---|
backupFolderPath | string | null Directory where the backups are stored, or null if there is no user-accessible location. |
backups | array of object |
backups[].fileName | string |
backups[].filePath | string |
backups[].mtime | string (date-time) |
backups[].fileSize | integer Size of the backup file, in bytes. |
{
"backupFolderPath": "string",
"backups": [
{
"fileName": "string",
"filePath": "string",
"mtime": "2019-08-24T14:15:22Z",
"fileSize": 0
}
]
}Vacuum database
POST /api/database/vacuum-database · vacuumDatabase
Authorization: sessionAuth or tokenAuth
Responses
204: Database vacuumed
No content.
Anonymize database
POST /api/database/anonymize/{type} · anonymizeDatabase
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
type required | string One of save-as-file, save-and-send. |
Responses
200: Anonymization results
No content.
List anonymized databases
GET /api/database/anonymized-databases · listAnonymizedDatabases
Authorization: sessionAuth or tokenAuth
Responses
200: Anonymized database list
application/json:object
| Property | Description |
|---|---|
anonymizedFolderPath | string Directory where the anonymized databases are stored. |
databases | array of object |
databases[].fileName | string |
databases[].filePath | string |
databases[].mtime | string (date-time) |
databases[].fileSize | integer Size of the anonymized database file, in bytes. |
{
"anonymizedFolderPath": "string",
"databases": [
{
"fileName": "string",
"filePath": "string",
"mtime": "2019-08-24T14:15:22Z",
"fileSize": 0
}
]
}Download an anonymized database file
GET /api/database/anonymized/download · downloadAnonymizedDatabase
Only files inside the anonymized database directory can be downloaded; any other path is refused with 403.
Authorization: sessionAuth or tokenAuth
Query parameters
| Name | Description |
|---|---|
filePath required | string |
Responses
200: Anonymized database file
application/x-sqlite3:string (binary)
400: Missing filePath
No content.
403: Path not allowed
No content.
404: File not found
No content.
Fix consistency issues
POST /api/database/find-and-fix-consistency-issues · fixConsistencyIssues
Authorization: sessionAuth or tokenAuth
Responses
200: Consistency check results
No content.
Check database integrity
GET /api/database/check-integrity · checkIntegrity
Authorization: sessionAuth or tokenAuth
Responses
200: Integrity check results
application/json:object
| Property | Description |
|---|---|
results | array of string |
{
"results": [
"string"
]
}Security
Security features (2FA, tokens)
Change password
POST /api/password/change · changePassword
Authorization: sessionAuth or tokenAuth
Request body (required)
application/json:object
| Property | Description |
|---|---|
current_password | string (password) |
new_password required | string (password) |
{
"current_password": "string",
"new_password": "string"
}Responses
204: Password changed
No content.
Reset password (destructive)
POST /api/password/reset · resetPassword
Authorization: sessionAuth or tokenAuth
Query parameters
| Name | Description |
|---|---|
really required | string |
Responses
204: Password reset
No content.
Generate a TOTP secret
GET /api/totp/generate · generateTotpSecret
Generates a fresh TOTP secret without persisting it. The caller must verify a code for this secret (see /api/totp/verify) and commit it (see /api/totp/enable) before it becomes active.
Authorization: sessionAuth or tokenAuth
Responses
200: TOTP secret generated
application/json:object
| Property | Description |
|---|---|
success | boolean |
message | string The bare TOTP secret (for manual entry), or an error message on failure. |
url | string The otpauth:// URL the authenticator expects, rendered as a QR code by the client. |
{
"success": true,
"message": "string",
"url": "string"
}Verify a generated TOTP secret
POST /api/totp/verify · verifyTotpSecret
Verifies a freshly generated secret against a code the user produced for it, without persisting anything. On success, issues (unpersisted) recovery codes to be shown as the next enrollment step.
Authorization: sessionAuth or tokenAuth
Request body (required)
application/json:object
| Property | Description |
|---|---|
secret required | string |
token required | string A TOTP code the user generated for the supplied secret. |
{
"secret": "string",
"token": "string"
}Responses
200: Verification result
application/json:object
| Property | Description |
|---|---|
success | boolean |
recoveryCodes | array of string One-time recovery codes, present only when verification succeeds. |
{
"success": true,
"recoveryCodes": [
"string"
]
}Enable TOTP with a verified secret
POST /api/totp/enable · enableTotp
Commits a verified secret together with its recovery codes, activating TOTP. This is the final enrollment step and the only point at which the secret and recovery codes are persisted.
Authorization: sessionAuth or tokenAuth
Request body (required)
application/json:object
| Property | Description |
|---|---|
secret required | string |
recoveryCodes required | array of string |
{
"secret": "string",
"recoveryCodes": [
"string"
]
}Responses
200: Result of enabling TOTP
application/json:object
| Property | Description |
|---|---|
success | boolean |
{
"success": true
}Get TOTP status
GET /api/totp/status · getTotpStatus
Authorization: sessionAuth or tokenAuth
Responses
200: TOTP status
application/json:object
| Property | Description |
|---|---|
success | boolean |
message | boolean Whether TOTP is the active second factor and a secret is set. |
set | boolean Whether a TOTP secret is currently stored. |
{
"success": true,
"message": true,
"set": true
}Get the stored TOTP secret
GET /api/totp/get · getTotpSecret
Returns null when no secret is set.
Authorization: sessionAuth or tokenAuth
Responses
200: TOTP secret
application/json:string | null
"string"Reset (disable) TOTP
POST /api/totp/reset · resetTotp
Clears the stored TOTP secret and its recovery codes, disabling TOTP.
Authorization: sessionAuth or tokenAuth
Responses
200: Result of resetting TOTP
application/json:object
| Property | Description |
|---|---|
success | boolean |
{
"success": true
}Check if TOTP recovery codes are set
GET /api/totp_recovery/enabled · isTotpRecoveryEnabled
Authorization: sessionAuth or tokenAuth
Responses
200: TOTP recovery status
application/json:object
| Property | Description |
|---|---|
success | boolean |
keysExist | boolean |
{
"success": true,
"keysExist": true
}Regenerate TOTP recovery codes
POST /api/totp_recovery/regenerate · regenerateTotpRecoveryCodes
Issues a fresh batch of recovery codes for the already-enrolled TOTP secret, replacing any existing ones, and returns them for one-time display. Refuses when no TOTP secret is set.
Authorization: sessionAuth or tokenAuth
Responses
200: Generated recovery codes
application/json:object
| Property | Description |
|---|---|
success | boolean |
recoveryCodes | array of string New recovery codes, present only when regeneration succeeds. |
{
"success": true,
"recoveryCodes": [
"string"
]
}Get used TOTP recovery codes
GET /api/totp_recovery/used · getUsedTotpRecoveryCodes
Returns an empty array if no recovery codes are set, otherwise an object listing each code's status.
Authorization: sessionAuth or tokenAuth
Responses
200: Recovery code status
application/json:array of any | object
[
null
]Verify a TOTP recovery code
POST /api/totp_recovery/verify · verifyTotpRecoveryCode
Authorization: sessionAuth or tokenAuth
Request body (required)
application/json:object
| Property | Description |
|---|---|
recovery_code_guess required | string |
{
"recovery_code_guess": "string"
}Responses
200: Verification result
application/json:object
| Property | Description |
|---|---|
success | boolean |
{
"success": true
}List ETAPI tokens
GET /api/etapi-tokens · listEtapiTokens
Authorization: sessionAuth or tokenAuth
Responses
200: ETAPI tokens
application/json: array ofEtapiToken
[
{
"etapiTokenId": "string",
"name": "string",
"token": "string",
"dateCreated": "2025-02-14 08:19:59.203+0100",
"isDeleted": true
}
]Create ETAPI token
POST /api/etapi-tokens · createEtapiToken
Authorization: sessionAuth or tokenAuth
Request body (required)
application/json:object
| Property | Description |
|---|---|
name required | string |
{
"name": "string"
}Responses
201: Token created
application/json:EtapiToken
| Property | Description |
|---|---|
etapiTokenId | string |
name | string |
token | string |
dateCreated | DateTime |
isDeleted | boolean |
{
"etapiTokenId": "string",
"name": "string",
"token": "string",
"dateCreated": "2025-02-14 08:19:59.203+0100",
"isDeleted": true
}Delete ETAPI token
DELETE /api/etapi-tokens/{etapiTokenId} · deleteEtapiToken
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
etapiTokenId required | string |
Responses
204: Token deleted
No content.
Update ETAPI token
PATCH /api/etapi-tokens/{etapiTokenId} · updateEtapiToken
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
etapiTokenId required | string |
Request body (required)
application/json:object
| Property | Description |
|---|---|
name | string |
{
"name": "string"
}Responses
200: Token updated
application/json:EtapiToken
| Property | Description |
|---|---|
etapiTokenId | string |
name | string |
token | string |
dateCreated | DateTime |
isDeleted | boolean |
{
"etapiTokenId": "string",
"name": "string",
"token": "string",
"dateCreated": "2025-02-14 08:19:59.203+0100",
"isDeleted": true
}Special Notes
Special note types (calendar, inbox)
Get/create inbox note
GET /api/special-notes/inbox/{date} · getInboxNote
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
date required | string (date) |
Responses
200: Inbox note
application/json:Note
| Property | Description |
|---|---|
noteId required | string 12-character note ID |
title required | string Note title |
type required | NoteType One of text, code, render, file, image, search, relationMap, book, noteMap, mermaid, canvas, webView, launcher, doc, contentWidget, mindMap, geoMap. |
mime required | string MIME type |
isProtected required | boolean Whether note is protected |
blobId | string ID of content blob |
dateCreated | DateTime |
dateModified | DateTime |
utcDateCreated | UtcDateTime Result of new Date().toISOString().replace('T', ' ') |
utcDateModified | UtcDateTime Result of new Date().toISOString().replace('T', ' ') |
{
"noteId": "ur11rSfHkzeV",
"title": "string",
"type": "text",
"mime": "text/html",
"isProtected": true,
"blobId": "string",
"dateCreated": "2025-02-14 08:19:59.203+0100",
"dateModified": "2025-02-14 08:19:59.203+0100",
"utcDateCreated": "2025-02-13 07:42:47.698Z",
"utcDateModified": "2025-02-13 07:42:47.698Z"
}Resolve where an inbox capture would go
GET /api/special-notes/inbox-target · getInboxTarget
Reports the destination /api/special-notes/inbox/{date} would use, without creating anything. Honours the hoisted note, read from the trilium-hoisted-note-id header.
Authorization: sessionAuth or tokenAuth
Responses
200: The resolved destination
application/json:object
| Property | Description |
|---|---|
kind required | string Which rule decided the destination. dayNote names no note, because the day note is created when the capture happens. One of inbox, workspaceInbox, workspaceRoot, dayNote, root. |
noteId | string Absent for dayNote. |
title | string Absent for dayNote. |
{
"kind": "inbox",
"noteId": "string",
"title": "string"
}Get/create day note
GET /api/special-notes/days/{date} · getDayNote
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
date required | string (date) |
Responses
200: Day note
application/json:Note
| Property | Description |
|---|---|
noteId required | string 12-character note ID |
title required | string Note title |
type required | NoteType One of text, code, render, file, image, search, relationMap, book, noteMap, mermaid, canvas, webView, launcher, doc, contentWidget, mindMap, geoMap. |
mime required | string MIME type |
isProtected required | boolean Whether note is protected |
blobId | string ID of content blob |
dateCreated | DateTime |
dateModified | DateTime |
utcDateCreated | UtcDateTime Result of new Date().toISOString().replace('T', ' ') |
utcDateModified | UtcDateTime Result of new Date().toISOString().replace('T', ' ') |
{
"noteId": "ur11rSfHkzeV",
"title": "string",
"type": "text",
"mime": "text/html",
"isProtected": true,
"blobId": "string",
"dateCreated": "2025-02-14 08:19:59.203+0100",
"dateModified": "2025-02-14 08:19:59.203+0100",
"utcDateCreated": "2025-02-13 07:42:47.698Z",
"utcDateModified": "2025-02-13 07:42:47.698Z"
}Get/create week note
GET /api/special-notes/weeks/{week} · getWeekNote
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
week required | string Matches ^\d{4}-\d{2}$. |
Responses
200: Week note
application/json:Note
| Property | Description |
|---|---|
noteId required | string 12-character note ID |
title required | string Note title |
type required | NoteType One of text, code, render, file, image, search, relationMap, book, noteMap, mermaid, canvas, webView, launcher, doc, contentWidget, mindMap, geoMap. |
mime required | string MIME type |
isProtected required | boolean Whether note is protected |
blobId | string ID of content blob |
dateCreated | DateTime |
dateModified | DateTime |
utcDateCreated | UtcDateTime Result of new Date().toISOString().replace('T', ' ') |
utcDateModified | UtcDateTime Result of new Date().toISOString().replace('T', ' ') |
{
"noteId": "ur11rSfHkzeV",
"title": "string",
"type": "text",
"mime": "text/html",
"isProtected": true,
"blobId": "string",
"dateCreated": "2025-02-14 08:19:59.203+0100",
"dateModified": "2025-02-14 08:19:59.203+0100",
"utcDateCreated": "2025-02-13 07:42:47.698Z",
"utcDateModified": "2025-02-13 07:42:47.698Z"
}Get/create month note
GET /api/special-notes/months/{month} · getMonthNote
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
month required | string Matches ^\d{4}-\d{2}$. |
Responses
200: Month note
application/json:Note
| Property | Description |
|---|---|
noteId required | string 12-character note ID |
title required | string Note title |
type required | NoteType One of text, code, render, file, image, search, relationMap, book, noteMap, mermaid, canvas, webView, launcher, doc, contentWidget, mindMap, geoMap. |
mime required | string MIME type |
isProtected required | boolean Whether note is protected |
blobId | string ID of content blob |
dateCreated | DateTime |
dateModified | DateTime |
utcDateCreated | UtcDateTime Result of new Date().toISOString().replace('T', ' ') |
utcDateModified | UtcDateTime Result of new Date().toISOString().replace('T', ' ') |
{
"noteId": "ur11rSfHkzeV",
"title": "string",
"type": "text",
"mime": "text/html",
"isProtected": true,
"blobId": "string",
"dateCreated": "2025-02-14 08:19:59.203+0100",
"dateModified": "2025-02-14 08:19:59.203+0100",
"utcDateCreated": "2025-02-13 07:42:47.698Z",
"utcDateModified": "2025-02-13 07:42:47.698Z"
}Get/create year note
GET /api/special-notes/years/{year} · getYearNote
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
year required | string Matches ^\d{4}$. |
Responses
200: Year note
application/json:Note
| Property | Description |
|---|---|
noteId required | string 12-character note ID |
title required | string Note title |
type required | NoteType One of text, code, render, file, image, search, relationMap, book, noteMap, mermaid, canvas, webView, launcher, doc, contentWidget, mindMap, geoMap. |
mime required | string MIME type |
isProtected required | boolean Whether note is protected |
blobId | string ID of content blob |
dateCreated | DateTime |
dateModified | DateTime |
utcDateCreated | UtcDateTime Result of new Date().toISOString().replace('T', ' ') |
utcDateModified | UtcDateTime Result of new Date().toISOString().replace('T', ' ') |
{
"noteId": "ur11rSfHkzeV",
"title": "string",
"type": "text",
"mime": "text/html",
"isProtected": true,
"blobId": "string",
"dateCreated": "2025-02-14 08:19:59.203+0100",
"dateModified": "2025-02-14 08:19:59.203+0100",
"utcDateCreated": "2025-02-13 07:42:47.698Z",
"utcDateModified": "2025-02-13 07:42:47.698Z"
}Create SQL console note
POST /api/special-notes/sql-console · createSqlConsole
Authorization: sessionAuth or tokenAuth
Responses
201: SQL console created
application/json:Note
| Property | Description |
|---|---|
noteId required | string 12-character note ID |
title required | string Note title |
type required | NoteType One of text, code, render, file, image, search, relationMap, book, noteMap, mermaid, canvas, webView, launcher, doc, contentWidget, mindMap, geoMap. |
mime required | string MIME type |
isProtected required | boolean Whether note is protected |
blobId | string ID of content blob |
dateCreated | DateTime |
dateModified | DateTime |
utcDateCreated | UtcDateTime Result of new Date().toISOString().replace('T', ' ') |
utcDateModified | UtcDateTime Result of new Date().toISOString().replace('T', ' ') |
{
"noteId": "ur11rSfHkzeV",
"title": "string",
"type": "text",
"mime": "text/html",
"isProtected": true,
"blobId": "string",
"dateCreated": "2025-02-14 08:19:59.203+0100",
"dateModified": "2025-02-14 08:19:59.203+0100",
"utcDateCreated": "2025-02-13 07:42:47.698Z",
"utcDateModified": "2025-02-13 07:42:47.698Z"
}Create search note
POST /api/special-notes/search-note · createSearchNote
Authorization: sessionAuth or tokenAuth
Responses
201: Search note created
application/json:Note
| Property | Description |
|---|---|
noteId required | string 12-character note ID |
title required | string Note title |
type required | NoteType One of text, code, render, file, image, search, relationMap, book, noteMap, mermaid, canvas, webView, launcher, doc, contentWidget, mindMap, geoMap. |
mime required | string MIME type |
isProtected required | boolean Whether note is protected |
blobId | string ID of content blob |
dateCreated | DateTime |
dateModified | DateTime |
utcDateCreated | UtcDateTime Result of new Date().toISOString().replace('T', ' ') |
utcDateModified | UtcDateTime Result of new Date().toISOString().replace('T', ' ') |
{
"noteId": "ur11rSfHkzeV",
"title": "string",
"type": "text",
"mime": "text/html",
"isProtected": true,
"blobId": "string",
"dateCreated": "2025-02-14 08:19:59.203+0100",
"dateModified": "2025-02-14 08:19:59.203+0100",
"utcDateCreated": "2025-02-13 07:42:47.698Z",
"utcDateModified": "2025-02-13 07:42:47.698Z"
}Create launcher
POST /api/special-notes/launchers/{parentNoteId}/{launcherType} · createLauncher
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
parentNoteId required | string |
launcherType required | string |
Responses
201: Launcher created
application/json:Note
| Property | Description |
|---|---|
noteId required | string 12-character note ID |
title required | string Note title |
type required | NoteType One of text, code, render, file, image, search, relationMap, book, noteMap, mermaid, canvas, webView, launcher, doc, contentWidget, mindMap, geoMap. |
mime required | string MIME type |
isProtected required | boolean Whether note is protected |
blobId | string ID of content blob |
dateCreated | DateTime |
dateModified | DateTime |
utcDateCreated | UtcDateTime Result of new Date().toISOString().replace('T', ' ') |
utcDateModified | UtcDateTime Result of new Date().toISOString().replace('T', ' ') |
{
"noteId": "ur11rSfHkzeV",
"title": "string",
"type": "text",
"mime": "text/html",
"isProtected": true,
"blobId": "string",
"dateCreated": "2025-02-14 08:19:59.203+0100",
"dateModified": "2025-02-14 08:19:59.203+0100",
"utcDateCreated": "2025-02-13 07:42:47.698Z",
"utcDateModified": "2025-02-13 07:42:47.698Z"
}Get notes for specific month
GET /api/special-notes/notes-for-month/{month} · getNotesForMonth
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
month required | string |
Responses
200: Notes for the month
application/json: array ofNote
[
{
"noteId": "ur11rSfHkzeV",
"title": "string",
"type": "text",
"mime": "text/html",
"isProtected": true,
"blobId": "string",
"dateCreated": "2025-02-14 08:19:59.203+0100",
"dateModified": "2025-02-14 08:19:59.203+0100",
"utcDateCreated": "2025-02-13 07:42:47.698Z",
"utcDateModified": "2025-02-13 07:42:47.698Z"
}
]Get quarter note
GET /api/special-notes/quarters/{quarter} · getQuarter
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
quarter required | string |
Responses
200: Quarter note
application/json:Note
| Property | Description |
|---|---|
noteId required | string 12-character note ID |
title required | string Note title |
type required | NoteType One of text, code, render, file, image, search, relationMap, book, noteMap, mermaid, canvas, webView, launcher, doc, contentWidget, mindMap, geoMap. |
mime required | string MIME type |
isProtected required | boolean Whether note is protected |
blobId | string ID of content blob |
dateCreated | DateTime |
dateModified | DateTime |
utcDateCreated | UtcDateTime Result of new Date().toISOString().replace('T', ' ') |
utcDateModified | UtcDateTime Result of new Date().toISOString().replace('T', ' ') |
{
"noteId": "ur11rSfHkzeV",
"title": "string",
"type": "text",
"mime": "text/html",
"isProtected": true,
"blobId": "string",
"dateCreated": "2025-02-14 08:19:59.203+0100",
"dateModified": "2025-02-14 08:19:59.203+0100",
"utcDateCreated": "2025-02-13 07:42:47.698Z",
"utcDateModified": "2025-02-13 07:42:47.698Z"
}Get first day of week for date
GET /api/special-notes/week-first-day/{date} · getWeekFirstDay
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
date required | string (date) |
Responses
200: First day of week
application/json:object
| Property | Description |
|---|---|
date | string (date) |
{
"date": "2019-08-24"
}Reset launcher note
POST /api/special-notes/launchers/{noteId}/reset · resetLauncher
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
noteId required | string 12-character note ID |
Responses
200: Launcher reset
application/json:Note
| Property | Description |
|---|---|
noteId required | string 12-character note ID |
title required | string Note title |
type required | NoteType One of text, code, render, file, image, search, relationMap, book, noteMap, mermaid, canvas, webView, launcher, doc, contentWidget, mindMap, geoMap. |
mime required | string MIME type |
isProtected required | boolean Whether note is protected |
blobId | string ID of content blob |
dateCreated | DateTime |
dateModified | DateTime |
utcDateCreated | UtcDateTime Result of new Date().toISOString().replace('T', ' ') |
utcDateModified | UtcDateTime Result of new Date().toISOString().replace('T', ' ') |
{
"noteId": "ur11rSfHkzeV",
"title": "string",
"type": "text",
"mime": "text/html",
"isProtected": true,
"blobId": "string",
"dateCreated": "2025-02-14 08:19:59.203+0100",
"dateModified": "2025-02-14 08:19:59.203+0100",
"utcDateCreated": "2025-02-13 07:42:47.698Z",
"utcDateModified": "2025-02-13 07:42:47.698Z"
}Save search note
POST /api/special-notes/save-search-note · saveSearchNote
Authorization: sessionAuth or tokenAuth
Request body (required)
application/json:object
| Property | Description |
|---|---|
query | string |
title | string |
{
"query": "string",
"title": "string"
}Responses
201: Search note saved
application/json:Note
| Property | Description |
|---|---|
noteId required | string 12-character note ID |
title required | string Note title |
type required | NoteType One of text, code, render, file, image, search, relationMap, book, noteMap, mermaid, canvas, webView, launcher, doc, contentWidget, mindMap, geoMap. |
mime required | string MIME type |
isProtected required | boolean Whether note is protected |
blobId | string ID of content blob |
dateCreated | DateTime |
dateModified | DateTime |
utcDateCreated | UtcDateTime Result of new Date().toISOString().replace('T', ' ') |
utcDateModified | UtcDateTime Result of new Date().toISOString().replace('T', ' ') |
{
"noteId": "ur11rSfHkzeV",
"title": "string",
"type": "text",
"mime": "text/html",
"isProtected": true,
"blobId": "string",
"dateCreated": "2025-02-14 08:19:59.203+0100",
"dateModified": "2025-02-14 08:19:59.203+0100",
"utcDateCreated": "2025-02-13 07:42:47.698Z",
"utcDateModified": "2025-02-13 07:42:47.698Z"
}Save SQL console note
POST /api/special-notes/save-sql-console · saveSqlConsole
Authorization: sessionAuth or tokenAuth
Request body (required)
application/json:object
| Property | Description |
|---|---|
sql | string |
title | string |
{
"sql": "string",
"title": "string"
}Responses
201: SQL console saved
application/json:Note
| Property | Description |
|---|---|
noteId required | string 12-character note ID |
title required | string Note title |
type required | NoteType One of text, code, render, file, image, search, relationMap, book, noteMap, mermaid, canvas, webView, launcher, doc, contentWidget, mindMap, geoMap. |
mime required | string MIME type |
isProtected required | boolean Whether note is protected |
blobId | string ID of content blob |
dateCreated | DateTime |
dateModified | DateTime |
utcDateCreated | UtcDateTime Result of new Date().toISOString().replace('T', ' ') |
utcDateModified | UtcDateTime Result of new Date().toISOString().replace('T', ' ') |
{
"noteId": "ur11rSfHkzeV",
"title": "string",
"type": "text",
"mime": "text/html",
"isProtected": true,
"blobId": "string",
"dateCreated": "2025-02-14 08:19:59.203+0100",
"dateModified": "2025-02-14 08:19:59.203+0100",
"utcDateCreated": "2025-02-13 07:42:47.698Z",
"utcDateModified": "2025-02-13 07:42:47.698Z"
}Update API script launcher
PUT /api/special-notes/api-script-launcher · updateApiScriptLauncher
Authorization: sessionAuth or tokenAuth
Request body (required)
application/json:object
| Property | Description |
|---|---|
code | string Script code |
{
"code": "string"
}Responses
200: API script launcher updated
application/json:Note
| Property | Description |
|---|---|
noteId required | string 12-character note ID |
title required | string Note title |
type required | NoteType One of text, code, render, file, image, search, relationMap, book, noteMap, mermaid, canvas, webView, launcher, doc, contentWidget, mindMap, geoMap. |
mime required | string MIME type |
isProtected required | boolean Whether note is protected |
blobId | string ID of content blob |
dateCreated | DateTime |
dateModified | DateTime |
utcDateCreated | UtcDateTime Result of new Date().toISOString().replace('T', ' ') |
utcDateModified | UtcDateTime Result of new Date().toISOString().replace('T', ' ') |
{
"noteId": "ur11rSfHkzeV",
"title": "string",
"type": "text",
"mime": "text/html",
"isProtected": true,
"blobId": "string",
"dateCreated": "2025-02-14 08:19:59.203+0100",
"dateModified": "2025-02-14 08:19:59.203+0100",
"utcDateCreated": "2025-02-13 07:42:47.698Z",
"utcDateModified": "2025-02-13 07:42:47.698Z"
}Visualization
Maps and visualizations
Get tree map
POST /api/note-map/{noteId}/tree · getTreeMap
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
noteId required | string 12-character note ID |
Responses
200: Tree map data
application/json:object
{}Get link map
POST /api/note-map/{noteId}/link · getLinkMap
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
noteId required | string 12-character note ID |
Responses
200: Link map data
application/json:object
{}Get backlinks
GET /api/note-map/{noteId}/backlinks · getBacklinks
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
noteId required | string 12-character note ID |
Responses
200: Backlinks
application/json:array of object
[
{
"noteId": "string",
"title": "string"
}
]Get backlink count for note
GET /api/note-map/{noteId}/backlink-count · getBacklinkCount
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
noteId required | string 12-character note ID |
Responses
200: Backlink count
application/json:object
| Property | Description |
|---|---|
count | integer Number of backlinks to this note |
{
"count": 0
}Get relation map data
POST /api/relation-map · getRelationMap
Authorization: sessionAuth or tokenAuth
Request body (required)
application/json:object
| Property | Description |
|---|---|
noteId | string |
maxDepth | integer |
excludeArchived | boolean |
{
"noteId": "string",
"maxDepth": 0,
"excludeArchived": true
}Responses
200: Relation map data
application/json:object
{}External
External integrations (clipper, sender)
Clipper handshake
GET /api/clipper/handshake · clipperHandshake
Authorization: sessionAuth or tokenAuth
Responses
200: Handshake successful
application/json:object
| Property | Description |
|---|---|
protocolVersion | string |
{
"protocolVersion": "string"
}Add web clipping
POST /api/clipper/clippings · addClipping
Authorization: sessionAuth or tokenAuth
Request body (required)
application/json:object
| Property | Description |
|---|---|
title | string |
content | string |
url | string |
{
"title": "string",
"content": "string",
"url": "string"
}Responses
201: Clipping created
application/json:Note
| Property | Description |
|---|---|
noteId required | string 12-character note ID |
title required | string Note title |
type required | NoteType One of text, code, render, file, image, search, relationMap, book, noteMap, mermaid, canvas, webView, launcher, doc, contentWidget, mindMap, geoMap. |
mime required | string MIME type |
isProtected required | boolean Whether note is protected |
blobId | string ID of content blob |
dateCreated | DateTime |
dateModified | DateTime |
utcDateCreated | UtcDateTime Result of new Date().toISOString().replace('T', ' ') |
utcDateModified | UtcDateTime Result of new Date().toISOString().replace('T', ' ') |
{
"noteId": "ur11rSfHkzeV",
"title": "string",
"type": "text",
"mime": "text/html",
"isProtected": true,
"blobId": "string",
"dateCreated": "2025-02-14 08:19:59.203+0100",
"dateModified": "2025-02-14 08:19:59.203+0100",
"utcDateCreated": "2025-02-13 07:42:47.698Z",
"utcDateModified": "2025-02-13 07:42:47.698Z"
}Create clipper note
POST /api/clipper/notes · createClipperNote
Authorization: sessionAuth or tokenAuth
Request body (required)
application/json:object
| Property | Description |
|---|---|
title | string |
content | string |
parentNoteId | string |
{
"title": "string",
"content": "string",
"parentNoteId": "string"
}Responses
201: Note created
application/json:Note
| Property | Description |
|---|---|
noteId required | string 12-character note ID |
title required | string Note title |
type required | NoteType One of text, code, render, file, image, search, relationMap, book, noteMap, mermaid, canvas, webView, launcher, doc, contentWidget, mindMap, geoMap. |
mime required | string MIME type |
isProtected required | boolean Whether note is protected |
blobId | string ID of content blob |
dateCreated | DateTime |
dateModified | DateTime |
utcDateCreated | UtcDateTime Result of new Date().toISOString().replace('T', ' ') |
utcDateModified | UtcDateTime Result of new Date().toISOString().replace('T', ' ') |
{
"noteId": "ur11rSfHkzeV",
"title": "string",
"type": "text",
"mime": "text/html",
"isProtected": true,
"blobId": "string",
"dateCreated": "2025-02-14 08:19:59.203+0100",
"dateModified": "2025-02-14 08:19:59.203+0100",
"utcDateCreated": "2025-02-13 07:42:47.698Z",
"utcDateModified": "2025-02-13 07:42:47.698Z"
}Open note in clipper
POST /api/clipper/open/{noteId} · openNoteInClipper
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
noteId required | string 12-character note ID |
Responses
200: Note opened in clipper
application/json:object
| Property | Description |
|---|---|
success | boolean |
url | string URL to open in clipper |
{
"success": true,
"url": "string"
}Sender login
POST /api/sender/login · senderLogin
Authorization: none
Request body (required)
application/json:object
| Property | Description |
|---|---|
username required | string |
password required | string |
{
"username": "string",
"password": "string"
}Responses
200: Login successful
application/json:object
| Property | Description |
|---|---|
token | string |
{
"token": "string"
}Upload image from sender
POST /api/sender/image · uploadSenderImage
Authorization: sessionAuth or tokenAuth
Request body (required)
multipart/form-data:object
| Property | Description |
|---|---|
upload | string (binary) |
Responses
201: Image uploaded
application/json:Note
| Property | Description |
|---|---|
noteId required | string 12-character note ID |
title required | string Note title |
type required | NoteType One of text, code, render, file, image, search, relationMap, book, noteMap, mermaid, canvas, webView, launcher, doc, contentWidget, mindMap, geoMap. |
mime required | string MIME type |
isProtected required | boolean Whether note is protected |
blobId | string ID of content blob |
dateCreated | DateTime |
dateModified | DateTime |
utcDateCreated | UtcDateTime Result of new Date().toISOString().replace('T', ' ') |
utcDateModified | UtcDateTime Result of new Date().toISOString().replace('T', ' ') |
{
"noteId": "ur11rSfHkzeV",
"title": "string",
"type": "text",
"mime": "text/html",
"isProtected": true,
"blobId": "string",
"dateCreated": "2025-02-14 08:19:59.203+0100",
"dateModified": "2025-02-14 08:19:59.203+0100",
"utcDateCreated": "2025-02-13 07:42:47.698Z",
"utcDateModified": "2025-02-13 07:42:47.698Z"
}Save note from sender
POST /api/sender/note · saveSenderNote
Authorization: sessionAuth or tokenAuth
Request body (required)
application/json:object
| Property | Description |
|---|---|
title | string |
content | string |
{
"title": "string",
"content": "string"
}Responses
201: Note saved
application/json:Note
| Property | Description |
|---|---|
noteId required | string 12-character note ID |
title required | string Note title |
type required | NoteType One of text, code, render, file, image, search, relationMap, book, noteMap, mermaid, canvas, webView, launcher, doc, contentWidget, mindMap, geoMap. |
mime required | string MIME type |
isProtected required | boolean Whether note is protected |
blobId | string ID of content blob |
dateCreated | DateTime |
dateModified | DateTime |
utcDateCreated | UtcDateTime Result of new Date().toISOString().replace('T', ' ') |
utcDateModified | UtcDateTime Result of new Date().toISOString().replace('T', ' ') |
{
"noteId": "ur11rSfHkzeV",
"title": "string",
"type": "text",
"mime": "text/html",
"isProtected": true,
"blobId": "string",
"dateCreated": "2025-02-14 08:19:59.203+0100",
"dateModified": "2025-02-14 08:19:59.203+0100",
"utcDateCreated": "2025-02-13 07:42:47.698Z",
"utcDateModified": "2025-02-13 07:42:47.698Z"
}Utilities
Miscellaneous utilities
Get system metrics
GET /api/metrics · getMetrics
Authorization: sessionAuth or tokenAuth
Query parameters
| Name | Description |
|---|---|
format | string Response format - 'prometheus' (default) for Prometheus text format, 'json' for JSON. One of prometheus, json. |
Responses
200: Instance metrics
text/plain: string
application/json: object
| Property | Description |
|---|---|
version | object |
version.app | string |
version.db | integer |
version.node | string |
version.sync | integer |
version.buildDate | string |
version.buildRevision | string |
database | object |
database.totalNotes | integer |
database.deletedNotes | integer |
database.activeNotes | integer |
database.protectedNotes | integer |
database.totalAttachments | integer |
database.deletedAttachments | integer |
database.activeAttachments | integer |
database.totalRevisions | integer |
database.totalBranches | integer |
database.totalAttributes | integer |
database.totalBlobs | integer |
database.totalEtapiTokens | integer |
database.totalRecentNotes | integer |
noteTypes | object |
attachmentTypes | object |
statistics | object |
statistics.oldestNote | string | null |
statistics.newestNote | string | null |
statistics.lastModified | string | null |
statistics.databaseSizeBytes | integer | null |
timestamp | string |
{
"version": {
"app": "0.91.6",
"db": 231,
"node": "v18.17.0",
"sync": 35,
"buildDate": "2024-09-07T18:36:34Z",
"buildRevision": "7c0d6930fa8f20d269dcfbcbc8f636a25f6bb9a7"
},
"database": {
"totalNotes": 1234,
"deletedNotes": 56,
"activeNotes": 1178,
"protectedNotes": 23,
"totalAttachments": 89,
"deletedAttachments": 5,
"activeAttachments": 84,
"totalRevisions": 567,
"totalBranches": 1200,
"totalAttributes": 345,
"totalBlobs": 678,
"totalEtapiTokens": 3,
"totalRecentNotes": 50
},
"noteTypes": {
"text": 800,
"code": 200,
"image": 100,
"file": 50
},
"attachmentTypes": {
"image/png": 45,
"image/jpeg": 30,
"application/pdf": 14
},
"statistics": {
"oldestNote": "2020-01-01T00:00:00.000Z",
"newestNote": "2024-12-01T12:00:00.000Z",
"lastModified": "2024-12-01T11:30:00.000Z",
"databaseSizeBytes": 52428800
},
"timestamp": "2024-12-01T12:00:00.000Z"
}400: Invalid format parameter
No content.
500: Error collecting metrics
No content.
Run system diagnostics
GET /api/system-checks · runSystemChecks
Authorization: sessionAuth or tokenAuth
Responses
200: System check results
application/json:array of object
[
{
"name": "string",
"status": "pass",
"message": "string"
}
]Health check endpoint
GET /api/health-check · healthCheck
Authorization: none
Responses
200: Service is healthy
text/plain:string
Get backend log
GET /api/backend-log · getBackendLog
Authorization: sessionAuth or tokenAuth
Responses
200: Backend log entries
application/json:array of object
[
{
"timestamp": "2019-08-24T14:15:22Z",
"level": "string",
"message": "string"
}
]Get note size
GET /api/stats/note-size/{noteId} · getNoteSize
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
noteId required | string 12-character note ID |
Responses
200: Note size
application/json:object
| Property | Description |
|---|---|
size | integer |
{
"size": 0
}Get subtree size
GET /api/stats/subtree-size/{noteId} · getSubtreeSize
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
noteId required | string 12-character note ID |
Responses
200: Subtree size
application/json:object
| Property | Description |
|---|---|
size | integer |
{
"size": 0
}Get keyboard actions
GET /api/keyboard-actions · getKeyboardActions
Authorization: sessionAuth or tokenAuth
Responses
200: Keyboard actions
application/json:array of object
[
{
"actionName": "string",
"shortcut": "string",
"description": "string"
}
]Get keyboard shortcuts for notes
GET /api/keyboard-shortcuts-for-notes · getKeyboardShortcutsForNotes
Authorization: sessionAuth or tokenAuth
Responses
200: Keyboard shortcuts for notes
application/json:array of object
[
{
"noteId": "string",
"shortcut": "string",
"title": "string"
}
]Get font CSS
GET /api/fonts · getFonts
Authorization: sessionAuth or tokenAuth
Responses
200: Font CSS
text/css:string
Add recent note
POST /api/recent-notes · addRecentNote
Authorization: sessionAuth or tokenAuth
Request body (required)
application/json:object
| Property | Description |
|---|---|
noteId required | string |
{
"noteId": "string"
}Responses
204: Note added to recent
No content.
Get recent changes
GET /api/recent-changes/{ancestorNoteId} · getRecentChanges
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
ancestorNoteId required | string |
Responses
200: Recent changes
application/json:array of object
[
{
"noteId": "string",
"title": "string",
"dateModified": "2019-08-24T14:15:22Z"
}
]Get recently changed note IDs
GET /api/recent-changes/{ancestorNoteId}/note-ids · getRecentlyChangedNoteIds
Returns the IDs of the most recently modified live notes under the ancestor, newest first. Under root, notes found only in the hidden subtree are left out.
Authorization: sessionAuth or tokenAuth
Path parameters
| Name | Description |
|---|---|
ancestorNoteId required | string |
Query parameters
| Name | Description |
|---|---|
limit required | integer The maximum number of note IDs to return. |
Responses
200: Note IDs, newest first
application/json:array of string
[
"string"
]400: Missing or non-positive limit
No content.
Get the glyph of every icon
GET /api/icon-packs.css · getIconPackGlyphCss
A stylesheet with the ::before rule that places the character of each icon of each icon pack. The bootstrap data carries the fonts of the packs and links this stylesheet with a v parameter derived from its content, so the response can be cached for good. Served without a session, like the bootstrap data that names it on the login screen.
Authorization: none
Query parameters
| Name | Description |
|---|---|
v | string The content version the bootstrap data names; any value returns the current stylesheet |
Responses
200: The glyph rules of the icon packs
text/css:string
Get every icon of each icon pack
GET /api/other/icon-registry · getIconRegistry
Lists the icons that the icon picker searches. The bootstrap data names only the icon packs, since the full list runs to over a megabyte with many packs installed.
Authorization: sessionAuth or tokenAuth
Responses
200: The icons of each icon pack
application/json:object
| Property | Description |
|---|---|
sources | array of object |
sources[].prefix | string |
sources[].name | string |
sources[].icon | string An icon class that identifies the pack |
sources[].icons | array of object |
sources[].icons[].id | string The icon's classes, such as bx bx-star |
sources[].icons[].terms | array of string |
{
"sources": [
{
"prefix": "string",
"name": "string",
"icon": "string",
"icons": [
{
"id": "string",
"terms": [
"string"
]
}
]
}
]
}Get icon usage statistics
GET /api/other/icon-usage · getIconUsage
Authorization: sessionAuth or tokenAuth
Responses
200: Icon usage stats
application/json:object
{}Render markdown to HTML
POST /api/other/render-markdown · renderMarkdown
Authorization: sessionAuth or tokenAuth
Request body (required)
application/json:object
| Property | Description |
|---|---|
markdownContent required | string |
{
"markdownContent": "string"
}Responses
200: Rendered HTML
text/html:string
Renders given HTML to Markdown
POST /api/other/to-markdown · toMarkdown
Authorization: sessionAuth or tokenAuth
Request body (required)
application/json:object
| Property | Description |
|---|---|
htmlContent required | string |
{
"htmlContent": "string"
}Responses
200: Rendered Markdown
text/plain:string
Schemas
Note
| Property | Description |
|---|---|
noteId required | string 12-character note ID |
title required | string Note title |
type required | NoteType One of text, code, render, file, image, search, relationMap, book, noteMap, mermaid, canvas, webView, launcher, doc, contentWidget, mindMap, geoMap. |
mime required | string MIME type |
isProtected required | boolean Whether note is protected |
blobId | string ID of content blob |
dateCreated | DateTime |
dateModified | DateTime |
utcDateCreated | UtcDateTime Result of new Date().toISOString().replace('T', ' ') |
utcDateModified | UtcDateTime Result of new Date().toISOString().replace('T', ' ') |
NoteType
Type: string
One of text, code, render, file, image, search, relationMap, book, noteMap, mermaid, canvas, webView, launcher, doc, contentWidget, mindMap, geoMap.
Blob
| Property | Description |
|---|---|
blobId | string |
content | string | null null if not text. |
contentLength | integer |
dateModified | DateTime |
utcDateModified | UtcDateTime Result of new Date().toISOString().replace('T', ' ') |
Branch
| Property | Description |
|---|---|
branchId required | string Branch ID (parentNoteId_noteId) |
noteId required | string |
parentNoteId required | string |
notePosition required | integer |
prefix | string | null |
isExpanded | boolean |
Attribute
| Property | Description |
|---|---|
attributeId required | string |
noteId required | string |
type required | string One of label, relation. |
name required | string |
value required | string |
position | integer |
isInheritable | boolean |
Attachment
| Property | Description |
|---|---|
attachmentId required | string |
ownerId required | string |
role required | string One of image, file. |
mime required | string |
title required | string |
blobId | string |
dateModified | DateTime |
utcDateModified | UtcDateTime Result of new Date().toISOString().replace('T', ' ') |
Revision
| Property | Description |
|---|---|
revisionId | string |
noteId | string |
title | string |
type | NoteType One of text, code, render, file, image, search, relationMap, book, noteMap, mermaid, canvas, webView, launcher, doc, contentWidget, mindMap, geoMap. |
mime | string |
dateCreated | DateTime |
utcDateCreated | UtcDateTime Result of new Date().toISOString().replace('T', ' ') |
SearchResult
| Property | Description |
|---|---|
noteId | string |
title | string |
path | string |
score | number |
highlights | array of string |
EntityChange
| Property | Description |
|---|---|
entityChange | object |
entityChange.entityName | string |
entityChange.changeId | string |
entity | object |
DateTime
Type: string
Example: 2025-02-14 08:19:59.203+0100
UtcDateTime
Result of new Date().toISOString().replace('T', ' ')
Type: string
Example: 2025-02-13 07:42:47.698Z
Timestamps
| Property | Description |
|---|---|
dateCreated | DateTime |
dateModified | DateTime |
utcDateCreated | UtcDateTime Result of new Date().toISOString().replace('T', ' ') |
utcDateModified | UtcDateTime Result of new Date().toISOString().replace('T', ' ') |
ReferenceKind
The kind of a target, which sets how the link lists show it
Type: string
One of heading, anchor.
Example: heading
ReferenceParams
The parameters of a link that point at a target, not encoded
Type: object
Example: [object Object]
ReferenceTarget
| Property | Description |
|---|---|
kind required | ReferenceKind The kind of a target, which sets how the link lists show it. One of heading, anchor. |
title required | string The plain text that the lists show |
level | integer For a kind that nests, the depth of the target, such as 2 for an <h2> |
params | ReferenceParams The link parameters that point at the target; absent while it needs a reference |
NoteReferences
| Property | Description |
|---|---|
targets required | array of ReferenceTarget |
blobId | string The blob of the note that the targets were read from |
pendingToc | PendingToc A table of contents that the viewer of the document builds |
PendingToc
A table of contents that the viewer of the document builds
| Property | Description |
|---|---|
format required | string |
TocHeading
A heading of a table of contents, with the fields of its format, such as page
| Property | Description |
|---|---|
id required | string Names the heading in its document, for the heading link parameter |
title required | string Plain text, never HTML |
level required | integer |
params | object The parameters of a link to the heading; absent when no link can reach it |
CachedToc
| Property | Description |
|---|---|
status required | string One of ready, stale, missing, unreadable, unavailable, none. |
blobId | string For ready and stale, the blob that the headings were read from |
headings | array of TocHeading |
pendingToc | PendingToc A table of contents that the viewer of the document builds |
ClientToc
| Property | Description |
|---|---|
targetBlobHash required | string The blobId of the bytes that the viewer read, from their digest |
headings required | array of object In document order, without ids: title (at most 500 characters), level (1 for the first heading, at most one more than the heading before), and the fields of the format |
properties | object The properties of the format, such as { "reader": 2 } |
isCut | boolean Whether the viewer stopped reading at 20,000 headings, before another one. The ids of every heading of a cut table of contents are bound to the blob. |
elapsedMs required | number How long the viewer took, for the log |
FileUploaded
| Property | Description |
|---|---|
uploaded required | boolean |
blobId | string The blob that the upload wrote |
message | string Why nothing was uploaded |
NoteSaveBase
What a save of the content of a note is based on
| Property | Description |
|---|---|
blobId required | string |
type required | string |
mime required | string |
SavedAttachmentRow
An attachment that a save writes. With attachmentId it replaces that attachment, in a save with a base only while it is at blobId; without it, it creates one of its title.
| Property | Description |
|---|---|
attachmentId | string |
blobId | string The blob that the attachment was read at |
role required | string |
title required | string |
mime required | string |
content required | string |
position | integer |
encoding | string One of base64. |
SavedAttachmentBase
An attachment as a save left it
| Property | Description |
|---|---|
attachmentId required | string |
title required | string |
blobId required | string |
SaveConflict
Why a save of a note or an attachment was refused: the note now has another format, after a conversion, or another version than the one the save is based on
| Property | Description |
|---|---|
reason required | string One of format, version. |
message required | string |
blobId required | string The blob of the note now, which a save that keeps its version names |
type required | string |
mime required | string |
isVersioned required | boolean Whether the note keeps revisions |
attachments required | array of SavedAttachmentBase The attachments that the save names, by ID or by title, as the note has them now. A save that keeps its version replaces them at these blobs. |
BlocksVersionConflict
The blocks, or an attachment that the save replaces, changed since they were read
| Property | Description |
|---|---|
reason required | string One of version. |
message required | string |
hash required | string The hash of the blocks now, which a save that keeps its version names |
attachments required | array of SavedAttachmentBase As attachments of SaveConflict |
isVersioned required | boolean Whether the note keeps revisions |
BlocksGoneConflict
The blocks can no longer be saved apart: the note was converted (format), or the block parameter no longer points at blocks that can be edited apart (range)
| Property | Description |
|---|---|
reason required | string One of format, range. |
message required | string |
CreateNoteRequest
| Property | Description |
|---|---|
title required | string |
content | string |
type required | NoteType One of text, code, render, file, image, search, relationMap, book, noteMap, mermaid, canvas, webView, launcher, doc, contentWidget, mindMap, geoMap. |
mime | string |
isProtected | boolean |
isExpanded | boolean |
notePosition | integer |
prefix | string |
parentNoteId | string |
templateNoteId | string |
ScriptBundle
| Property | Description |
|---|---|
noteId | string |
script | string |
html | string |
css | string |
AppInfo
| Property | Description |
|---|---|
appVersion | string |
dbVersion | integer |
nodeVersion | string |
syncVersion | integer |
buildDate | string (date-time) |
buildRevision | string |
dataDirectory | string |
clipperProtocolVersion | string |
utcDateTime | string (date-time) |
EtapiToken
| Property | Description |
|---|---|
etapiTokenId | string |
name | string |
token | string |
dateCreated | DateTime |
isDeleted | boolean |