API Reference

External Trilium API

Authentication

EtapiTokenAuth

API key in the Authorization header.

EtapiBasicAuth

HTTP basic authentication.

Basic Auth where username is arbitrary string (e.g. "trilium", not checked), username is the ETAPI token. To emphasize, do not use Trilium password here (won't work), only the generated ETAPI token (from Options -> ETAPI)

Notes

Notes and their content, and the import and export of whole subtrees.

Create a note

POST /create-note · createNote

Create a note and place it into the note tree

Authorization: EtapiTokenAuth or EtapiBasicAuth

Request body (required)

PropertyDescription
parentNoteId
required
EntityId
Note ID of the parent note in the tree
title
required
string
type
required
string
One of text, code, file, image, search, book, relationMap, render.
mimestring
this needs to be specified only for note types 'code', 'file', 'image'.
content
required
string
notePositioninteger
Position of the note in the parent. Normal ordering is 10, 20, 30 ... So if you want to create a note on the first position, use e.g. 5, for second position 15, for last e.g. 1000000
prefixstring
Prefix is branch (placement) specific title prefix for the note. Let's say you have your note placed into two different places in the tree, but you want to change the title a bit in one of the placements. For this you can use prefix.
isExpandedboolean
true if this note (as a folder) should appear expanded
noteIdEntityId
DON'T specify unless you want to force a specific noteId. It must not belong to an existing note.
branchIdEntityId
DON'T specify unless you want to force a specific branchId
dateCreatedLocalDateTime
Local timestap of the note creation. Specify only if you want to override the default (current datetime in the current timezone/offset).
utcDateCreatedUtcDateTime
UTC timestap of the note creation. Specify only if you want to override the default (current datetime).
utcDateModifiedUtcDateTime
UTC timestamp of the note's last modification, e.g. to keep the date of a note being migrated from another application. The local dateModified is derived from it. Specify only if you want to override the default (current datetime).
{
    "parentNoteId": "evnnmvHTCgIn",
    "title": "string",
    "type": "text",
    "mime": "application/json",
    "content": "string",
    "notePosition": 0,
    "prefix": "string",
    "isExpanded": true,
    "noteId": "evnnmvHTCgIn",
    "branchId": "evnnmvHTCgIn",
    "dateCreated": "2021-12-31 20:18:11.930+0100",
    "utcDateCreated": "2021-12-31 19:18:11.930Z",
    "utcDateModified": "2021-12-31 19:18:11.930Z"
}

Responses

201: note created

PropertyDescription
noteNote
branchBranch
Branch places the note into the tree, it represents the relationship between a parent note and child note
{
    "note": {
        "noteId": "evnnmvHTCgIn",
        "title": "string",
        "type": "text",
        "mime": "string",
        "isProtected": true,
        "blobId": "string",
        "attributes": [
            {
                "attributeId": "evnnmvHTCgIn",
                "noteId": "evnnmvHTCgIn",
                "type": "label",
                "name": "shareCss",
                "value": "string",
                "position": 0,
                "isInheritable": true,
                "utcDateModified": "2021-12-31 19:18:11.930Z"
            }
        ],
        "parentNoteIds": [
            "evnnmvHTCgIn"
        ],
        "childNoteIds": [
            "evnnmvHTCgIn"
        ],
        "parentBranchIds": [
            "evnnmvHTCgIn"
        ],
        "childBranchIds": [
            "evnnmvHTCgIn"
        ],
        "dateCreated": "2021-12-31 20:18:11.930+0100",
        "dateModified": "2021-12-31 20:18:11.930+0100",
        "utcDateCreated": "2021-12-31 19:18:11.930Z",
        "utcDateModified": "2021-12-31 19:18:11.930Z"
    },
    "branch": {
        "branchId": "evnnmvHTCgIn",
        "noteId": "evnnmvHTCgIn",
        "parentNoteId": "evnnmvHTCgIn",
        "prefix": "string",
        "notePosition": 0,
        "isExpanded": true,
        "utcDateModified": "2021-12-31 19:18:11.930Z"
    }
}

409: a note with the given noteId already exists (NOTE_ALREADY_EXISTS)

  • application/json; charset=utf-8: Error
PropertyDescription
status
required
integer (int32)
HTTP status, identical to the one given in HTTP response
code
required
string
stable string constant
message
required
string
Human readable error, potentially with more details,
{
    "status": 400,
    "code": "NOTE_IS_PROTECTED",
    "message": "Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI"
}

default: unexpected error

  • application/json; charset=utf-8: Error
PropertyDescription
status
required
integer (int32)
HTTP status, identical to the one given in HTTP response
code
required
string
stable string constant
message
required
string
Human readable error, potentially with more details,
{
    "status": 400,
    "code": "NOTE_IS_PROTECTED",
    "message": "Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI"
}

Search notes

GET /notes · searchNotes

Search notes

Authorization: EtapiTokenAuth or EtapiBasicAuth

Query parameters

NameDescription
search
required
string
search query string as described in https://triliumnext.github.io/Docs/Wiki/search.html
fastSearchboolean
enable fast search (fulltext doesn't look into content)
includeArchivedNotesboolean
search by default ignores archived notes. Set to 'true' to includes archived notes into search results.
ancestorNoteIdEntityId
search only in a subtree identified by the subtree noteId. By default whole tree is searched.
ancestorDepthstring
define how deep in the tree should the notes be searched
orderBystring
name of the property/label to order search results by
orderDirectionstring
order direction, ascending or descending. One of asc, desc.
limitinteger
limit the number of results you want to receive
debugboolean
set to true to get debug information in the response (search query parsing)

Responses

200: search response

PropertyDescription
results
required
array of Note
debugInfoobject
debugging info on parsing the search query enabled with &debug=true parameter
{
    "results": [
        {
            "noteId": "evnnmvHTCgIn",
            "title": "string",
            "type": "text",
            "mime": "string",
            "isProtected": true,
            "blobId": "string",
            "attributes": [
                {
                    "attributeId": "evnnmvHTCgIn",
                    "noteId": "evnnmvHTCgIn",
                    "type": "label",
                    "name": "shareCss",
                    "value": "string",
                    "position": 0,
                    "isInheritable": true,
                    "utcDateModified": "2021-12-31 19:18:11.930Z"
                }
            ],
            "parentNoteIds": [
                "evnnmvHTCgIn"
            ],
            "childNoteIds": [
                "evnnmvHTCgIn"
            ],
            "parentBranchIds": [
                "evnnmvHTCgIn"
            ],
            "childBranchIds": [
                "evnnmvHTCgIn"
            ],
            "dateCreated": "2021-12-31 20:18:11.930+0100",
            "dateModified": "2021-12-31 20:18:11.930+0100",
            "utcDateCreated": "2021-12-31 19:18:11.930Z",
            "utcDateModified": "2021-12-31 19:18:11.930Z"
        }
    ],
    "debugInfo": {}
}

default: unexpected error

  • application/json; charset=utf-8: Error
PropertyDescription
status
required
integer (int32)
HTTP status, identical to the one given in HTTP response
code
required
string
stable string constant
message
required
string
Human readable error, potentially with more details,
{
    "status": 400,
    "code": "NOTE_IS_PROTECTED",
    "message": "Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI"
}

Get a note

GET /notes/{noteId} · getNoteById

Returns a note identified by its ID

Authorization: EtapiTokenAuth or EtapiBasicAuth

Path parameters

NameDescription
noteId
required
EntityId

Responses

200: note response

  • application/json; charset=utf-8: Note
PropertyDescription
noteIdEntityId
titlestring
Title of the note. Returned as "[protected]" for protected notes, since ETAPI cannot open a protected session.
typestring
One of text, code, render, file, image, search, relationMap, book, noteMap, mermaid, webView, shortcut, doc, contentWidget, launcher.
mimestring
isProtectedboolean
blobIdstring
ID of the blob object which effectively serves as a content hash
attributesAttributeList
parentNoteIdsEntityIdList
childNoteIdsEntityIdList
parentBranchIdsEntityIdList
childBranchIdsEntityIdList
dateCreatedLocalDateTime
dateModifiedLocalDateTime
utcDateCreatedUtcDateTime
utcDateModifiedUtcDateTime
Writable through PATCH, e.g. to restore a migrated note's date after its content was rewritten. The local dateModified is derived from it.
{
    "noteId": "evnnmvHTCgIn",
    "title": "string",
    "type": "text",
    "mime": "string",
    "isProtected": true,
    "blobId": "string",
    "attributes": [
        {
            "attributeId": "evnnmvHTCgIn",
            "noteId": "evnnmvHTCgIn",
            "type": "label",
            "name": "shareCss",
            "value": "string",
            "position": 0,
            "isInheritable": true,
            "utcDateModified": "2021-12-31 19:18:11.930Z"
        }
    ],
    "parentNoteIds": [
        "evnnmvHTCgIn"
    ],
    "childNoteIds": [
        "evnnmvHTCgIn"
    ],
    "parentBranchIds": [
        "evnnmvHTCgIn"
    ],
    "childBranchIds": [
        "evnnmvHTCgIn"
    ],
    "dateCreated": "2021-12-31 20:18:11.930+0100",
    "dateModified": "2021-12-31 20:18:11.930+0100",
    "utcDateCreated": "2021-12-31 19:18:11.930Z",
    "utcDateModified": "2021-12-31 19:18:11.930Z"
}

default: unexpected error

  • application/json; charset=utf-8: Error
PropertyDescription
status
required
integer (int32)
HTTP status, identical to the one given in HTTP response
code
required
string
stable string constant
message
required
string
Human readable error, potentially with more details,
{
    "status": 400,
    "code": "NOTE_IS_PROTECTED",
    "message": "Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI"
}

Delete a note

DELETE /notes/{noteId} · deleteNoteById

deletes a single note based on the noteId supplied

Authorization: EtapiTokenAuth or EtapiBasicAuth

Path parameters

NameDescription
noteId
required
EntityId

Responses

204: note deleted

No content.

default: unexpected error

  • application/json; charset=utf-8: Error
PropertyDescription
status
required
integer (int32)
HTTP status, identical to the one given in HTTP response
code
required
string
stable string constant
message
required
string
Human readable error, potentially with more details,
{
    "status": 400,
    "code": "NOTE_IS_PROTECTED",
    "message": "Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI"
}

Update a note

PATCH /notes/{noteId} · patchNoteById

patch a note identified by the noteId with changes in the body

Authorization: EtapiTokenAuth or EtapiBasicAuth

Path parameters

NameDescription
noteId
required
EntityId

Request body (required)

  • application/json: Note
PropertyDescription
noteIdEntityId
titlestring
Title of the note. Returned as "[protected]" for protected notes, since ETAPI cannot open a protected session.
typestring
One of text, code, render, file, image, search, relationMap, book, noteMap, mermaid, webView, shortcut, doc, contentWidget, launcher.
mimestring
isProtectedboolean
blobIdstring
ID of the blob object which effectively serves as a content hash
attributesAttributeList
parentNoteIdsEntityIdList
childNoteIdsEntityIdList
parentBranchIdsEntityIdList
childBranchIdsEntityIdList
dateCreatedLocalDateTime
dateModifiedLocalDateTime
utcDateCreatedUtcDateTime
utcDateModifiedUtcDateTime
Writable through PATCH, e.g. to restore a migrated note's date after its content was rewritten. The local dateModified is derived from it.
{
    "title": "string",
    "type": "text",
    "mime": "string",
    "blobId": "string",
    "dateCreated": "2021-12-31 20:18:11.930+0100",
    "utcDateCreated": "2021-12-31 19:18:11.930Z",
    "utcDateModified": "2021-12-31 19:18:11.930Z"
}

Responses

200: note updated

  • application/json; charset=utf-8: Note
PropertyDescription
noteIdEntityId
titlestring
Title of the note. Returned as "[protected]" for protected notes, since ETAPI cannot open a protected session.
typestring
One of text, code, render, file, image, search, relationMap, book, noteMap, mermaid, webView, shortcut, doc, contentWidget, launcher.
mimestring
isProtectedboolean
blobIdstring
ID of the blob object which effectively serves as a content hash
attributesAttributeList
parentNoteIdsEntityIdList
childNoteIdsEntityIdList
parentBranchIdsEntityIdList
childBranchIdsEntityIdList
dateCreatedLocalDateTime
dateModifiedLocalDateTime
utcDateCreatedUtcDateTime
utcDateModifiedUtcDateTime
Writable through PATCH, e.g. to restore a migrated note's date after its content was rewritten. The local dateModified is derived from it.
{
    "noteId": "evnnmvHTCgIn",
    "title": "string",
    "type": "text",
    "mime": "string",
    "isProtected": true,
    "blobId": "string",
    "attributes": [
        {
            "attributeId": "evnnmvHTCgIn",
            "noteId": "evnnmvHTCgIn",
            "type": "label",
            "name": "shareCss",
            "value": "string",
            "position": 0,
            "isInheritable": true,
            "utcDateModified": "2021-12-31 19:18:11.930Z"
        }
    ],
    "parentNoteIds": [
        "evnnmvHTCgIn"
    ],
    "childNoteIds": [
        "evnnmvHTCgIn"
    ],
    "parentBranchIds": [
        "evnnmvHTCgIn"
    ],
    "childBranchIds": [
        "evnnmvHTCgIn"
    ],
    "dateCreated": "2021-12-31 20:18:11.930+0100",
    "dateModified": "2021-12-31 20:18:11.930+0100",
    "utcDateCreated": "2021-12-31 19:18:11.930Z",
    "utcDateModified": "2021-12-31 19:18:11.930Z"
}

default: unexpected error

  • application/json; charset=utf-8: Error
PropertyDescription
status
required
integer (int32)
HTTP status, identical to the one given in HTTP response
code
required
string
stable string constant
message
required
string
Human readable error, potentially with more details,
{
    "status": 400,
    "code": "NOTE_IS_PROTECTED",
    "message": "Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI"
}

Get the content of a note

GET /notes/{noteId}/content · getNoteContent

Returns note content identified by its ID. The response carries the note's MIME type as its Content-Type.

Authorization: EtapiTokenAuth or EtapiBasicAuth

Path parameters

NameDescription
noteId
required
EntityId

Responses

200: note content

  • */*: string (binary)

Replace the content of a note

PUT /notes/{noteId}/content · putNoteContentById

Updates note content identified by its ID

Authorization: EtapiTokenAuth or EtapiBasicAuth

Path parameters

NameDescription
noteId
required
EntityId

Request body (required)

New content of the note. Send text (such as the HTML of a text note) as text/plain and binary data (such as the file of an image or file note) as application/octet-stream; other content types are not accepted.

  • text/plain: string
  • application/octet-stream: string (binary)

Responses

204: note content updated

No content.

Export a subtree

GET /notes/{noteId}/export · exportNoteSubtree

Exports ZIP file export of a given note subtree. To export whole document, use "root" for noteId. Protected notes are exported as "[protected]", without their content or attachments, even while the protected session is open. The "share" format refuses a subtree that contains a protected note with NOTE_IS_PROTECTED.

Authorization: EtapiTokenAuth or EtapiBasicAuth

Path parameters

NameDescription
noteId
required
EntityId

Query parameters

NameDescription
formatany
One of html, markdown, share.

Responses

200: export ZIP file

  • application/zip: string (binary)

default: unexpected error

  • application/json; charset=utf-8: Error
PropertyDescription
status
required
integer (int32)
HTTP status, identical to the one given in HTTP response
code
required
string
stable string constant
message
required
string
Human readable error, potentially with more details,
{
    "status": 400,
    "code": "NOTE_IS_PROTECTED",
    "message": "Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI"
}

Import a ZIP archive

POST /notes/{noteId}/import · importZip

Imports ZIP file into a given note.

Authorization: EtapiTokenAuth or EtapiBasicAuth

Path parameters

NameDescription
noteId
required
EntityId

Request body (required)

The ZIP file, sent as application/zip or application/octet-stream; other content types are not accepted.

  • application/zip: string (binary)
  • application/octet-stream: string (binary)

Responses

201: note created

PropertyDescription
noteNote
branchBranch
Branch places the note into the tree, it represents the relationship between a parent note and child note
{
    "note": {
        "noteId": "evnnmvHTCgIn",
        "title": "string",
        "type": "text",
        "mime": "string",
        "isProtected": true,
        "blobId": "string",
        "attributes": [
            {
                "attributeId": "evnnmvHTCgIn",
                "noteId": "evnnmvHTCgIn",
                "type": "label",
                "name": "shareCss",
                "value": "string",
                "position": 0,
                "isInheritable": true,
                "utcDateModified": "2021-12-31 19:18:11.930Z"
            }
        ],
        "parentNoteIds": [
            "evnnmvHTCgIn"
        ],
        "childNoteIds": [
            "evnnmvHTCgIn"
        ],
        "parentBranchIds": [
            "evnnmvHTCgIn"
        ],
        "childBranchIds": [
            "evnnmvHTCgIn"
        ],
        "dateCreated": "2021-12-31 20:18:11.930+0100",
        "dateModified": "2021-12-31 20:18:11.930+0100",
        "utcDateCreated": "2021-12-31 19:18:11.930Z",
        "utcDateModified": "2021-12-31 19:18:11.930Z"
    },
    "branch": {
        "branchId": "evnnmvHTCgIn",
        "noteId": "evnnmvHTCgIn",
        "parentNoteId": "evnnmvHTCgIn",
        "prefix": "string",
        "notePosition": 0,
        "isExpanded": true,
        "utcDateModified": "2021-12-31 19:18:11.930Z"
    }
}

default: unexpected error

  • application/json; charset=utf-8: Error
PropertyDescription
status
required
integer (int32)
HTTP status, identical to the one given in HTTP response
code
required
string
stable string constant
message
required
string
Human readable error, potentially with more details,
{
    "status": 400,
    "code": "NOTE_IS_PROTECTED",
    "message": "Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI"
}

Restore a deleted note

POST /notes/{noteId}/undelete · undeleteNote

Restore a deleted note. The note must be deleted and must have at least one undeleted parent.

Authorization: EtapiTokenAuth or EtapiBasicAuth

Path parameters

NameDescription
noteId
required
EntityId

Responses

200: note restored successfully

  • application/json; charset=utf-8: object
PropertyDescription
successboolean
{
    "success": true
}

default: unexpected error

  • application/json; charset=utf-8: Error
PropertyDescription
status
required
integer (int32)
HTTP status, identical to the one given in HTTP response
code
required
string
stable string constant
message
required
string
Human readable error, potentially with more details,
{
    "status": 400,
    "code": "NOTE_IS_PROTECTED",
    "message": "Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI"
}

List recent changes

GET /notes/history · getNoteHistory

Returns recent changes including note creations, modifications, and deletions

Authorization: EtapiTokenAuth or EtapiBasicAuth

Query parameters

NameDescription
ancestorNoteIdEntityId
Limit changes to a subtree identified by this note ID. Defaults to "root" (all notes).

Responses

200: list of recent changes

[
    {
        "noteId": "evnnmvHTCgIn",
        "title": "string",
        "current_title": "string",
        "current_isDeleted": true,
        "current_deleteId": "string",
        "current_isProtected": true,
        "utcDate": "2021-12-31 19:18:11.930Z",
        "date": "2021-12-31 20:18:11.930+0100",
        "canBeUndeleted": true
    }
]

default: unexpected error

  • application/json; charset=utf-8: Error
PropertyDescription
status
required
integer (int32)
HTTP status, identical to the one given in HTTP response
code
required
string
stable string constant
message
required
string
Human readable error, potentially with more details,
{
    "status": 400,
    "code": "NOTE_IS_PROTECTED",
    "message": "Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI"
}

Branches

Branches place a note in the tree, under a parent note.

Create a branch

POST /branches · postBranch

Create a branch (clone a note to a different location in the tree). In case there is a branch between parent note and child note already, then this will update the existing branch with prefix, notePosition and isExpanded.

Authorization: EtapiTokenAuth or EtapiBasicAuth

Request body (required)

PropertyDescription
branchIdEntityId
noteIdEntityId
identifies the child note
parentNoteIdEntityId
identifies the parent note
prefixstring
notePositioninteger (int32)
isExpandedboolean
utcDateModifiedUtcDateTime
{
    "branchId": "evnnmvHTCgIn",
    "prefix": "string",
    "notePosition": 0,
    "isExpanded": true
}

Responses

200: existing branch updated

  • application/json; charset=utf-8: Branch
PropertyDescription
branchIdEntityId
noteIdEntityId
identifies the child note
parentNoteIdEntityId
identifies the parent note
prefixstring
notePositioninteger (int32)
isExpandedboolean
utcDateModifiedUtcDateTime
{
    "branchId": "evnnmvHTCgIn",
    "noteId": "evnnmvHTCgIn",
    "parentNoteId": "evnnmvHTCgIn",
    "prefix": "string",
    "notePosition": 0,
    "isExpanded": true,
    "utcDateModified": "2021-12-31 19:18:11.930Z"
}

201: branch created

  • application/json; charset=utf-8: Branch
PropertyDescription
branchIdEntityId
noteIdEntityId
identifies the child note
parentNoteIdEntityId
identifies the parent note
prefixstring
notePositioninteger (int32)
isExpandedboolean
utcDateModifiedUtcDateTime
{
    "branchId": "evnnmvHTCgIn",
    "noteId": "evnnmvHTCgIn",
    "parentNoteId": "evnnmvHTCgIn",
    "prefix": "string",
    "notePosition": 0,
    "isExpanded": true,
    "utcDateModified": "2021-12-31 19:18:11.930Z"
}

default: unexpected error

  • application/json; charset=utf-8: Error
PropertyDescription
status
required
integer (int32)
HTTP status, identical to the one given in HTTP response
code
required
string
stable string constant
message
required
string
Human readable error, potentially with more details,
{
    "status": 400,
    "code": "NOTE_IS_PROTECTED",
    "message": "Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI"
}

Get a branch

GET /branches/{branchId} · getBranchById

Returns a branch identified by its ID

Authorization: EtapiTokenAuth or EtapiBasicAuth

Path parameters

NameDescription
branchId
required
EntityId

Responses

200: branch response

  • application/json; charset=utf-8: Branch
PropertyDescription
branchIdEntityId
noteIdEntityId
identifies the child note
parentNoteIdEntityId
identifies the parent note
prefixstring
notePositioninteger (int32)
isExpandedboolean
utcDateModifiedUtcDateTime
{
    "branchId": "evnnmvHTCgIn",
    "noteId": "evnnmvHTCgIn",
    "parentNoteId": "evnnmvHTCgIn",
    "prefix": "string",
    "notePosition": 0,
    "isExpanded": true,
    "utcDateModified": "2021-12-31 19:18:11.930Z"
}

default: unexpected error

  • application/json; charset=utf-8: Error
PropertyDescription
status
required
integer (int32)
HTTP status, identical to the one given in HTTP response
code
required
string
stable string constant
message
required
string
Human readable error, potentially with more details,
{
    "status": 400,
    "code": "NOTE_IS_PROTECTED",
    "message": "Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI"
}

Delete a branch

DELETE /branches/{branchId} · deleteBranchById

deletes a branch based on the branchId supplied. If this is the last branch of the (child) note, then the note is deleted as well.

Authorization: EtapiTokenAuth or EtapiBasicAuth

Path parameters

NameDescription
branchId
required
EntityId

Responses

204: branch deleted

No content.

default: unexpected error

  • application/json; charset=utf-8: Error
PropertyDescription
status
required
integer (int32)
HTTP status, identical to the one given in HTTP response
code
required
string
stable string constant
message
required
string
Human readable error, potentially with more details,
{
    "status": 400,
    "code": "NOTE_IS_PROTECTED",
    "message": "Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI"
}

Update a branch

PATCH /branches/{branchId} · patchBranchById

patch a branch identified by the branchId with changes in the body. Only prefix and notePosition can be updated. If you want to update other properties, you need to delete the old branch and create a new one.

Authorization: EtapiTokenAuth or EtapiBasicAuth

Path parameters

NameDescription
branchId
required
EntityId

Request body (required)

PropertyDescription
branchIdEntityId
noteIdEntityId
identifies the child note
parentNoteIdEntityId
identifies the parent note
prefixstring
notePositioninteger (int32)
isExpandedboolean
utcDateModifiedUtcDateTime
{
    "branchId": "evnnmvHTCgIn",
    "prefix": "string",
    "notePosition": 0,
    "isExpanded": true
}

Responses

200: branch updated

  • application/json; charset=utf-8: Branch
PropertyDescription
branchIdEntityId
noteIdEntityId
identifies the child note
parentNoteIdEntityId
identifies the parent note
prefixstring
notePositioninteger (int32)
isExpandedboolean
utcDateModifiedUtcDateTime
{
    "branchId": "evnnmvHTCgIn",
    "noteId": "evnnmvHTCgIn",
    "parentNoteId": "evnnmvHTCgIn",
    "prefix": "string",
    "notePosition": 0,
    "isExpanded": true,
    "utcDateModified": "2021-12-31 19:18:11.930Z"
}

default: unexpected error

  • application/json; charset=utf-8: Error
PropertyDescription
status
required
integer (int32)
HTTP status, identical to the one given in HTTP response
code
required
string
stable string constant
message
required
string
Human readable error, potentially with more details,
{
    "status": 400,
    "code": "NOTE_IS_PROTECTED",
    "message": "Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI"
}

Refresh the order of child notes

POST /refresh-note-ordering/{parentNoteId} · postRefreshNoteOrdering

notePositions in branches are not automatically pushed to connected clients and need a specific instruction. If you want your changes to be in effect immediately, call this service after setting branches' notePosition. Note that you need to supply "parentNoteId" of branch(es) with changed positions.

Authorization: EtapiTokenAuth or EtapiBasicAuth

Path parameters

NameDescription
parentNoteId
required
EntityId

Responses

204: note ordering refreshed

No content.

default: unexpected error

  • application/json; charset=utf-8: Error
PropertyDescription
status
required
integer (int32)
HTTP status, identical to the one given in HTTP response
code
required
string
stable string constant
message
required
string
Human readable error, potentially with more details,
{
    "status": 400,
    "code": "NOTE_IS_PROTECTED",
    "message": "Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI"
}

Attributes

Labels and relations of a note.

Create an attribute

POST /attributes · postAttribute

create an attribute for a given note

Authorization: EtapiTokenAuth or EtapiBasicAuth

Request body (required)

PropertyDescription
attributeIdEntityId
noteIdEntityId
identifies the child note
typestring
One of label, relation.
namestring
Matches ^[^\s]+.
valuestring
positioninteger (int32)
isInheritableboolean
utcDateModifiedUtcDateTime
{
    "attributeId": "evnnmvHTCgIn",
    "type": "label",
    "name": "shareCss",
    "value": "string",
    "position": 0,
    "isInheritable": true
}

Responses

201: attribute created

PropertyDescription
attributeIdEntityId
noteIdEntityId
identifies the child note
typestring
One of label, relation.
namestring
Matches ^[^\s]+.
valuestring
positioninteger (int32)
isInheritableboolean
utcDateModifiedUtcDateTime
{
    "attributeId": "evnnmvHTCgIn",
    "noteId": "evnnmvHTCgIn",
    "type": "label",
    "name": "shareCss",
    "value": "string",
    "position": 0,
    "isInheritable": true,
    "utcDateModified": "2021-12-31 19:18:11.930Z"
}

409: an attribute with the given attributeId already exists (ATTRIBUTE_ALREADY_EXISTS)

  • application/json; charset=utf-8: Error
PropertyDescription
status
required
integer (int32)
HTTP status, identical to the one given in HTTP response
code
required
string
stable string constant
message
required
string
Human readable error, potentially with more details,
{
    "status": 400,
    "code": "NOTE_IS_PROTECTED",
    "message": "Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI"
}

default: unexpected error

  • application/json; charset=utf-8: Error
PropertyDescription
status
required
integer (int32)
HTTP status, identical to the one given in HTTP response
code
required
string
stable string constant
message
required
string
Human readable error, potentially with more details,
{
    "status": 400,
    "code": "NOTE_IS_PROTECTED",
    "message": "Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI"
}

Get an attribute

GET /attributes/{attributeId} · getAttributeById

Returns an attribute identified by its ID

Authorization: EtapiTokenAuth or EtapiBasicAuth

Path parameters

NameDescription
attributeId
required
EntityId

Responses

200: attribute response

PropertyDescription
attributeIdEntityId
noteIdEntityId
identifies the child note
typestring
One of label, relation.
namestring
Matches ^[^\s]+.
valuestring
positioninteger (int32)
isInheritableboolean
utcDateModifiedUtcDateTime
{
    "attributeId": "evnnmvHTCgIn",
    "noteId": "evnnmvHTCgIn",
    "type": "label",
    "name": "shareCss",
    "value": "string",
    "position": 0,
    "isInheritable": true,
    "utcDateModified": "2021-12-31 19:18:11.930Z"
}

default: unexpected error

  • application/json; charset=utf-8: Error
PropertyDescription
status
required
integer (int32)
HTTP status, identical to the one given in HTTP response
code
required
string
stable string constant
message
required
string
Human readable error, potentially with more details,
{
    "status": 400,
    "code": "NOTE_IS_PROTECTED",
    "message": "Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI"
}

Delete an attribute

DELETE /attributes/{attributeId} · deleteAttributeById

deletes an attribute based on the attributeId supplied.

Authorization: EtapiTokenAuth or EtapiBasicAuth

Path parameters

NameDescription
attributeId
required
EntityId

Responses

204: attribute deleted

No content.

default: unexpected error

  • application/json; charset=utf-8: Error
PropertyDescription
status
required
integer (int32)
HTTP status, identical to the one given in HTTP response
code
required
string
stable string constant
message
required
string
Human readable error, potentially with more details,
{
    "status": 400,
    "code": "NOTE_IS_PROTECTED",
    "message": "Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI"
}

Update an attribute

PATCH /attributes/{attributeId} · patchAttributeById

patch an attribute identified by the attributeId with changes in the body. For labels, only value and position can be updated. For relations, only position can be updated. If you want to modify other properties, you need to delete the old attribute and create a new one.

Authorization: EtapiTokenAuth or EtapiBasicAuth

Path parameters

NameDescription
attributeId
required
EntityId

Request body (required)

PropertyDescription
attributeIdEntityId
noteIdEntityId
identifies the child note
typestring
One of label, relation.
namestring
Matches ^[^\s]+.
valuestring
positioninteger (int32)
isInheritableboolean
utcDateModifiedUtcDateTime
{
    "attributeId": "evnnmvHTCgIn",
    "type": "label",
    "name": "shareCss",
    "value": "string",
    "position": 0,
    "isInheritable": true
}

Responses

200: attribute updated

PropertyDescription
attributeIdEntityId
noteIdEntityId
identifies the child note
typestring
One of label, relation.
namestring
Matches ^[^\s]+.
valuestring
positioninteger (int32)
isInheritableboolean
utcDateModifiedUtcDateTime
{
    "attributeId": "evnnmvHTCgIn",
    "noteId": "evnnmvHTCgIn",
    "type": "label",
    "name": "shareCss",
    "value": "string",
    "position": 0,
    "isInheritable": true,
    "utcDateModified": "2021-12-31 19:18:11.930Z"
}

default: unexpected error

  • application/json; charset=utf-8: Error
PropertyDescription
status
required
integer (int32)
HTTP status, identical to the one given in HTTP response
code
required
string
stable string constant
message
required
string
Human readable error, potentially with more details,
{
    "status": 400,
    "code": "NOTE_IS_PROTECTED",
    "message": "Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI"
}

Attachments

Files attached to a note.

List the attachments of a note

GET /notes/{noteId}/attachments · getNoteAttachments

Returns all attachments for a note identified by its ID

Authorization: EtapiTokenAuth or EtapiBasicAuth

Path parameters

NameDescription
noteId
required
EntityId

Responses

200: list of attachments

  • application/json; charset=utf-8: array of Attachment
[
    {
        "attachmentId": "evnnmvHTCgIn",
        "ownerId": "evnnmvHTCgIn",
        "role": "string",
        "mime": "string",
        "title": "string",
        "position": 0,
        "blobId": "string",
        "dateModified": "2021-12-31 20:18:11.930+0100",
        "utcDateModified": "2021-12-31 19:18:11.930Z",
        "utcDateScheduledForErasureSince": "2021-12-31 19:18:11.930Z",
        "contentLength": 0
    }
]

default: unexpected error

  • application/json; charset=utf-8: Error
PropertyDescription
status
required
integer (int32)
HTTP status, identical to the one given in HTTP response
code
required
string
stable string constant
message
required
string
Human readable error, potentially with more details,
{
    "status": 400,
    "code": "NOTE_IS_PROTECTED",
    "message": "Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI"
}

Create an attachment

POST /attachments · postAttachment

create an attachment

Authorization: EtapiTokenAuth or EtapiBasicAuth

Request body (required)

PropertyDescription
ownerIdEntityId
identifies the owner of the attachment, is either noteId or revisionId
rolestring
mimestring
titlestring
contentstring
Text content of the attachment, stored as-is. To store binary content, create the attachment without it, then upload the data with PUT /attachments/{attachmentId}/content.
positioninteger (int32)
{
    "ownerId": "evnnmvHTCgIn",
    "role": "string",
    "mime": "string",
    "title": "string",
    "content": "string",
    "position": 0
}

Responses

201: attachment created

PropertyDescription
attachmentIdEntityId
ownerIdEntityId
identifies the owner of the attachment, is either noteId or revisionId
rolestring
mimestring
titlestring
Title of the attachment. Returned as "[protected]" for protected attachments, since ETAPI cannot open a protected session.
positioninteger (int32)
blobIdstring
ID of the blob object which effectively serves as a content hash
dateModifiedLocalDateTime
utcDateModifiedUtcDateTime
utcDateScheduledForErasureSinceUtcDateTime
contentLengthinteger (int32)
{
    "attachmentId": "evnnmvHTCgIn",
    "ownerId": "evnnmvHTCgIn",
    "role": "string",
    "mime": "string",
    "title": "string",
    "position": 0,
    "blobId": "string",
    "dateModified": "2021-12-31 20:18:11.930+0100",
    "utcDateModified": "2021-12-31 19:18:11.930Z",
    "utcDateScheduledForErasureSince": "2021-12-31 19:18:11.930Z",
    "contentLength": 0
}

default: unexpected error

  • application/json; charset=utf-8: Error
PropertyDescription
status
required
integer (int32)
HTTP status, identical to the one given in HTTP response
code
required
string
stable string constant
message
required
string
Human readable error, potentially with more details,
{
    "status": 400,
    "code": "NOTE_IS_PROTECTED",
    "message": "Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI"
}

Get an attachment

GET /attachments/{attachmentId} · getAttachmentById

Returns an attachment identified by its ID

Authorization: EtapiTokenAuth or EtapiBasicAuth

Path parameters

NameDescription
attachmentId
required
EntityId

Responses

200: attachment response

PropertyDescription
attachmentIdEntityId
ownerIdEntityId
identifies the owner of the attachment, is either noteId or revisionId
rolestring
mimestring
titlestring
Title of the attachment. Returned as "[protected]" for protected attachments, since ETAPI cannot open a protected session.
positioninteger (int32)
blobIdstring
ID of the blob object which effectively serves as a content hash
dateModifiedLocalDateTime
utcDateModifiedUtcDateTime
utcDateScheduledForErasureSinceUtcDateTime
contentLengthinteger (int32)
{
    "attachmentId": "evnnmvHTCgIn",
    "ownerId": "evnnmvHTCgIn",
    "role": "string",
    "mime": "string",
    "title": "string",
    "position": 0,
    "blobId": "string",
    "dateModified": "2021-12-31 20:18:11.930+0100",
    "utcDateModified": "2021-12-31 19:18:11.930Z",
    "utcDateScheduledForErasureSince": "2021-12-31 19:18:11.930Z",
    "contentLength": 0
}

default: unexpected error

  • application/json; charset=utf-8: Error
PropertyDescription
status
required
integer (int32)
HTTP status, identical to the one given in HTTP response
code
required
string
stable string constant
message
required
string
Human readable error, potentially with more details,
{
    "status": 400,
    "code": "NOTE_IS_PROTECTED",
    "message": "Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI"
}

Delete an attachment

DELETE /attachments/{attachmentId} · deleteAttachmentById

deletes an attachment based on the attachmentId supplied.

Authorization: EtapiTokenAuth or EtapiBasicAuth

Path parameters

NameDescription
attachmentId
required
EntityId

Responses

204: attachment deleted

No content.

default: unexpected error

  • application/json; charset=utf-8: Error
PropertyDescription
status
required
integer (int32)
HTTP status, identical to the one given in HTTP response
code
required
string
stable string constant
message
required
string
Human readable error, potentially with more details,
{
    "status": 400,
    "code": "NOTE_IS_PROTECTED",
    "message": "Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI"
}

Update an attachment

PATCH /attachments/{attachmentId} · patchAttachmentById

patch an attachment identified by the attachmentId with changes in the body. Only role, mime, title, and position are patchable.

Authorization: EtapiTokenAuth or EtapiBasicAuth

Path parameters

NameDescription
attachmentId
required
EntityId

Request body (required)

PropertyDescription
attachmentIdEntityId
ownerIdEntityId
identifies the owner of the attachment, is either noteId or revisionId
rolestring
mimestring
titlestring
Title of the attachment. Returned as "[protected]" for protected attachments, since ETAPI cannot open a protected session.
positioninteger (int32)
blobIdstring
ID of the blob object which effectively serves as a content hash
dateModifiedLocalDateTime
utcDateModifiedUtcDateTime
utcDateScheduledForErasureSinceUtcDateTime
contentLengthinteger (int32)
{
    "ownerId": "evnnmvHTCgIn",
    "role": "string",
    "mime": "string",
    "title": "string",
    "position": 0,
    "blobId": "string",
    "contentLength": 0
}

Responses

200: attribute updated

PropertyDescription
attachmentIdEntityId
ownerIdEntityId
identifies the owner of the attachment, is either noteId or revisionId
rolestring
mimestring
titlestring
Title of the attachment. Returned as "[protected]" for protected attachments, since ETAPI cannot open a protected session.
positioninteger (int32)
blobIdstring
ID of the blob object which effectively serves as a content hash
dateModifiedLocalDateTime
utcDateModifiedUtcDateTime
utcDateScheduledForErasureSinceUtcDateTime
contentLengthinteger (int32)
{
    "attachmentId": "evnnmvHTCgIn",
    "ownerId": "evnnmvHTCgIn",
    "role": "string",
    "mime": "string",
    "title": "string",
    "position": 0,
    "blobId": "string",
    "dateModified": "2021-12-31 20:18:11.930+0100",
    "utcDateModified": "2021-12-31 19:18:11.930Z",
    "utcDateScheduledForErasureSince": "2021-12-31 19:18:11.930Z",
    "contentLength": 0
}

default: unexpected error

  • application/json; charset=utf-8: Error
PropertyDescription
status
required
integer (int32)
HTTP status, identical to the one given in HTTP response
code
required
string
stable string constant
message
required
string
Human readable error, potentially with more details,
{
    "status": 400,
    "code": "NOTE_IS_PROTECTED",
    "message": "Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI"
}

Get the content of an attachment

GET /attachments/{attachmentId}/content · getAttachmentContent

Returns attachment content identified by its ID. The response carries the attachment's MIME type as its Content-Type.

Authorization: EtapiTokenAuth or EtapiBasicAuth

Path parameters

NameDescription
attachmentId
required
EntityId

Responses

200: attachment content

  • */*: string (binary)

Replace the content of an attachment

PUT /attachments/{attachmentId}/content · putAttachmentContentById

Updates attachment content identified by its ID

Authorization: EtapiTokenAuth or EtapiBasicAuth

Path parameters

NameDescription
attachmentId
required
EntityId

Request body (required)

New content of the attachment. Send text as text/plain and binary data (such as an image or a PDF) as application/octet-stream; other content types are not accepted.

  • text/plain: string
  • application/octet-stream: string (binary)

Responses

204: attachment content updated

No content.

Revisions

Snapshots of a note's content.

Create a revision

POST /notes/{noteId}/revision · createRevision

Create a note revision for the given note

Authorization: EtapiTokenAuth or EtapiBasicAuth

Path parameters

NameDescription
noteId
required
EntityId

Query parameters

NameDescription
formatany
One of html, markdown.

Responses

204: revision has been created

No content.

default: unexpected error

  • application/json; charset=utf-8: Error
PropertyDescription
status
required
integer (int32)
HTTP status, identical to the one given in HTTP response
code
required
string
stable string constant
message
required
string
Human readable error, potentially with more details,
{
    "status": 400,
    "code": "NOTE_IS_PROTECTED",
    "message": "Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI"
}

List the revisions of a note

GET /notes/{noteId}/revisions · getNoteRevisions

Returns the revisions of a note identified by its ID. Protected revisions are omitted, since they cannot be read through ETAPI individually either.

Authorization: EtapiTokenAuth or EtapiBasicAuth

Path parameters

NameDescription
noteId
required
EntityId

Responses

200: list of revisions

  • application/json; charset=utf-8: array of Revision
[
    {
        "revisionId": "evnnmvHTCgIn",
        "noteId": "evnnmvHTCgIn",
        "type": "text",
        "mime": "string",
        "isProtected": true,
        "title": "string",
        "blobId": "string",
        "dateLastEdited": "2021-12-31 20:18:11.930+0100",
        "dateCreated": "2021-12-31 20:18:11.930+0100",
        "utcDateLastEdited": "2021-12-31 19:18:11.930Z",
        "utcDateCreated": "2021-12-31 19:18:11.930Z",
        "utcDateModified": "2021-12-31 19:18:11.930Z",
        "contentLength": 0
    }
]

default: unexpected error

  • application/json; charset=utf-8: Error
PropertyDescription
status
required
integer (int32)
HTTP status, identical to the one given in HTTP response
code
required
string
stable string constant
message
required
string
Human readable error, potentially with more details,
{
    "status": 400,
    "code": "NOTE_IS_PROTECTED",
    "message": "Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI"
}

Get a revision

GET /revisions/{revisionId} · getRevisionById

Returns a revision identified by its ID

Authorization: EtapiTokenAuth or EtapiBasicAuth

Path parameters

NameDescription
revisionId
required
EntityId

Responses

200: revision response

  • application/json; charset=utf-8: Revision
PropertyDescription
revisionIdEntityId
noteIdEntityId
typestring
One of text, code, render, file, image, search, relationMap, book, noteMap, mermaid, webView, shortcut, doc, contentWidget, launcher.
mimestring
isProtectedboolean
titlestring
blobIdstring
ID of the blob object which effectively serves as a content hash
dateLastEditedLocalDateTime
dateCreatedLocalDateTime
utcDateLastEditedUtcDateTime
utcDateCreatedUtcDateTime
utcDateModifiedUtcDateTime
contentLengthinteger (int32)
{
    "revisionId": "evnnmvHTCgIn",
    "noteId": "evnnmvHTCgIn",
    "type": "text",
    "mime": "string",
    "isProtected": true,
    "title": "string",
    "blobId": "string",
    "dateLastEdited": "2021-12-31 20:18:11.930+0100",
    "dateCreated": "2021-12-31 20:18:11.930+0100",
    "utcDateLastEdited": "2021-12-31 19:18:11.930Z",
    "utcDateCreated": "2021-12-31 19:18:11.930Z",
    "utcDateModified": "2021-12-31 19:18:11.930Z",
    "contentLength": 0
}

default: unexpected error

  • application/json; charset=utf-8: Error
PropertyDescription
status
required
integer (int32)
HTTP status, identical to the one given in HTTP response
code
required
string
stable string constant
message
required
string
Human readable error, potentially with more details,
{
    "status": 400,
    "code": "NOTE_IS_PROTECTED",
    "message": "Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI"
}

Get the content of a revision

GET /revisions/{revisionId}/content · getRevisionContent

Returns revision content identified by its ID

Authorization: EtapiTokenAuth or EtapiBasicAuth

Path parameters

NameDescription
revisionId
required
EntityId

Responses

200: revision content response

  • text/html: string

default: unexpected error

  • application/json; charset=utf-8: Error
PropertyDescription
status
required
integer (int32)
HTTP status, identical to the one given in HTTP response
code
required
string
stable string constant
message
required
string
Human readable error, potentially with more details,
{
    "status": 400,
    "code": "NOTE_IS_PROTECTED",
    "message": "Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI"
}

Calendar

Day, week, month and year notes of the journal, and the inbox note.

Get the inbox note

GET /inbox/{date} · getInboxNote

returns an "inbox" note, into which note can be created. Date will be used depending on whether the inbox is a fixed note (identified with #inbox label) or a day note in a journal. A database with neither returns the root note, and ignores the date, rather than creating a journal to hold a day note.

Authorization: EtapiTokenAuth or EtapiBasicAuth

Path parameters

NameDescription
date
required
string (date)

Responses

200: inbox note

  • application/json; charset=utf-8: Note
PropertyDescription
noteIdEntityId
titlestring
Title of the note. Returned as "[protected]" for protected notes, since ETAPI cannot open a protected session.
typestring
One of text, code, render, file, image, search, relationMap, book, noteMap, mermaid, webView, shortcut, doc, contentWidget, launcher.
mimestring
isProtectedboolean
blobIdstring
ID of the blob object which effectively serves as a content hash
attributesAttributeList
parentNoteIdsEntityIdList
childNoteIdsEntityIdList
parentBranchIdsEntityIdList
childBranchIdsEntityIdList
dateCreatedLocalDateTime
dateModifiedLocalDateTime
utcDateCreatedUtcDateTime
utcDateModifiedUtcDateTime
Writable through PATCH, e.g. to restore a migrated note's date after its content was rewritten. The local dateModified is derived from it.
{
    "noteId": "evnnmvHTCgIn",
    "title": "string",
    "type": "text",
    "mime": "string",
    "isProtected": true,
    "blobId": "string",
    "attributes": [
        {
            "attributeId": "evnnmvHTCgIn",
            "noteId": "evnnmvHTCgIn",
            "type": "label",
            "name": "shareCss",
            "value": "string",
            "position": 0,
            "isInheritable": true,
            "utcDateModified": "2021-12-31 19:18:11.930Z"
        }
    ],
    "parentNoteIds": [
        "evnnmvHTCgIn"
    ],
    "childNoteIds": [
        "evnnmvHTCgIn"
    ],
    "parentBranchIds": [
        "evnnmvHTCgIn"
    ],
    "childBranchIds": [
        "evnnmvHTCgIn"
    ],
    "dateCreated": "2021-12-31 20:18:11.930+0100",
    "dateModified": "2021-12-31 20:18:11.930+0100",
    "utcDateCreated": "2021-12-31 19:18:11.930Z",
    "utcDateModified": "2021-12-31 19:18:11.930Z"
}

default: unexpected error

  • application/json; charset=utf-8: Error
PropertyDescription
status
required
integer (int32)
HTTP status, identical to the one given in HTTP response
code
required
string
stable string constant
message
required
string
Human readable error, potentially with more details,
{
    "status": 400,
    "code": "NOTE_IS_PROTECTED",
    "message": "Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI"
}

Get a day note

GET /calendar/days/{date} · getDayNote

returns a day note for a given date. Gets created if doesn't exist.

Authorization: EtapiTokenAuth or EtapiBasicAuth

Path parameters

NameDescription
date
required
string (date)

Responses

200: day note

  • application/json; charset=utf-8: Note
PropertyDescription
noteIdEntityId
titlestring
Title of the note. Returned as "[protected]" for protected notes, since ETAPI cannot open a protected session.
typestring
One of text, code, render, file, image, search, relationMap, book, noteMap, mermaid, webView, shortcut, doc, contentWidget, launcher.
mimestring
isProtectedboolean
blobIdstring
ID of the blob object which effectively serves as a content hash
attributesAttributeList
parentNoteIdsEntityIdList
childNoteIdsEntityIdList
parentBranchIdsEntityIdList
childBranchIdsEntityIdList
dateCreatedLocalDateTime
dateModifiedLocalDateTime
utcDateCreatedUtcDateTime
utcDateModifiedUtcDateTime
Writable through PATCH, e.g. to restore a migrated note's date after its content was rewritten. The local dateModified is derived from it.
{
    "noteId": "evnnmvHTCgIn",
    "title": "string",
    "type": "text",
    "mime": "string",
    "isProtected": true,
    "blobId": "string",
    "attributes": [
        {
            "attributeId": "evnnmvHTCgIn",
            "noteId": "evnnmvHTCgIn",
            "type": "label",
            "name": "shareCss",
            "value": "string",
            "position": 0,
            "isInheritable": true,
            "utcDateModified": "2021-12-31 19:18:11.930Z"
        }
    ],
    "parentNoteIds": [
        "evnnmvHTCgIn"
    ],
    "childNoteIds": [
        "evnnmvHTCgIn"
    ],
    "parentBranchIds": [
        "evnnmvHTCgIn"
    ],
    "childBranchIds": [
        "evnnmvHTCgIn"
    ],
    "dateCreated": "2021-12-31 20:18:11.930+0100",
    "dateModified": "2021-12-31 20:18:11.930+0100",
    "utcDateCreated": "2021-12-31 19:18:11.930Z",
    "utcDateModified": "2021-12-31 19:18:11.930Z"
}

default: unexpected error

  • application/json; charset=utf-8: Error
PropertyDescription
status
required
integer (int32)
HTTP status, identical to the one given in HTTP response
code
required
string
stable string constant
message
required
string
Human readable error, potentially with more details,
{
    "status": 400,
    "code": "NOTE_IS_PROTECTED",
    "message": "Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI"
}

Get the day note starting the week

GET /calendar/week-first-day/{date} · getWeekFirstDayNote

Returns the day note for the first day of the week containing the given date, honouring the configured first day of week. The note is created if it doesn't exist. This returns a day note, not a week note, so unlike /calendar/weeks/{week} it does not require the enableWeekNote label on the calendar root.

Authorization: EtapiTokenAuth or EtapiBasicAuth

Path parameters

NameDescription
date
required
string (date)
Any date within the week, in the format YYYY-MM-DD.

Responses

200: day note starting the week

  • application/json; charset=utf-8: Note
PropertyDescription
noteIdEntityId
titlestring
Title of the note. Returned as "[protected]" for protected notes, since ETAPI cannot open a protected session.
typestring
One of text, code, render, file, image, search, relationMap, book, noteMap, mermaid, webView, shortcut, doc, contentWidget, launcher.
mimestring
isProtectedboolean
blobIdstring
ID of the blob object which effectively serves as a content hash
attributesAttributeList
parentNoteIdsEntityIdList
childNoteIdsEntityIdList
parentBranchIdsEntityIdList
childBranchIdsEntityIdList
dateCreatedLocalDateTime
dateModifiedLocalDateTime
utcDateCreatedUtcDateTime
utcDateModifiedUtcDateTime
Writable through PATCH, e.g. to restore a migrated note's date after its content was rewritten. The local dateModified is derived from it.
{
    "noteId": "evnnmvHTCgIn",
    "title": "string",
    "type": "text",
    "mime": "string",
    "isProtected": true,
    "blobId": "string",
    "attributes": [
        {
            "attributeId": "evnnmvHTCgIn",
            "noteId": "evnnmvHTCgIn",
            "type": "label",
            "name": "shareCss",
            "value": "string",
            "position": 0,
            "isInheritable": true,
            "utcDateModified": "2021-12-31 19:18:11.930Z"
        }
    ],
    "parentNoteIds": [
        "evnnmvHTCgIn"
    ],
    "childNoteIds": [
        "evnnmvHTCgIn"
    ],
    "parentBranchIds": [
        "evnnmvHTCgIn"
    ],
    "childBranchIds": [
        "evnnmvHTCgIn"
    ],
    "dateCreated": "2021-12-31 20:18:11.930+0100",
    "dateModified": "2021-12-31 20:18:11.930+0100",
    "utcDateCreated": "2021-12-31 19:18:11.930Z",
    "utcDateModified": "2021-12-31 19:18:11.930Z"
}

default: unexpected error

  • application/json; charset=utf-8: Error
PropertyDescription
status
required
integer (int32)
HTTP status, identical to the one given in HTTP response
code
required
string
stable string constant
message
required
string
Human readable error, potentially with more details,
{
    "status": 400,
    "code": "NOTE_IS_PROTECTED",
    "message": "Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI"
}

Get a week note

GET /calendar/weeks/{week} · getWeekNote

Returns a week note for a given ISO week (format YYYY-Www, e.g., 2025-W01). The note is created if it doesn't exist.

Authorization: EtapiTokenAuth or EtapiBasicAuth

Path parameters

NameDescription
week
required
string
The ISO 8601 week identifier (YYYY-Www). Matches [0-9]{4}-W[0-9]{2}.

Responses

200: week note

  • application/json; charset=utf-8: Note
PropertyDescription
noteIdEntityId
titlestring
Title of the note. Returned as "[protected]" for protected notes, since ETAPI cannot open a protected session.
typestring
One of text, code, render, file, image, search, relationMap, book, noteMap, mermaid, webView, shortcut, doc, contentWidget, launcher.
mimestring
isProtectedboolean
blobIdstring
ID of the blob object which effectively serves as a content hash
attributesAttributeList
parentNoteIdsEntityIdList
childNoteIdsEntityIdList
parentBranchIdsEntityIdList
childBranchIdsEntityIdList
dateCreatedLocalDateTime
dateModifiedLocalDateTime
utcDateCreatedUtcDateTime
utcDateModifiedUtcDateTime
Writable through PATCH, e.g. to restore a migrated note's date after its content was rewritten. The local dateModified is derived from it.
{
    "noteId": "evnnmvHTCgIn",
    "title": "string",
    "type": "text",
    "mime": "string",
    "isProtected": true,
    "blobId": "string",
    "attributes": [
        {
            "attributeId": "evnnmvHTCgIn",
            "noteId": "evnnmvHTCgIn",
            "type": "label",
            "name": "shareCss",
            "value": "string",
            "position": 0,
            "isInheritable": true,
            "utcDateModified": "2021-12-31 19:18:11.930Z"
        }
    ],
    "parentNoteIds": [
        "evnnmvHTCgIn"
    ],
    "childNoteIds": [
        "evnnmvHTCgIn"
    ],
    "parentBranchIds": [
        "evnnmvHTCgIn"
    ],
    "childBranchIds": [
        "evnnmvHTCgIn"
    ],
    "dateCreated": "2021-12-31 20:18:11.930+0100",
    "dateModified": "2021-12-31 20:18:11.930+0100",
    "utcDateCreated": "2021-12-31 19:18:11.930Z",
    "utcDateModified": "2021-12-31 19:18:11.930Z"
}

default: unexpected error

  • application/json; charset=utf-8: Error
PropertyDescription
status
required
integer (int32)
HTTP status, identical to the one given in HTTP response
code
required
string
stable string constant
message
required
string
Human readable error, potentially with more details,
{
    "status": 400,
    "code": "NOTE_IS_PROTECTED",
    "message": "Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI"
}

Get a month note

GET /calendar/months/{month} · getMonthNote

Returns a month note for a given month (format YYYY-MM, e.g., 2022-02). The note is created if it doesn't exist.

Authorization: EtapiTokenAuth or EtapiBasicAuth

Path parameters

NameDescription
month
required
string
Matches [0-9]{4}-[0-9]{2}.

Responses

200: month note

  • application/json; charset=utf-8: Note
PropertyDescription
noteIdEntityId
titlestring
Title of the note. Returned as "[protected]" for protected notes, since ETAPI cannot open a protected session.
typestring
One of text, code, render, file, image, search, relationMap, book, noteMap, mermaid, webView, shortcut, doc, contentWidget, launcher.
mimestring
isProtectedboolean
blobIdstring
ID of the blob object which effectively serves as a content hash
attributesAttributeList
parentNoteIdsEntityIdList
childNoteIdsEntityIdList
parentBranchIdsEntityIdList
childBranchIdsEntityIdList
dateCreatedLocalDateTime
dateModifiedLocalDateTime
utcDateCreatedUtcDateTime
utcDateModifiedUtcDateTime
Writable through PATCH, e.g. to restore a migrated note's date after its content was rewritten. The local dateModified is derived from it.
{
    "noteId": "evnnmvHTCgIn",
    "title": "string",
    "type": "text",
    "mime": "string",
    "isProtected": true,
    "blobId": "string",
    "attributes": [
        {
            "attributeId": "evnnmvHTCgIn",
            "noteId": "evnnmvHTCgIn",
            "type": "label",
            "name": "shareCss",
            "value": "string",
            "position": 0,
            "isInheritable": true,
            "utcDateModified": "2021-12-31 19:18:11.930Z"
        }
    ],
    "parentNoteIds": [
        "evnnmvHTCgIn"
    ],
    "childNoteIds": [
        "evnnmvHTCgIn"
    ],
    "parentBranchIds": [
        "evnnmvHTCgIn"
    ],
    "childBranchIds": [
        "evnnmvHTCgIn"
    ],
    "dateCreated": "2021-12-31 20:18:11.930+0100",
    "dateModified": "2021-12-31 20:18:11.930+0100",
    "utcDateCreated": "2021-12-31 19:18:11.930Z",
    "utcDateModified": "2021-12-31 19:18:11.930Z"
}

default: unexpected error

  • application/json; charset=utf-8: Error
PropertyDescription
status
required
integer (int32)
HTTP status, identical to the one given in HTTP response
code
required
string
stable string constant
message
required
string
Human readable error, potentially with more details,
{
    "status": 400,
    "code": "NOTE_IS_PROTECTED",
    "message": "Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI"
}

Get a year note

GET /calendar/years/{year} · getYearNote

Returns a year note for a given year (format YYYY, e.g., 2022). The note is created if it doesn't exist.

Authorization: EtapiTokenAuth or EtapiBasicAuth

Path parameters

NameDescription
year
required
string
Matches ^[0-9]{4}$.

Responses

200: year note

  • application/json; charset=utf-8: Note
PropertyDescription
noteIdEntityId
titlestring
Title of the note. Returned as "[protected]" for protected notes, since ETAPI cannot open a protected session.
typestring
One of text, code, render, file, image, search, relationMap, book, noteMap, mermaid, webView, shortcut, doc, contentWidget, launcher.
mimestring
isProtectedboolean
blobIdstring
ID of the blob object which effectively serves as a content hash
attributesAttributeList
parentNoteIdsEntityIdList
childNoteIdsEntityIdList
parentBranchIdsEntityIdList
childBranchIdsEntityIdList
dateCreatedLocalDateTime
dateModifiedLocalDateTime
utcDateCreatedUtcDateTime
utcDateModifiedUtcDateTime
Writable through PATCH, e.g. to restore a migrated note's date after its content was rewritten. The local dateModified is derived from it.
{
    "noteId": "evnnmvHTCgIn",
    "title": "string",
    "type": "text",
    "mime": "string",
    "isProtected": true,
    "blobId": "string",
    "attributes": [
        {
            "attributeId": "evnnmvHTCgIn",
            "noteId": "evnnmvHTCgIn",
            "type": "label",
            "name": "shareCss",
            "value": "string",
            "position": 0,
            "isInheritable": true,
            "utcDateModified": "2021-12-31 19:18:11.930Z"
        }
    ],
    "parentNoteIds": [
        "evnnmvHTCgIn"
    ],
    "childNoteIds": [
        "evnnmvHTCgIn"
    ],
    "parentBranchIds": [
        "evnnmvHTCgIn"
    ],
    "childBranchIds": [
        "evnnmvHTCgIn"
    ],
    "dateCreated": "2021-12-31 20:18:11.930+0100",
    "dateModified": "2021-12-31 20:18:11.930+0100",
    "utcDateCreated": "2021-12-31 19:18:11.930Z",
    "utcDateModified": "2021-12-31 19:18:11.930Z"
}

default: unexpected error

  • application/json; charset=utf-8: Error
PropertyDescription
status
required
integer (int32)
HTTP status, identical to the one given in HTTP response
code
required
string
stable string constant
message
required
string
Human readable error, potentially with more details,
{
    "status": 400,
    "code": "NOTE_IS_PROTECTED",
    "message": "Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI"
}

Tokens

Obtaining and revoking ETAPI tokens with the password.

Log in

POST /auth/login · login

get an ETAPI token based on password for further use with ETAPI. Too many requests from one IP address within a short time, such as failed logins, block that address for a while.

Authorization: none

Request body (required)

  • application/json: object
PropertyDescription
passwordstring
user's password used to e.g. login to Trilium server and/or protect notes
totpTokenstring
the current TOTP code, or one of the recovery codes; required when multi-factor authentication with TOTP is enabled. Each code is accepted once.
tokenNamestring
name of the created token, shown in the list of ETAPI tokens
{
    "password": "string",
    "totpToken": "string",
    "tokenName": "string"
}

Responses

201: auth token

  • application/json; charset=utf-8: object
PropertyDescription
authTokenstring
{
    "authToken": "Bc4bFn0Ffiok_4NpbVCDnFz7B2WU+pdhW8B5Ne3DiR5wXrEyqdjgRIsk="
}

401: wrong credentials: WRONG_PASSWORD, TOTP_REQUIRED (TOTP is enabled and no totpToken was sent) or WRONG_TOTP

  • application/json; charset=utf-8: Error
PropertyDescription
status
required
integer (int32)
HTTP status, identical to the one given in HTTP response
code
required
string
stable string constant
message
required
string
Human readable error, potentially with more details,
{
    "status": 400,
    "code": "NOTE_IS_PROTECTED",
    "message": "Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI"
}

429: too many requests

No content.

default: unexpected error

  • application/json; charset=utf-8: Error
PropertyDescription
status
required
integer (int32)
HTTP status, identical to the one given in HTTP response
code
required
string
stable string constant
message
required
string
Human readable error, potentially with more details,
{
    "status": 400,
    "code": "NOTE_IS_PROTECTED",
    "message": "Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI"
}

Log out

POST /auth/logout · logout

logout (delete/deactivate) an ETAPI token

Authorization: EtapiTokenAuth or EtapiBasicAuth

Responses

204: logout successful

No content.

default: unexpected error

  • application/json; charset=utf-8: Error
PropertyDescription
status
required
integer (int32)
HTTP status, identical to the one given in HTTP response
code
required
string
stable string constant
message
required
string
Human readable error, potentially with more details,
{
    "status": 400,
    "code": "NOTE_IS_PROTECTED",
    "message": "Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI"
}

Application

Information about the instance, backups and metrics.

Get application info

GET /app-info · getAppInfo

returns information about the running Trilium instance

Authorization: EtapiTokenAuth or EtapiBasicAuth

Responses

200: app info

  • application/json; charset=utf-8: AppInfo
PropertyDescription
appVersionstring
Trilium version
dbVersioninteger (int32)
DB version
syncVersioninteger (int32)
Sync protocol version
buildDatestring (date-time)
build date
buildRevisionstring
git build revision
dataDirectorystring
data directory where Trilium stores files
clipperProtocolVersionstring
version of the supported Trilium Web Clipper protocol
utcDateTimestring
current UTC date time
{
    "appVersion": "0.50.2",
    "dbVersion": 194,
    "syncVersion": 25,
    "buildDate": "2022-02-09T22:52:36+01:00",
    "buildRevision": "23daaa2387a0655685377f0a541d154aeec2aae8",
    "dataDirectory": "/home/user/data",
    "clipperProtocolVersion": 1.1,
    "utcDateTime": "2022-03-07T21:54:25.277Z"
}

default: unexpected error

  • application/json; charset=utf-8: Error
PropertyDescription
status
required
integer (int32)
HTTP status, identical to the one given in HTTP response
code
required
string
stable string constant
message
required
string
Human readable error, potentially with more details,
{
    "status": 400,
    "code": "NOTE_IS_PROTECTED",
    "message": "Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI"
}

Create a backup

PUT /backup/{backupName} · createBackup

Create a database backup under a given name

Authorization: EtapiTokenAuth or EtapiBasicAuth

Path parameters

NameDescription
backupName
required
StringId
If the backupName is e.g. "now", then the backup will be written to "backup-now.db" file

Responses

204: backup has been created

No content.

default: unexpected error

  • application/json; charset=utf-8: Error
PropertyDescription
status
required
integer (int32)
HTTP status, identical to the one given in HTTP response
code
required
string
stable string constant
message
required
string
Human readable error, potentially with more details,
{
    "status": 400,
    "code": "NOTE_IS_PROTECTED",
    "message": "Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI"
}

Get instance metrics

GET /metrics · getMetrics

Returns instance and database metrics for monitoring: note, attachment, revision, branch, attribute and blob counts, note and attachment type breakdowns, version information and database size. Counts only — no note titles, content or attributes.

The same data is served by GET /api/metrics to the web session.

Authorization: EtapiTokenAuth or EtapiBasicAuth

Query parameters

NameDescription
formatstring
Response format. Defaults to Prometheus text. One of prometheus, json.

Responses

200: instance metrics

text/plain: string

# HELP trilium_info Trilium instance information
# TYPE trilium_info gauge
trilium_info{version="0.99.3",db_version="231"} 1 1701432000

# HELP trilium_notes_total Total number of notes including deleted
# TYPE trilium_notes_total gauge
trilium_notes_total 1234 1701432000

application/json: Metrics

PropertyDescription
versionobject
version.appstring
version.dbinteger
version.nodestring
version.syncinteger
version.buildDatestring
version.buildRevisionstring
databaseobject
database.totalNotesinteger
database.deletedNotesinteger
database.activeNotesinteger
database.protectedNotesinteger
database.totalAttachmentsinteger
database.deletedAttachmentsinteger
database.activeAttachmentsinteger
database.totalRevisionsinteger
database.totalBranchesinteger
database.totalAttributesinteger
database.totalBlobsinteger
database.totalEtapiTokensinteger
database.totalRecentNotesinteger
noteTypesobject
Number of active notes per note type
attachmentTypesobject
Number of active attachments per MIME type
statisticsobject
statistics.oldestNotestring | null
statistics.newestNotestring | null
statistics.lastModifiedstring | null
statistics.databaseSizeBytesinteger | null
timestampstring
{
    "version": {
        "app": "0.99.3",
        "db": 231,
        "node": "v22.14.0",
        "sync": 35,
        "buildDate": "2024-09-07T18:36:34Z",
        "buildRevision": "7c0d6930fa8f20d269dcfbcbc8f636a25f6bb9a7"
    },
    "database": {
        "totalNotes": 0,
        "deletedNotes": 0,
        "activeNotes": 0,
        "protectedNotes": 0,
        "totalAttachments": 0,
        "deletedAttachments": 0,
        "activeAttachments": 0,
        "totalRevisions": 0,
        "totalBranches": 0,
        "totalAttributes": 0,
        "totalBlobs": 0,
        "totalEtapiTokens": 0,
        "totalRecentNotes": 0
    },
    "noteTypes": {
        "text": 800,
        "code": 200
    },
    "attachmentTypes": {
        "image/png": 45,
        "application/pdf": 14
    },
    "statistics": {
        "oldestNote": "string",
        "newestNote": "string",
        "lastModified": "string",
        "databaseSizeBytes": 0
    },
    "timestamp": "2024-12-01T12:00:00.000Z"
}

default: unexpected error

  • application/json; charset=utf-8: Error
PropertyDescription
status
required
integer (int32)
HTTP status, identical to the one given in HTTP response
code
required
string
stable string constant
message
required
string
Human readable error, potentially with more details,
{
    "status": 400,
    "code": "NOTE_IS_PROTECTED",
    "message": "Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI"
}

Schemas

CreateNoteDef

PropertyDescription
parentNoteId
required
EntityId
Note ID of the parent note in the tree
title
required
string
type
required
string
One of text, code, file, image, search, book, relationMap, render.
mimestring
this needs to be specified only for note types 'code', 'file', 'image'.
content
required
string
notePositioninteger
Position of the note in the parent. Normal ordering is 10, 20, 30 ... So if you want to create a note on the first position, use e.g. 5, for second position 15, for last e.g. 1000000
prefixstring
Prefix is branch (placement) specific title prefix for the note. Let's say you have your note placed into two different places in the tree, but you want to change the title a bit in one of the placements. For this you can use prefix.
isExpandedboolean
true if this note (as a folder) should appear expanded
noteIdEntityId
DON'T specify unless you want to force a specific noteId. It must not belong to an existing note.
branchIdEntityId
DON'T specify unless you want to force a specific branchId
dateCreatedLocalDateTime
Local timestap of the note creation. Specify only if you want to override the default (current datetime in the current timezone/offset).
utcDateCreatedUtcDateTime
UTC timestap of the note creation. Specify only if you want to override the default (current datetime).
utcDateModifiedUtcDateTime
UTC timestamp of the note's last modification, e.g. to keep the date of a note being migrated from another application. The local dateModified is derived from it. Specify only if you want to override the default (current datetime).

Note

PropertyDescription
noteIdEntityId
titlestring
Title of the note. Returned as "[protected]" for protected notes, since ETAPI cannot open a protected session.
typestring
One of text, code, render, file, image, search, relationMap, book, noteMap, mermaid, webView, shortcut, doc, contentWidget, launcher.
mimestring
isProtectedboolean
blobIdstring
ID of the blob object which effectively serves as a content hash
attributesAttributeList
parentNoteIdsEntityIdList
childNoteIdsEntityIdList
parentBranchIdsEntityIdList
childBranchIdsEntityIdList
dateCreatedLocalDateTime
dateModifiedLocalDateTime
utcDateCreatedUtcDateTime
utcDateModifiedUtcDateTime
Writable through PATCH, e.g. to restore a migrated note's date after its content was rewritten. The local dateModified is derived from it.

Branch

Branch places the note into the tree, it represents the relationship between a parent note and child note

PropertyDescription
branchIdEntityId
noteIdEntityId
identifies the child note
parentNoteIdEntityId
identifies the parent note
prefixstring
notePositioninteger (int32)
isExpandedboolean
utcDateModifiedUtcDateTime

NoteWithBranch

PropertyDescription
noteNote
branchBranch
Branch places the note into the tree, it represents the relationship between a parent note and child note

Attachment

Attachment is owned by a note, has title and content

PropertyDescription
attachmentIdEntityId
ownerIdEntityId
identifies the owner of the attachment, is either noteId or revisionId
rolestring
mimestring
titlestring
Title of the attachment. Returned as "[protected]" for protected attachments, since ETAPI cannot open a protected session.
positioninteger (int32)
blobIdstring
ID of the blob object which effectively serves as a content hash
dateModifiedLocalDateTime
utcDateModifiedUtcDateTime
utcDateScheduledForErasureSinceUtcDateTime
contentLengthinteger (int32)

CreateAttachment

PropertyDescription
ownerIdEntityId
identifies the owner of the attachment, is either noteId or revisionId
rolestring
mimestring
titlestring
contentstring
Text content of the attachment, stored as-is. To store binary content, create the attachment without it, then upload the data with PUT /attachments/{attachmentId}/content.
positioninteger (int32)

Attribute

Attribute (Label, Relation) is a key-value record attached to a note.

PropertyDescription
attributeIdEntityId
noteIdEntityId
identifies the child note
typestring
One of label, relation.
namestring
Matches ^[^\s]+.
valuestring
positioninteger (int32)
isInheritableboolean
utcDateModifiedUtcDateTime

AttributeList

Type: array of Attribute

SearchResponse

PropertyDescription
results
required
array of Note
debugInfoobject
debugging info on parsing the search query enabled with &debug=true parameter

EntityId

Type: string

Matches [a-zA-Z0-9_]{4,32}.

Example: evnnmvHTCgIn

StringId

Type: string

Matches [a-zA-Z0-9_]{1,32}.

Example: my_ID

EntityIdList

Type: array of EntityId

LocalDateTime

Type: string

Matches [0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}\.[0-9]{3}[\+\-][0-9]{4}.

Example: 2021-12-31 20:18:11.930+0100

UtcDateTime

Type: string

Matches [0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}\.[0-9]{3}Z.

Example: 2021-12-31 19:18:11.930Z

AppInfo

PropertyDescription
appVersionstring
Trilium version
dbVersioninteger (int32)
DB version
syncVersioninteger (int32)
Sync protocol version
buildDatestring (date-time)
build date
buildRevisionstring
git build revision
dataDirectorystring
data directory where Trilium stores files
clipperProtocolVersionstring
version of the supported Trilium Web Clipper protocol
utcDateTimestring
current UTC date time

Error

PropertyDescription
status
required
integer (int32)
HTTP status, identical to the one given in HTTP response
code
required
string
stable string constant
message
required
string
Human readable error, potentially with more details,

Revision

Revision represents a snapshot of note's title and content at some point in the past.

PropertyDescription
revisionIdEntityId
noteIdEntityId
typestring
One of text, code, render, file, image, search, relationMap, book, noteMap, mermaid, webView, shortcut, doc, contentWidget, launcher.
mimestring
isProtectedboolean
titlestring
blobIdstring
ID of the blob object which effectively serves as a content hash
dateLastEditedLocalDateTime
dateCreatedLocalDateTime
utcDateLastEditedUtcDateTime
utcDateCreatedUtcDateTime
utcDateModifiedUtcDateTime
contentLengthinteger (int32)

RecentChange

Represents a recent change event (creation, modification, or deletion).

PropertyDescription
noteIdEntityId
titlestring
Title at the time of the change (may be "[protected]" for protected notes)
current_titlestring
Current title of the note (may be "[protected]" for protected notes)
current_isDeletedboolean
Whether the note is currently deleted
current_deleteIdstring
Delete ID if the note is deleted
current_isProtectedboolean
Whether the note is protected
utcDateUtcDateTime
UTC timestamp of the change
dateLocalDateTime
Local timestamp of the change
canBeUndeletedboolean
Whether the note can be undeleted (only present for deleted notes)

Metrics

Instance and database metrics, as served by GET /etapi/metrics?format=json

PropertyDescription
versionobject
version.appstring
version.dbinteger
version.nodestring
version.syncinteger
version.buildDatestring
version.buildRevisionstring
databaseobject
database.totalNotesinteger
database.deletedNotesinteger
database.activeNotesinteger
database.protectedNotesinteger
database.totalAttachmentsinteger
database.deletedAttachmentsinteger
database.activeAttachmentsinteger
database.totalRevisionsinteger
database.totalBranchesinteger
database.totalAttributesinteger
database.totalBlobsinteger
database.totalEtapiTokensinteger
database.totalRecentNotesinteger
noteTypesobject
Number of active notes per note type
attachmentTypesobject
Number of active attachments per MIME type
statisticsobject
statistics.oldestNotestring | null
statistics.newestNotestring | null
statistics.lastModifiedstring | null
statistics.databaseSizeBytesinteger | null
timestampstring