Wiki API
The wiki speaks the REST API of the widely used corporate wiki: what it answers, what it stores, and its query language.
What it is
Every project has exactly one wiki space, and the space key is the project key. The wiki answers the REST API of the self-hosted edition of the widely used corporate wiki at https://<workspace>.kaiku.tech/rest/api/…, and the same requests under /wiki/rest/api/… for tools that expect the cloud layout. The token is the same one — see Connecting a tool.
Errors have that wiki’s own shape, which differs from the tracker’s. A page you may not see is a 404; a 403 means you can see it but not change it.
What is answered
| Area | Requests |
|---|---|
| Pages | content — list, create, read (also an older version with ?version=N), update, delete; content/{id}/child, /descendant/page, /ancestor, /history, /version; content/{id}/move/{append|above|below}/{target} |
| Comments | content/{id}/child/comment, including replies and inline comments; created with POST content and type: "comment" |
| Attachments | content/{id}/child/attachment — upload, list, replace; content/att{id}; /download/attachments/{pageId}/{filename} |
| Labels | content/{id}/label — list, add, remove |
| Restrictions | content/{id}/restriction — who may read and who may edit a page |
| Spaces | space, space/{key}, space/{key}/content |
| Search | search and content/search with cql — see below |
| People | user/current, user, search/user, group |
| Export | exportword?pageId=… — a page as a Word document |
Lists page with start and limit (25 by default, at most 200) and return the paged envelope with results, size and _links. expand works as in the original.
What a page body may be
storage— the wiki’s XHTML storage format, kept as sent.markdown— converted to storage when saved. Headings, lists, tables, links, code, and formulas in$…$and$$…$$.wiki— read as Markdown too, not as the original wiki markup.- A document object (
atlas_doc_format) is not converted: do not send one.
Every save is a new version. An update must carry the next version number: one that is not greater than the current number is refused with a 409 — somebody else saved in between; read the page again and retry.
A page may hold up to 512 KB of text, a comment up to 100 KB, an attachment up to 100 MB. Uploading a file with a name the page already has replaces it as a new version.
Where it differs
- Pages and comments only: no blog posts, whiteboards or databases. Creating any other type is a 400.
- Content properties are always empty.
- No comparison of versions: fetch both with
?version=Nand compare them yourself. - Search has no relevance score: results come newest-modified first unless ordered.
- The home page of a space cannot be deleted or restricted.
- A page is answered with a 200 when created, not a 201.
Search (CQL)
| Field | Compared against |
|---|---|
space (or space.key) | the space key |
type | page |
title | the title |
text | the title, the text, the labels — and the words in diagrams attached as SVG |
label | any single label |
creator | the username of whoever created the page |
contributor | the username of whoever edited it last — not everybody who ever did |
ancestor | a page id anywhere above |
parent | the id of the page directly above |
id | the page id |
created, lastmodified | a date |
- Operators:
=,!=,~(contains, ignoring case),!~,IN,NOT IN, and>,>=,<,<=on dates. AND,OR, parentheses. There is noNOT.- Functions:
currentUser(),startOfDay(), andnow("-7d")— withmfor minutes,h,d,wandy. ORDER BYcreated,lastmodified,title,spaceorid, withDESCif wanted.- Not understood:
favourite,watcher,mention,macro,container, and aNOTin front of a group.
As with the tracker search, a CQL query is never refused: a field that is not in the table above is ignored and matches every page.
Something missing, or not as described here? Write to hello@kaiku.tech