The server registers 7 tools. Every response is a JSON text with success: true. On an error the server returns isError: true and a JSON text of the form {"success": false, "error": "...", "tool": "..."}.
| Tool | Purpose | Annotation |
|---|---|---|
wikijs_create_page |
Create a page | writing, not destructive |
wikijs_get_page |
Read a page by ID or path | read-only |
wikijs_list_pages |
List pages | read-only |
wikijs_search_pages |
Full-text search | read-only |
wikijs_update_page |
Change a page | writing, not destructive |
wikijs_delete_page |
Delete a page permanently | destructive |
wikijs_move_page |
Move a page | writing, not destructive |
| Parameter | Rule |
|---|---|
path |
1 to 500 characters, only letters (a-z, A-Z), digits, -, _ and /. Must start and end with a letter or digit, .. and // are forbidden. No leading slash, no dots, no umlauts. |
locale |
Two lowercase letters, optionally with a region, e.g. de, en, en-US. Default en. |
id |
positive integer |
| Page selection | For get, update, delete and move, id or path is enough. If both are missing you get the error Either "id" or "path" must be provided. If both are given, id wins and locale is ignored. |
localedefaults toeneverywhere. To address (or create) a German page bypath, you have to passlocale: "de".
Creates a new page. If a page already exists at the path, the call fails.
| Parameter | Type | Required | Default | Note |
|---|---|---|---|---|
path |
string | yes | see Common rules | |
title |
string | yes | 1 to 200 characters | |
content |
string | yes | 1 to 500,000 characters | |
description |
string | yes | 1 to 500 characters | |
locale |
string | no | en |
|
editor |
string | no | markdown |
markdown, code (raw HTML) or ckeditor |
isPublished |
boolean | no | true |
|
isPrivate |
boolean | no | false |
|
tags |
string[] | no | [] |
max. 50 tags, each 1 to 100 characters |
Returns: message (Page created successfully at /<path>) and page with id, path and title.
Reads a page. The result contains id, path, title, description, content, contentType, isPublished, locale, createdAt and updatedAt.
| Parameter | Type | Required | Default |
|---|---|---|---|
id |
number | one of id/path |
|
path |
string | one of id/path |
|
locale |
string | no | en |
This tool does not return tags because the server does not request them in its query. Tags are part of the
wikijs_list_pagesresponse.
Content over 100,000 characters is truncated on read and ends with a notice
[Content truncated. Original length: ... chars...].
Lists pages with id, path, title, description, locale, isPublished, tags and updatedAt (no content).
| Parameter | Type | Required | Default | Note |
|---|---|---|---|---|
locale |
string | no | all | filter |
limit |
number | no | 50 |
1 to 200 |
offset |
number | no | 0 |
The response contains pagination with limit, offset, total_count, has_more and, if more pages follow, next_offset.
On every call the server loads the complete page list from Wiki.js and only then filters and slices it.
total_countis the number of all pages of the instance before the locale filter. Withlocale,has_morecan therefore staytruealthough no further pages of that language follow. In that case keep paging until a call returns an empty or shorter list.
Wiki.js full-text search.
| Parameter | Type | Required | Note |
|---|---|---|---|
query |
string | yes | 2 to 200 characters |
locale |
string | no | filter, applied after the search |
Returns: totalHits, suggestions and results (each id, title, path, description, locale). With locale, totalHits is the number of filtered hits.
Changes an existing page.
| Parameter | Type | Required | Note |
|---|---|---|---|
id / path |
number / string | one of them | |
locale |
string | no | default en; only relevant with path |
content |
string | no | new content, 1 to 500,000 characters |
title |
string | no | max. 200 characters |
description |
string | no | max. 500 characters |
isPublished |
boolean | no | |
tags |
string[] | no | replaces the tags completely |
Returns: message (Page <id> updated successfully) and result (succeeded, errorCode, message from Wiki.js).
What the server does behind the scenes:
content replaces the entire page body. There is no append and no patching of single sections.content, title or description is missing, the server loads the current page and sends its existing value along. Metadata-only changes therefore work without resending the content.tags is missing, the server reads the page's tags from the page list and sends them unchanged. An empty list [] removes all tags.isPublished is missing, the server sends no value (null). Pass isPublished explicitly on every update if the page is to stay published. What happens with a missing value is up to Wiki.js, and in practice pages updated without it can end up as drafts.For pages longer than 100,000 characters do not omit
content. Otherwise the server takes the text truncated on read, including the truncation notice, as the new content and overwrites the page with it.
Deletes a page permanently. There is no confirmation prompt and no undo in the server.
| Parameter | Type | Required | Default |
|---|---|---|---|
id / path |
number / string | one of them | |
locale |
string | no | en |
Returns: message (Page <id> deleted permanently) and result.
Moves a page to a new path and/or another language.
| Parameter | Type | Required | Default | Note |
|---|---|---|---|---|
id / path |
number / string | one of them | ||
locale |
string | no | en |
current language, only relevant with path |
destinationPath |
string | yes | same rules as path |
|
destinationLocale |
string | no | en |
target language |
Returns: message, from, to, destinationLocale and result. After the move the page URL changes; you have to fix links to the old path yourself.
destinationLocaledefaults toen. Moving a German page without this parameter puts it into the English locale.