ETAPI (1.0.0)

Download OpenAPI specification:

External Trilium API

createNote

Create a note and place it into the note tree

Authorizations:
EtapiTokenAuthEtapiBasicAuth
Request Body schema: application/json
required
parentNoteId
required
string (EntityId) [a-zA-Z0-9_]{4,32}
title
required
string
type
required
string
Enum: "text" "code" "file" "image" "search" "book" "relationMap" "render"
mime
string

this needs to be specified only for note types 'code', 'file', 'image'.

content
required
string
notePosition
integer

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

prefix
string

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.

isExpanded
boolean

true if this note (as a folder) should appear expanded

noteId
string (EntityId) [a-zA-Z0-9_]{4,32}
branchId
string (EntityId) [a-zA-Z0-9_]{4,32}
dateCreated
string (LocalDateTime) [0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:...
utcDateCreated
string (UtcDateTime) [0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:...

Responses

Request samples

Content type
application/json
{
  • "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"
}

Response samples

Content type
application/json; charset=utf-8
{
  • "note": {
    },
  • "branch": {
    }
}

searchNotes

Search notes

Authorizations:
EtapiTokenAuthEtapiBasicAuth
query Parameters
search
required
string
Examples:
  • search=towers tolkien - Fulltext search for keywords (not exact match)
  • search="Two Towers" - Fulltext search for exact match (notice the double quotes)
  • search=towers #book - Fulltext search for keyword AND matching label

search query string as described in https://triliumnext.github.io/Docs/Wiki/search.html

fastSearch
boolean
Default: false

enable fast search (fulltext doesn't look into content)

includeArchivedNotes
boolean
Default: false

search by default ignores archived notes. Set to 'true' to includes archived notes into search results.

ancestorNoteId
string (EntityId) [a-zA-Z0-9_]{4,32}
Example: ancestorNoteId=evnnmvHTCgIn

search only in a subtree identified by the subtree noteId. By default whole tree is searched.

ancestorDepth
string
Examples:
  • ancestorDepth=eq1 - depth of exactly 1 (direct children) to the ancestor (root if not set)
  • ancestorDepth=eq3 - depth of exactly 3 to the ancestor (root if not set)
  • ancestorDepth=lt4 - depth less than 4 (so 1, 2, 3) to the ancestor (root if not set)
  • ancestorDepth=gt4 - depth greater than 2 (so 3, 4, 5, 6...) to the ancestor (root if not set)

define how deep in the tree should the notes be searched

orderBy
string
Example: orderBy=title&orderBy=#publicationDate&orderBy=isProtected&orderBy=isArchived&orderBy=dateCreated&orderBy=dateModified&orderBy=utcDateCreated&orderBy=utcDateModified&orderBy=parentCount&orderBy=childrenCount&orderBy=attributeCount&orderBy=labelCount&orderBy=ownedLabelCount&orderBy=relationCount&orderBy=ownedRelationCount&orderBy=relationCountIncludingLinks&orderBy=ownedRelationCountIncludingLinks&orderBy=targetRelationCount&orderBy=targetRelationCountIncludingLinks&orderBy=contentSize&orderBy=contentAndAttachmentsSize&orderBy=contentAndAttachmentsAndRevisionsSize&orderBy=revisionCount

name of the property/label to order search results by

orderDirection
string
Default: "asc"
Enum: "asc" "desc"

order direction, ascending or descending

limit
integer
Example: limit=10

limit the number of results you want to receive

debug
boolean
Default: false

set to true to get debug information in the response (search query parsing)

Responses

Response samples

Content type
application/json; charset=utf-8
{
  • "results": [
    ],
  • "debugInfo": { }
}

getNoteById

Returns a note identified by its ID

Authorizations:
EtapiTokenAuthEtapiBasicAuth
path Parameters
noteId
required
string (EntityId) [a-zA-Z0-9_]{4,32}
Example: evnnmvHTCgIn

Responses

Response samples

Content type
application/json; charset=utf-8
{
  • "noteId": "evnnmvHTCgIn",
  • "title": "string",
  • "type": "text",
  • "mime": "string",
  • "isProtected": true,
  • "blobId": "string",
  • "attributes": [
    ],
  • "parentNoteIds": [
    ],
  • "childNoteIds": [
    ],
  • "parentBranchIds": [
    ],
  • "childBranchIds": [
    ],
  • "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"
}

patchNoteById

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

Authorizations:
EtapiTokenAuthEtapiBasicAuth
path Parameters
noteId
required
string (EntityId) [a-zA-Z0-9_]{4,32}
Example: evnnmvHTCgIn
Request Body schema: application/json
required
noteId
string (EntityId) [a-zA-Z0-9_]{4,32}
title
string
type
string
Enum: "text" "code" "render" "file" "image" "search" "relationMap" "book" "noteMap" "mermaid" "webView" "shortcut" "doc" "contentWidget" "launcher"
mime
string
blobId
string

ID of the blob object which effectively serves as a content hash

Array of objects (AttributeList)
parentNoteIds
Array of strings (EntityIdList) [ items[a-zA-Z0-9_]{4,32} ]
childNoteIds
Array of strings (EntityIdList) [ items[a-zA-Z0-9_]{4,32} ]
parentBranchIds
Array of strings (EntityIdList) [ items[a-zA-Z0-9_]{4,32} ]
childBranchIds
Array of strings (EntityIdList) [ items[a-zA-Z0-9_]{4,32} ]
dateCreated
string (LocalDateTime) [0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:...
dateModified
string (LocalDateTime) [0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:...
utcDateCreated
string (UtcDateTime) [0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:...
utcDateModified
string (UtcDateTime) [0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:...

Responses

Request samples

Content type
application/json
{
  • "noteId": "evnnmvHTCgIn",
  • "title": "string",
  • "type": "text",
  • "mime": "string",
  • "blobId": "string",
  • "attributes": [
    ],
  • "parentNoteIds": [
    ],
  • "childNoteIds": [
    ],
  • "parentBranchIds": [
    ],
  • "childBranchIds": [
    ],
  • "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"
}

Response samples

Content type
application/json; charset=utf-8
{
  • "noteId": "evnnmvHTCgIn",
  • "title": "string",
  • "type": "text",
  • "mime": "string",
  • "isProtected": true,
  • "blobId": "string",
  • "attributes": [
    ],
  • "parentNoteIds": [
    ],
  • "childNoteIds": [
    ],
  • "parentBranchIds": [
    ],
  • "childBranchIds": [
    ],
  • "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"
}

deleteNoteById

deletes a single note based on the noteId supplied

Authorizations:
EtapiTokenAuthEtapiBasicAuth
path Parameters
noteId
required
string (EntityId) [a-zA-Z0-9_]{4,32}
Example: evnnmvHTCgIn

Responses

Response samples

Content type
application/json; charset=utf-8
{
  • "status": 400,
  • "code": "NOTE_IS_PROTECTED",
  • "message": "Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI"
}

getNoteContent

Returns note content identified by its ID

Authorizations:
EtapiTokenAuthEtapiBasicAuth
path Parameters
noteId
required
string (EntityId) [a-zA-Z0-9_]{4,32}
Example: evnnmvHTCgIn

Responses

putNoteContentById

Updates note content identified by its ID

Authorizations:
EtapiTokenAuthEtapiBasicAuth
path Parameters
noteId
required
string (EntityId) [a-zA-Z0-9_]{4,32}
Example: evnnmvHTCgIn
Request Body schema: text/plain
required

html content of note

string

Responses

exportNoteSubtree

Exports ZIP file export of a given note subtree. To export whole document, use "root" for noteId

Authorizations:
EtapiTokenAuthEtapiBasicAuth
path Parameters
noteId
required
string (EntityId) [a-zA-Z0-9_]{4,32}
Example: evnnmvHTCgIn
query Parameters
format
any
Default: "html"
Enum: "html" "markdown"

Responses

Response samples

Content type
application/json; charset=utf-8
{
  • "status": 400,
  • "code": "NOTE_IS_PROTECTED",
  • "message": "Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI"
}

importZip

Imports ZIP file into a given note.

Authorizations:
EtapiTokenAuthEtapiBasicAuth
path Parameters
noteId
required
string (EntityId) [a-zA-Z0-9_]{4,32}
Example: evnnmvHTCgIn

Responses

Response samples

Content type
application/json; charset=utf-8
{
  • "note": {
    },
  • "branch": {
    }
}

createRevision

Create a note revision for the given note

Authorizations:
EtapiTokenAuthEtapiBasicAuth
path Parameters
noteId
required
string (EntityId) [a-zA-Z0-9_]{4,32}
Example: evnnmvHTCgIn
query Parameters
format
any
Default: "html"
Enum: "html" "markdown"

Responses

Response samples

Content type
application/json; charset=utf-8
{
  • "status": 400,
  • "code": "NOTE_IS_PROTECTED",
  • "message": "Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI"
}

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.

Authorizations:
EtapiTokenAuthEtapiBasicAuth
Request Body schema: application/json
required
branchId
string (EntityId) [a-zA-Z0-9_]{4,32}
noteId
string (EntityId) [a-zA-Z0-9_]{4,32}
parentNoteId
string (EntityId) [a-zA-Z0-9_]{4,32}
prefix
string
notePosition
integer <int32>
isExpanded
boolean
utcDateModified
string (UtcDateTime) [0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:...

Responses

Request samples

Content type
application/json
{
  • "branchId": "evnnmvHTCgIn",
  • "noteId": "evnnmvHTCgIn",
  • "parentNoteId": "evnnmvHTCgIn",
  • "prefix": "string",
  • "notePosition": 0,
  • "isExpanded": true,
  • "utcDateModified": "2021-12-31 19:18:11.930Z"
}

Response samples

Content type
application/json; charset=utf-8
{
  • "branchId": "evnnmvHTCgIn",
  • "noteId": "evnnmvHTCgIn",
  • "parentNoteId": "evnnmvHTCgIn",
  • "prefix": "string",
  • "notePosition": 0,
  • "isExpanded": true,
  • "utcDateModified": "2021-12-31 19:18:11.930Z"
}

getBranchById

Returns a branch identified by its ID

Authorizations:
EtapiTokenAuthEtapiBasicAuth
path Parameters
branchId
required
string (EntityId) [a-zA-Z0-9_]{4,32}
Example: evnnmvHTCgIn

Responses

Response samples

Content type
application/json; charset=utf-8
{
  • "branchId": "evnnmvHTCgIn",
  • "noteId": "evnnmvHTCgIn",
  • "parentNoteId": "evnnmvHTCgIn",
  • "prefix": "string",
  • "notePosition": 0,
  • "isExpanded": true,
  • "utcDateModified": "2021-12-31 19:18:11.930Z"
}

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.

Authorizations:
EtapiTokenAuthEtapiBasicAuth
path Parameters
branchId
required
string (EntityId) [a-zA-Z0-9_]{4,32}
Example: evnnmvHTCgIn
Request Body schema: application/json
required
branchId
string (EntityId) [a-zA-Z0-9_]{4,32}
noteId
string (EntityId) [a-zA-Z0-9_]{4,32}
parentNoteId
string (EntityId) [a-zA-Z0-9_]{4,32}
prefix
string
notePosition
integer <int32>
isExpanded
boolean
utcDateModified
string (UtcDateTime) [0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:...

Responses

Request samples

Content type
application/json
{
  • "branchId": "evnnmvHTCgIn",
  • "noteId": "evnnmvHTCgIn",
  • "parentNoteId": "evnnmvHTCgIn",
  • "prefix": "string",
  • "notePosition": 0,
  • "isExpanded": true,
  • "utcDateModified": "2021-12-31 19:18:11.930Z"
}

Response samples

Content type
application/json; charset=utf-8
{
  • "branchId": "evnnmvHTCgIn",
  • "noteId": "evnnmvHTCgIn",
  • "parentNoteId": "evnnmvHTCgIn",
  • "prefix": "string",
  • "notePosition": 0,
  • "isExpanded": true,
  • "utcDateModified": "2021-12-31 19:18:11.930Z"
}

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.

Authorizations:
EtapiTokenAuthEtapiBasicAuth
path Parameters
branchId
required
string (EntityId) [a-zA-Z0-9_]{4,32}
Example: evnnmvHTCgIn

Responses

Response samples

Content type
application/json; charset=utf-8
{
  • "status": 400,
  • "code": "NOTE_IS_PROTECTED",
  • "message": "Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI"
}

postAttachment

create an attachment

Authorizations:
EtapiTokenAuthEtapiBasicAuth
Request Body schema: application/json
required
ownerId
string (EntityId) [a-zA-Z0-9_]{4,32}
role
string
mime
string
title
string
content
string
position
integer <int32>

Responses

Request samples

Content type
application/json
{
  • "ownerId": "evnnmvHTCgIn",
  • "role": "string",
  • "mime": "string",
  • "title": "string",
  • "content": "string",
  • "position": 0
}

Response samples

Content type
application/json; charset=utf-8
{
  • "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
}

getAttachmentById

Returns an attachment identified by its ID

Authorizations:
EtapiTokenAuthEtapiBasicAuth
path Parameters
attachmentId
required
string (EntityId) [a-zA-Z0-9_]{4,32}
Example: evnnmvHTCgIn

Responses

Response samples

Content type
application/json; charset=utf-8
{
  • "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
}

patchAttachmentById

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

Authorizations:
EtapiTokenAuthEtapiBasicAuth
path Parameters
attachmentId
required
string (EntityId) [a-zA-Z0-9_]{4,32}
Example: evnnmvHTCgIn
Request Body schema: application/json
required
attachmentId
string (EntityId) [a-zA-Z0-9_]{4,32}
ownerId
string (EntityId) [a-zA-Z0-9_]{4,32}
role
string
mime
string
title
string
position
integer <int32>
blobId
string

ID of the blob object which effectively serves as a content hash

dateModified
string (LocalDateTime) [0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:...
utcDateModified
string (UtcDateTime) [0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:...
utcDateScheduledForErasureSince
string (UtcDateTime) [0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:...
contentLength
integer <int32>

Responses

Request samples

Content type
application/json
{
  • "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
}

Response samples

Content type
application/json; charset=utf-8
{
  • "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
}

deleteAttachmentById

deletes an attachment based on the attachmentId supplied.

Authorizations:
EtapiTokenAuthEtapiBasicAuth
path Parameters
attachmentId
required
string (EntityId) [a-zA-Z0-9_]{4,32}
Example: evnnmvHTCgIn

Responses

Response samples

Content type
application/json; charset=utf-8
{
  • "status": 400,
  • "code": "NOTE_IS_PROTECTED",
  • "message": "Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI"
}

getAttachmentContent

Returns attachment content identified by its ID

Authorizations:
EtapiTokenAuthEtapiBasicAuth
path Parameters
attachmentId
required
string (EntityId) [a-zA-Z0-9_]{4,32}
Example: evnnmvHTCgIn

Responses

putAttachmentContentById

Updates attachment content identified by its ID

Authorizations:
EtapiTokenAuthEtapiBasicAuth
path Parameters
attachmentId
required
string (EntityId) [a-zA-Z0-9_]{4,32}
Example: evnnmvHTCgIn
Request Body schema: text/plain
required

html content of attachment

string

Responses

postAttribute

create an attribute for a given note

Authorizations:
EtapiTokenAuthEtapiBasicAuth
Request Body schema: application/json
required
attributeId
string (EntityId) [a-zA-Z0-9_]{4,32}
noteId
string (EntityId) [a-zA-Z0-9_]{4,32}
type
string
Enum: "label" "relation"
name
string^[^\s]+
value
string
position
integer <int32>
isInheritable
boolean
utcDateModified
string (UtcDateTime) [0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:...

Responses

Request samples

Content type
application/json
{
  • "attributeId": "evnnmvHTCgIn",
  • "noteId": "evnnmvHTCgIn",
  • "type": "label",
  • "name": "shareCss",
  • "value": "string",
  • "position": 0,
  • "isInheritable": true,
  • "utcDateModified": "2021-12-31 19:18:11.930Z"
}

Response samples

Content type
application/json; charset=utf-8
{
  • "attributeId": "evnnmvHTCgIn",
  • "noteId": "evnnmvHTCgIn",
  • "type": "label",
  • "name": "shareCss",
  • "value": "string",
  • "position": 0,
  • "isInheritable": true,
  • "utcDateModified": "2021-12-31 19:18:11.930Z"
}

getAttributeById

Returns an attribute identified by its ID

Authorizations:
EtapiTokenAuthEtapiBasicAuth
path Parameters
attributeId
required
string (EntityId) [a-zA-Z0-9_]{4,32}
Example: evnnmvHTCgIn

Responses

Response samples

Content type
application/json; charset=utf-8
{
  • "attributeId": "evnnmvHTCgIn",
  • "noteId": "evnnmvHTCgIn",
  • "type": "label",
  • "name": "shareCss",
  • "value": "string",
  • "position": 0,
  • "isInheritable": true,
  • "utcDateModified": "2021-12-31 19:18:11.930Z"
}

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.

Authorizations:
EtapiTokenAuthEtapiBasicAuth
path Parameters
attributeId
required
string (EntityId) [a-zA-Z0-9_]{4,32}
Example: evnnmvHTCgIn
Request Body schema: application/json
required
attributeId
string (EntityId) [a-zA-Z0-9_]{4,32}
noteId
string (EntityId) [a-zA-Z0-9_]{4,32}
type
string
Enum: "label" "relation"
name
string^[^\s]+
value
string
position
integer <int32>
isInheritable
boolean
utcDateModified
string (UtcDateTime) [0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:...

Responses

Request samples

Content type
application/json
{
  • "attributeId": "evnnmvHTCgIn",
  • "noteId": "evnnmvHTCgIn",
  • "type": "label",
  • "name": "shareCss",
  • "value": "string",
  • "position": 0,
  • "isInheritable": true,
  • "utcDateModified": "2021-12-31 19:18:11.930Z"
}

Response samples

Content type
application/json; charset=utf-8
{
  • "attributeId": "evnnmvHTCgIn",
  • "noteId": "evnnmvHTCgIn",
  • "type": "label",
  • "name": "shareCss",
  • "value": "string",
  • "position": 0,
  • "isInheritable": true,
  • "utcDateModified": "2021-12-31 19:18:11.930Z"
}

deleteAttributeById

deletes an attribute based on the attributeId supplied.

Authorizations:
EtapiTokenAuthEtapiBasicAuth
path Parameters
attributeId
required
string (EntityId) [a-zA-Z0-9_]{4,32}
Example: evnnmvHTCgIn

Responses

Response samples

Content type
application/json; charset=utf-8
{
  • "status": 400,
  • "code": "NOTE_IS_PROTECTED",
  • "message": "Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI"
}

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.

Authorizations:
EtapiTokenAuthEtapiBasicAuth
path Parameters
parentNoteId
required
string (EntityId) [a-zA-Z0-9_]{4,32}
Example: evnnmvHTCgIn

Responses

Response samples

Content type
application/json; charset=utf-8
{
  • "status": 400,
  • "code": "NOTE_IS_PROTECTED",
  • "message": "Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI"
}

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.

Authorizations:
EtapiTokenAuthEtapiBasicAuth
path Parameters
date
required
string <date>
Example: 2022-02-22

Responses

Response samples

Content type
application/json; charset=utf-8
{
  • "noteId": "evnnmvHTCgIn",
  • "title": "string",
  • "type": "text",
  • "mime": "string",
  • "isProtected": true,
  • "blobId": "string",
  • "attributes": [
    ],
  • "parentNoteIds": [
    ],
  • "childNoteIds": [
    ],
  • "parentBranchIds": [
    ],
  • "childBranchIds": [
    ],
  • "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"
}

getDayNote

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

Authorizations:
EtapiTokenAuthEtapiBasicAuth
path Parameters
date
required
string <date>
Example: 2022-02-22

Responses

Response samples

Content type
application/json; charset=utf-8
{
  • "noteId": "evnnmvHTCgIn",
  • "title": "string",
  • "type": "text",
  • "mime": "string",
  • "isProtected": true,
  • "blobId": "string",
  • "attributes": [
    ],
  • "parentNoteIds": [
    ],
  • "childNoteIds": [
    ],
  • "parentBranchIds": [
    ],
  • "childBranchIds": [
    ],
  • "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"
}

getWeekFirstDayNote

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

Authorizations:
EtapiTokenAuthEtapiBasicAuth
path Parameters
date
required
string <date>
Example: 2022-02-22

Responses

Response samples

Content type
application/json; charset=utf-8
{
  • "noteId": "evnnmvHTCgIn",
  • "title": "string",
  • "type": "text",
  • "mime": "string",
  • "isProtected": true,
  • "blobId": "string",
  • "attributes": [
    ],
  • "parentNoteIds": [
    ],
  • "childNoteIds": [
    ],
  • "parentBranchIds": [
    ],
  • "childBranchIds": [
    ],
  • "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"
}

getMonthNote

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

Authorizations:
EtapiTokenAuthEtapiBasicAuth
path Parameters
month
required
string[0-9]{4}-[0-9]{2}
Example: 2022-02

Responses

Response samples

Content type
application/json; charset=utf-8
{
  • "noteId": "evnnmvHTCgIn",
  • "title": "string",
  • "type": "text",
  • "mime": "string",
  • "isProtected": true,
  • "blobId": "string",
  • "attributes": [
    ],
  • "parentNoteIds": [
    ],
  • "childNoteIds": [
    ],
  • "parentBranchIds": [
    ],
  • "childBranchIds": [
    ],
  • "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"
}

getYearNote

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

Authorizations:
EtapiTokenAuthEtapiBasicAuth
path Parameters
year
required
string[0-9]{4}-[0-9]{2}
Example: 2022-02

Responses

Response samples

Content type
application/json; charset=utf-8
{
  • "noteId": "evnnmvHTCgIn",
  • "title": "string",
  • "type": "text",
  • "mime": "string",
  • "isProtected": true,
  • "blobId": "string",
  • "attributes": [
    ],
  • "parentNoteIds": [
    ],
  • "childNoteIds": [
    ],
  • "parentBranchIds": [
    ],
  • "childBranchIds": [
    ],
  • "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"
}

login

get an ETAPI token based on password for further use with ETAPI

Request Body schema: application/json
required
password
string

user's password used to e.g. login to Trilium server and/or protect notes

Responses

Request samples

Content type
application/json
{
  • "password": "string"
}

Response samples

Content type
application/json; charset=utf-8
{
  • "authToken": "Bc4bFn0Ffiok_4NpbVCDnFz7B2WU+pdhW8B5Ne3DiR5wXrEyqdjgRIsk="
}

logout

logout (delete/deactivate) an ETAPI token

Authorizations:
EtapiTokenAuthEtapiBasicAuth

Responses

Response samples

Content type
application/json; charset=utf-8
{
  • "status": 400,
  • "code": "NOTE_IS_PROTECTED",
  • "message": "Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI"
}

getAppInfo

returns information about the running Trilium instance

Authorizations:
EtapiTokenAuthEtapiBasicAuth

Responses

Response samples

Content type
application/json; charset=utf-8
{
  • "appVersion": "0.50.2",
  • "dbVersion": 194,
  • "syncVersion": 25,
  • "buildDate": "2022-02-09T22:52:36+01:00",
  • "buildRevision": "23daaa2387a0655685377f0a541d154aeec2aae8",
  • "dataDirectory": "/home/user/data",
  • "clipperProtocolVersion": 1,
  • "utcDateTime": "2022-03-07T21:54:25.277Z"
}

createBackup

Create a database backup under a given name

Authorizations:
EtapiTokenAuthEtapiBasicAuth
path Parameters
backupName
required
string (StringId) [a-zA-Z0-9_]{1,32}
Example: my_ID

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

Responses

Response samples

Content type
application/json; charset=utf-8
{
  • "status": 400,
  • "code": "NOTE_IS_PROTECTED",
  • "message": "Note 'evnnmvHTCgIn' is protected and cannot be modified through ETAPI"
}