REST: Wiki
Generated from mnema-talk v3.3.13 (cca4f0fdb723).
List the wiki pages
GET /api/wiki
The pages without their text, in tree order. With deleted=true, holders of Manage wiki also get the deleted pages (they carry deleted_at). Needs View wiki.
Authentication: Session cookie
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
deleted | query | boolean | no | Include deleted pages (Manage wiki). |
Responses
| Status | Meaning | Body |
|---|---|---|
| 200 | The pages. | TreeResponse |
| 401 | No valid session (UNAUTHORIZED): missing, expired or revoked cookie, or the account was disabled. | ErrorResponse |
| 403 | FORBIDDEN: missing View wiki, or cross-origin request rejected. | ErrorResponse |
| 429 | RATE_LIMITED: too many requests. | ErrorResponse |
| 500 | INTERNAL_ERROR: sanitized server failure. | ErrorResponse |
TreeResponse
| Field | Type | Description |
|---|---|---|
pages (required) | PageSummary[] |
Upload a wiki picture
POST /api/wiki/images
Stores a picture for use in wiki pages (PNG, JPEG, GIF or WebP, up to 5 MB). The picture is redrawn without metadata and shrunk to 1600 pixels. Put the returned markdown in a page. Requires EditWiki.
Authentication: Session cookie
Request body (multipart/form-data, required): object
| Field | Type | Description |
|---|---|---|
image (required) | string (binary) | Picture file (at most 5 MB) |
Responses
| Status | Meaning | Body |
|---|---|---|
| 201 | Created | Image |
| 400 | INVALID_INPUT | ErrorResponse |
| 401 | No valid session (UNAUTHORIZED): missing, expired or revoked cookie, or the account was disabled. | ErrorResponse |
| 403 | FORBIDDEN: missing View wiki or Edit wiki, or cross-origin request rejected. | ErrorResponse |
| 409 | CONFLICT: the wiki holds its most pictures. | ErrorResponse |
| 413 | PAYLOAD_TOO_LARGE | ErrorResponse |
| 415 | UNSUPPORTED_MEDIA_TYPE | ErrorResponse |
| 429 | RATE_LIMITED: too many writes, or the member's daily number of pictures or bytes is reached. | ErrorResponse |
| 500 | INTERNAL_ERROR: sanitized server failure. | ErrorResponse |
| 503 | UNAVAILABLE: file storage is not configured or full, or the server is busy redrawing pictures. | ErrorResponse |
Image
| Field | Type | Description |
|---|---|---|
id (required) | string (uuid) | |
markdown (required) | string | |
size (required) | integer | |
url (required) | string |
Create a wiki page
POST /api/wiki/pages
Adds a page below a parent page (none: at the top) as its first revision. The address derives from the title when it is not given. At most 500 pages, 5 levels, 50 KB of text. Needs Edit wiki, which a timeout and the new-member wait take away. Counts against the member's wiki write limit (429).
Authentication: Session cookie
Request body (application/json, required): PageInput
| Field | Type | Description |
|---|---|---|
content (required) | string | |
parent_id | string (uuid) | |
slug | string | Slug is the page's address; empty derives it from the title. |
summary | string | |
title (required) | string |
Responses
| Status | Meaning | Body |
|---|---|---|
| 201 | The new page. | Page |
| 400 | Invalid input (INVALID_INPUT): malformed JSON, unknown JSON fields, bad address, text too long or failed validation. | ErrorResponse |
| 401 | No valid session (UNAUTHORIZED): missing, expired or revoked cookie, or the account was disabled. | ErrorResponse |
| 403 | FORBIDDEN: missing Edit wiki, or cross-origin request rejected. | ErrorResponse |
| 404 | NOT_FOUND: the parent page does not exist. | ErrorResponse |
| 409 | CONFLICT: the address or title is taken, or the page limit or depth is reached. | ErrorResponse |
| 429 | RATE_LIMITED: too many requests. | ErrorResponse |
| 500 | INTERNAL_ERROR: sanitized server failure. | ErrorResponse |
Page
| Field | Type | Description |
|---|---|---|
content (required) | string | |
created_at (required) | string (date-time) | |
created_by | UserRef | |
deleted_at | string (date-time) | DeletedAt is set on a deleted page, which only holders of Manage wiki see. |
id (required) | string (uuid) | |
locked (required) | boolean | |
parent_id (required) | string | null | |
position (required) | integer | |
redirected_from | string | RedirectedFrom is the old address the request used, when the page was renamed. |
rev (required) | integer | Rev is the latest revision; an edit names it as base_rev. |
slug (required) | string | |
title (required) | string | |
updated_at (required) | string (date-time) | |
updated_by | UserRef |
Delete a wiki page
DELETE /api/wiki/pages/{slug}
Takes the page out of the wiki. Nothing is lost: it keeps its address and revisions, and holders of Manage wiki can restore it. A page with subpages cannot be deleted. Needs Manage wiki and Edit wiki.
Authentication: Session cookie
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
slug | path | string | yes | The page's address. |
Responses
| Status | Meaning | Body |
|---|---|---|
| 200 | The deleted page. | Page |
| 401 | No valid session (UNAUTHORIZED): missing, expired or revoked cookie, or the account was disabled. | ErrorResponse |
| 403 | FORBIDDEN: missing Manage wiki or Edit wiki, or cross-origin request rejected. | ErrorResponse |
| 404 | NOT_FOUND: no such page. | ErrorResponse |
| 409 | CONFLICT: the page has subpages. | ErrorResponse |
| 429 | RATE_LIMITED: too many requests. | ErrorResponse |
| 500 | INTERNAL_ERROR: sanitized server failure. | ErrorResponse |
Page
| Field | Type | Description |
|---|---|---|
content (required) | string | |
created_at (required) | string (date-time) | |
created_by | UserRef | |
deleted_at | string (date-time) | DeletedAt is set on a deleted page, which only holders of Manage wiki see. |
id (required) | string (uuid) | |
locked (required) | boolean | |
parent_id (required) | string | null | |
position (required) | integer | |
redirected_from | string | RedirectedFrom is the old address the request used, when the page was renamed. |
rev (required) | integer | Rev is the latest revision; an edit names it as base_rev. |
slug (required) | string | |
title (required) | string | |
updated_at (required) | string (date-time) | |
updated_by | UserRef |
Get a wiki page
GET /api/wiki/pages/{slug}
The page with its text. A renamed page is found at its old address too (redirected_from names it). A deleted page is only found by holders of Manage wiki. Needs View wiki.
Authentication: Session cookie
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
slug | path | string | yes | The page's address. |
Responses
| Status | Meaning | Body |
|---|---|---|
| 200 | The page. | Page |
| 401 | No valid session (UNAUTHORIZED): missing, expired or revoked cookie, or the account was disabled. | ErrorResponse |
| 403 | FORBIDDEN: missing View wiki, or cross-origin request rejected. | ErrorResponse |
| 404 | NOT_FOUND: no such page. | ErrorResponse |
| 429 | RATE_LIMITED: too many requests. | ErrorResponse |
| 500 | INTERNAL_ERROR: sanitized server failure. | ErrorResponse |
Page
| Field | Type | Description |
|---|---|---|
content (required) | string | |
created_at (required) | string (date-time) | |
created_by | UserRef | |
deleted_at | string (date-time) | DeletedAt is set on a deleted page, which only holders of Manage wiki see. |
id (required) | string (uuid) | |
locked (required) | boolean | |
parent_id (required) | string | null | |
position (required) | integer | |
redirected_from | string | RedirectedFrom is the old address the request used, when the page was renamed. |
rev (required) | integer | Rev is the latest revision; an edit names it as base_rev. |
slug (required) | string | |
title (required) | string | |
updated_at (required) | string (date-time) | |
updated_by | UserRef |
Change a wiki page
PATCH /api/wiki/pages/{slug}
A change of the title or text needs Edit wiki, base_rev (the revision the editor saw) and an unlocked page, and writes a new revision; when the page has moved on meanwhile it answers 409 and changes nothing. A change of the address (the old one redirects), the parent or the position needs Manage wiki as well as Edit wiki, and writes no revision. Holders of Manage wiki may change a locked page. A change that leaves the page as it is answers 200 and writes nothing.
Authentication: Session cookie
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
slug | path | string | yes | The page's address. |
Request body (application/json, required): PageChange
| Field | Type | Description |
|---|---|---|
base_rev (required) | integer | |
content | string | |
parent_id | string (uuid) | |
position | integer | |
slug | string | Slug, ParentID (the zero UUID moves the page to the top) and Position are the page tree's and need Manage wiki. |
summary | string | |
title | string |
Responses
| Status | Meaning | Body |
|---|---|---|
| 200 | The page after the change. | Page |
| 400 | Invalid input (INVALID_INPUT): malformed JSON, missing base_rev, text too long or failed validation. | ErrorResponse |
| 401 | No valid session (UNAUTHORIZED): missing, expired or revoked cookie, or the account was disabled. | ErrorResponse |
| 403 | FORBIDDEN: missing View wiki, Edit wiki or (to rename or move) Manage wiki as well, the page is locked, or cross-origin request rejected. | ErrorResponse |
| 404 | NOT_FOUND: no such page or parent. | ErrorResponse |
| 409 | STALE_REVISION: the page changed meanwhile. CONFLICT: the address or title is taken, or the move passes the depth limit or goes under the page itself. | ErrorResponse |
| 429 | RATE_LIMITED: too many requests. | ErrorResponse |
| 500 | INTERNAL_ERROR: sanitized server failure. | ErrorResponse |
Page
| Field | Type | Description |
|---|---|---|
content (required) | string | |
created_at (required) | string (date-time) | |
created_by | UserRef | |
deleted_at | string (date-time) | DeletedAt is set on a deleted page, which only holders of Manage wiki see. |
id (required) | string (uuid) | |
locked (required) | boolean | |
parent_id (required) | string | null | |
position (required) | integer | |
redirected_from | string | RedirectedFrom is the old address the request used, when the page was renamed. |
rev (required) | integer | Rev is the latest revision; an edit names it as base_rev. |
slug (required) | string | |
title (required) | string | |
updated_at (required) | string (date-time) | |
updated_by | UserRef |
Lock or unlock a wiki page
PUT /api/wiki/pages/{slug}/lock
While a page is locked only holders of Manage wiki change its title or text. Needs Manage wiki and Edit wiki.
Authentication: Session cookie
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
slug | path | string | yes | The page's address. |
Request body (application/json, required): LockInput
| Field | Type | Description |
|---|---|---|
locked (required) | boolean |
Responses
| Status | Meaning | Body |
|---|---|---|
| 200 | The page. | Page |
| 400 | Invalid input (INVALID_INPUT): malformed JSON or unknown JSON fields. | ErrorResponse |
| 401 | No valid session (UNAUTHORIZED): missing, expired or revoked cookie, or the account was disabled. | ErrorResponse |
| 403 | FORBIDDEN: missing Manage wiki or Edit wiki, or cross-origin request rejected. | ErrorResponse |
| 404 | NOT_FOUND: no such page. | ErrorResponse |
| 429 | RATE_LIMITED: too many requests. | ErrorResponse |
| 500 | INTERNAL_ERROR: sanitized server failure. | ErrorResponse |
Page
| Field | Type | Description |
|---|---|---|
content (required) | string | |
created_at (required) | string (date-time) | |
created_by | UserRef | |
deleted_at | string (date-time) | DeletedAt is set on a deleted page, which only holders of Manage wiki see. |
id (required) | string (uuid) | |
locked (required) | boolean | |
parent_id (required) | string | null | |
position (required) | integer | |
redirected_from | string | RedirectedFrom is the old address the request used, when the page was renamed. |
rev (required) | integer | Rev is the latest revision; an edit names it as base_rev. |
slug (required) | string | |
title (required) | string | |
updated_at (required) | string (date-time) | |
updated_by | UserRef |
List the revisions of a wiki page
GET /api/wiki/pages/{slug}/revisions
The saved states of the page, newest first, without their text: who saved, when, the summary, the size, and the revision a restore copied. Page with before (the lowest revision of the previous page). Needs View wiki.
Authentication: Session cookie
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
slug | path | string | yes | The page's address. |
before | query | integer | no | Only revisions below this number. |
Responses
| Status | Meaning | Body |
|---|---|---|
| 200 | The revisions. | Revision[] |
| 401 | No valid session (UNAUTHORIZED): missing, expired or revoked cookie, or the account was disabled. | ErrorResponse |
| 403 | FORBIDDEN: missing View wiki, or cross-origin request rejected. | ErrorResponse |
| 404 | NOT_FOUND: no such page. | ErrorResponse |
| 429 | RATE_LIMITED: too many requests. | ErrorResponse |
| 500 | INTERNAL_ERROR: sanitized server failure. | ErrorResponse |
Get one revision of a wiki page
GET /api/wiki/pages/{slug}/revisions/{rev}
The title and text of a saved state of the page. Needs View wiki.
Authentication: Session cookie
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
slug | path | string | yes | The page's address. |
rev | path | integer | yes | The revision number. |
Responses
| Status | Meaning | Body |
|---|---|---|
| 200 | The revision. | Revision |
| 400 | Invalid input (INVALID_INPUT): bad revision number. | ErrorResponse |
| 401 | No valid session (UNAUTHORIZED): missing, expired or revoked cookie, or the account was disabled. | ErrorResponse |
| 403 | FORBIDDEN: missing View wiki, or cross-origin request rejected. | ErrorResponse |
| 404 | NOT_FOUND: no such page or revision (old ones are pruned). | ErrorResponse |
| 429 | RATE_LIMITED: too many requests. | ErrorResponse |
| 500 | INTERNAL_ERROR: sanitized server failure. | ErrorResponse |
Revision
| Field | Type | Description |
|---|---|---|
content | string | |
created_at (required) | string (date-time) | |
editor | UserRef | |
restored_from | integer | |
rev (required) | integer | |
size (required) | integer | |
summary (required) | string | |
title | string |
Restore a revision of a wiki page
POST /api/wiki/pages/{slug}/revisions/{rev}/restore
Makes the title and text of a revision the page's again, as a new revision (nothing is overwritten or removed), so vandalism is undone in one step. base_rev is the latest revision the editor saw; 409 when the page has moved on. Needs Edit wiki and an unlocked page (or Manage wiki).
Authentication: Session cookie
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
slug | path | string | yes | The page's address. |
rev | path | integer | yes | The revision to restore. |
Request body (application/json, required): RestoreInput
| Field | Type | Description |
|---|---|---|
base_rev (required) | integer | |
summary | string |
Responses
| Status | Meaning | Body |
|---|---|---|
| 200 | The page after the restore. | Page |
| 400 | Invalid input (INVALID_INPUT): malformed JSON, missing base_rev, bad revision number, or the page already is that revision. | ErrorResponse |
| 401 | No valid session (UNAUTHORIZED): missing, expired or revoked cookie, or the account was disabled. | ErrorResponse |
| 403 | FORBIDDEN: missing Edit wiki, the page is locked, or cross-origin request rejected. | ErrorResponse |
| 404 | NOT_FOUND: no such page or revision. | ErrorResponse |
| 409 | STALE_REVISION: the page changed meanwhile. CONFLICT: another page has that title now. | ErrorResponse |
| 429 | RATE_LIMITED: too many requests. | ErrorResponse |
| 500 | INTERNAL_ERROR: sanitized server failure. | ErrorResponse |
Page
| Field | Type | Description |
|---|---|---|
content (required) | string | |
created_at (required) | string (date-time) | |
created_by | UserRef | |
deleted_at | string (date-time) | DeletedAt is set on a deleted page, which only holders of Manage wiki see. |
id (required) | string (uuid) | |
locked (required) | boolean | |
parent_id (required) | string | null | |
position (required) | integer | |
redirected_from | string | RedirectedFrom is the old address the request used, when the page was renamed. |
rev (required) | integer | Rev is the latest revision; an edit names it as base_rev. |
slug (required) | string | |
title (required) | string | |
updated_at (required) | string (date-time) | |
updated_by | UserRef |
Restore a deleted wiki page
POST /api/wiki/pages/{slug}/undelete
Puts a deleted page back below its old parent (at the top when that one is gone). Needs Manage wiki and Edit wiki.
Authentication: Session cookie
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
slug | path | string | yes | The page's address. |
Responses
| Status | Meaning | Body |
|---|---|---|
| 200 | The restored page. | Page |
| 401 | No valid session (UNAUTHORIZED): missing, expired or revoked cookie, or the account was disabled. | ErrorResponse |
| 403 | FORBIDDEN: missing Manage wiki or Edit wiki, or cross-origin request rejected. | ErrorResponse |
| 404 | NOT_FOUND: no such page. | ErrorResponse |
| 409 | CONFLICT: the page is not deleted, its title is used by another page, or the page limit is reached. | ErrorResponse |
| 429 | RATE_LIMITED: too many requests. | ErrorResponse |
| 500 | INTERNAL_ERROR: sanitized server failure. | ErrorResponse |
Page
| Field | Type | Description |
|---|---|---|
content (required) | string | |
created_at (required) | string (date-time) | |
created_by | UserRef | |
deleted_at | string (date-time) | DeletedAt is set on a deleted page, which only holders of Manage wiki see. |
id (required) | string (uuid) | |
locked (required) | boolean | |
parent_id (required) | string | null | |
position (required) | integer | |
redirected_from | string | RedirectedFrom is the old address the request used, when the page was renamed. |
rev (required) | integer | Rev is the latest revision; an edit names it as base_rev. |
slug (required) | string | |
title (required) | string | |
updated_at (required) | string (date-time) | |
updated_by | UserRef |
Search the wiki
GET /api/wiki/search
Pages whose title or text contains q (at least three characters), titles first, at most 30, with a few words around the match. Deleted pages are never found. Needs View wiki.
Authentication: Session cookie
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
q | query | string | yes | What to look for. |
Responses
| Status | Meaning | Body |
|---|---|---|
| 200 | The matching pages. | SearchHit[] |
| 401 | No valid session (UNAUTHORIZED): missing, expired or revoked cookie, or the account was disabled. | ErrorResponse |
| 403 | FORBIDDEN: missing View wiki, or cross-origin request rejected. | ErrorResponse |
| 429 | RATE_LIMITED: too many requests. | ErrorResponse |
| 500 | INTERNAL_ERROR: sanitized server failure. | ErrorResponse |