API
The REST API (/v1/) lets scripts and integrations search, read, create and edit wiki pages. Responses are JSON.
The API is disabled by default. It uses personal API tokens and the same permissions as the web interface. A token only identifies a user, it never grants additional rights, so a client can only see and do what its owner can see and do in the browser.
AI assistants can use the same tokens through the MCP endpoint, see MCP.
An administrator can enable these features under Admin > Configuration (/Admin/Config), in the Functionality group. Changes apply as soon as the configuration is saved, without restarting the wiki.
| Setting | What it does | When it is off |
| Enable API | Enables personal API tokens and the /v1/ API. Required by the other two settings. | /v1/ and /mcp return 404, the API Tokens page is not available and tokens are not accepted. |
| Enable MCP | Enables the /mcp endpoint, see MCP. | /mcp returns 404. The /v1/ API is not affected. |
| Allow API Writes | Allows pages to be created and edited through /v1/ and /mcp. | Reading still works. Write requests to /v1/ return 403 and the MCP write tools return an error. |
Turning Enable API off does not delete existing tokens. They become valid again if the API is turned back on.
- Sign in and open your profile (/Profile/My).
- Click API Tokens.
- Enter a name that tells you where the token will be used, then click Create.
- Copy the token. It is shown only once and cannot be displayed again.
The same page lists your tokens and lets you Revoke any of them. A revoked token stops working immediately.
Treat a token like a password:
- Anyone who has the token can act as you, with all of your permissions.
- Tokens do not expire, so revoke the ones you no longer use.
- Create a separate token for each client, so that one can be revoked without affecting the others.
- Use HTTPS, because the token is sent with every request.
Tokens stop working when the account is locked out, and they are deleted when the account is deleted.
Send the token in the Authorization header of every request:
Authorization: Bearer YOUR_TOKEN| Request | Result |
| Valid token | The request runs as the owner of the token. |
| No token | The request is anonymous. It can read what an anonymous visitor can read, and it cannot write. As in the web interface, the wiki markup of a page and the revision history need a signed in user, so they return 403 without a token. |
| Invalid token | The request is rejected with 401. |
The sign-in cookie of the web interface is not accepted by /v1/ or /mcp.
Always use HTTPS
Always use the https:// address of your wiki. When a request to http:// is redirected to HTTPS, some HTTP clients drop the Authorization header. The request then continues as anonymous, without any error, so even an invalid token appears to work and writes fail with "An API token is required to write."All URLs in this article are relative to the address of your wiki, including its base path if one is configured.
{navigation} is the URL-friendly name of a page, as returned by the API. For example, the navigation of the page Wiki Help :: Alert is wiki_help::alert.
| Request | Query parameters | Returns |
| GET /v1/search | q (search text, up to 256 characters), page | A paged list of matching pages. |
| GET /v1/pages/{navigation} | revision, format (markup, html or text, default markup; without a token use html or text) | One page. |
| GET /v1/pages/{navigation}/revisions | page | A paged list of revisions, newest first. |
| GET /v1/namespaces | None | The namespaces that contain at least one page you can read. |
| GET /v1/namespaces/{name}/pages | None | The pages of a namespace that you can read. |
| GET /v1/tags/{tag}/pages | None | The pages with a tag that you can read. |
Pages that you are not allowed to read are left out of all lists.
Get a page as plain text:
curl -H "Authorization: Bearer YOUR_TOKEN" \
"https://wiki.example.com/v1/pages/wiki_help::alert?format=text"{
"name": "Wiki Help :: Alert",
"navigation": "wiki_help::alert",
"description": "Renders an alert box with optional style and title.",
"revision": 1,
"mostCurrentRevision": 1,
"modifiedByUserName": "Admin",
"modifiedDate": "2026-04-12T04:52:30.4684395Z",
"body": "..."
}Search for pages:
curl -H "Authorization: Bearer YOUR_TOKEN" \
"https://wiki.example.com/v1/search?q=alert&page=1"{
"pageNumber": 1,
"pageCount": 1,
"items": [
{
"name": "Wiki Help :: Alert",
"navigation": "wiki_help::alert",
"description": "Renders an alert box with optional style and title."
}
]
}The number of results per page is set by Pagination Size in the configuration.
Writing requires Allow API Writes and a valid token. The same permission checks apply as in the web interface: creating a page requires the Create permission, editing requires Edit, and a protected page can only be edited by a moderator or an administrator.
Create a page with POST /v1/pages. The page name can include a namespace, as in Namespace :: Page.
curl -X POST "https://wiki.example.com/v1/pages" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Sandbox :: API Test",
"body": "==Hello from the API",
"description": "A page created through the API.",
"changeSummary": "Created the page."
}'The response is 201 with the saved page:
{
"name": "Sandbox :: API Test",
"navigation": "sandbox::api_test",
"revision": 1
}Edit a page with PUT /v1/pages/{navigation}. First read the page to get its current revision and description.
curl -X PUT "https://wiki.example.com/v1/pages/sandbox::api_test" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"revision": 1,
"body": "==Hello again",
"description": "A page created through the API.",
"changeSummary": "Changed the heading."
}'Some rules apply to both requests:
- changeSummary is always required, regardless of the change summary settings of the wiki.
- body replaces the existing value. If you leave out description when editing, the description of the page is kept. An empty description clears it.
- revision protects against overwriting someone else's work. It must be the revision your edit is based on. If the page has changed since, nothing is saved and the response is 409 with the current revision, as shown below.
- Page names cannot contain /, \, < or >, and can contain :: at most once.
- Pages cannot be renamed or deleted through the API.
{ "error": "...", "currentRevision": 2 }Revisions saved through the API have a change summary prefixed with [API], and those saved through MCP are prefixed with [MCP], so they can be recognized in the page history. They can be reverted like any other revision.
Errors are returned as { "error": "message" } with one of these status codes:
| Status | Meaning |
| 400 | A parameter or the request body is not valid, or a required value is missing. |
| 401 | The token is not valid, or a write request has no token. |
| 403 | You do not have the required permission, the page is protected, or writing is not enabled. |
| 404 | The page does not exist, or the API is not enabled. |
| 409 | The page was changed since your revision, or a page with that name already exists. |
| 500 | The request failed on the server. |