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

NameInTypeRequiredDescription
deletedquerybooleannoInclude deleted pages (Manage wiki).

Responses

StatusMeaningBody
200The pages.TreeResponse
401No valid session (UNAUTHORIZED): missing, expired or revoked cookie, or the account was disabled.ErrorResponse
403FORBIDDEN: missing View wiki, or cross-origin request rejected.ErrorResponse
429RATE_LIMITED: too many requests.ErrorResponse
500INTERNAL_ERROR: sanitized server failure.ErrorResponse
TreeResponse
FieldTypeDescription
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

FieldTypeDescription
image (required)string (binary)Picture file (at most 5 MB)

Responses

StatusMeaningBody
201CreatedImage
400INVALID_INPUTErrorResponse
401No valid session (UNAUTHORIZED): missing, expired or revoked cookie, or the account was disabled.ErrorResponse
403FORBIDDEN: missing View wiki or Edit wiki, or cross-origin request rejected.ErrorResponse
409CONFLICT: the wiki holds its most pictures.ErrorResponse
413PAYLOAD_TOO_LARGEErrorResponse
415UNSUPPORTED_MEDIA_TYPEErrorResponse
429RATE_LIMITED: too many writes, or the member's daily number of pictures or bytes is reached.ErrorResponse
500INTERNAL_ERROR: sanitized server failure.ErrorResponse
503UNAVAILABLE: file storage is not configured or full, or the server is busy redrawing pictures.ErrorResponse
Image
FieldTypeDescription
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

FieldTypeDescription
content (required)string
parent_idstring (uuid)
slugstringSlug is the page's address; empty derives it from the title.
summarystring
title (required)string

Responses

StatusMeaningBody
201The new page.Page
400Invalid input (INVALID_INPUT): malformed JSON, unknown JSON fields, bad address, text too long or failed validation.ErrorResponse
401No valid session (UNAUTHORIZED): missing, expired or revoked cookie, or the account was disabled.ErrorResponse
403FORBIDDEN: missing Edit wiki, or cross-origin request rejected.ErrorResponse
404NOT_FOUND: the parent page does not exist.ErrorResponse
409CONFLICT: the address or title is taken, or the page limit or depth is reached.ErrorResponse
429RATE_LIMITED: too many requests.ErrorResponse
500INTERNAL_ERROR: sanitized server failure.ErrorResponse
Page
FieldTypeDescription
content (required)string
created_at (required)string (date-time)
created_byUserRef
deleted_atstring (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_fromstringRedirectedFrom is the old address the request used, when the page was renamed.
rev (required)integerRev is the latest revision; an edit names it as base_rev.
slug (required)string
title (required)string
updated_at (required)string (date-time)
updated_byUserRef

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

NameInTypeRequiredDescription
slugpathstringyesThe page's address.

Responses

StatusMeaningBody
200The deleted page.Page
401No valid session (UNAUTHORIZED): missing, expired or revoked cookie, or the account was disabled.ErrorResponse
403FORBIDDEN: missing Manage wiki or Edit wiki, or cross-origin request rejected.ErrorResponse
404NOT_FOUND: no such page.ErrorResponse
409CONFLICT: the page has subpages.ErrorResponse
429RATE_LIMITED: too many requests.ErrorResponse
500INTERNAL_ERROR: sanitized server failure.ErrorResponse
Page
FieldTypeDescription
content (required)string
created_at (required)string (date-time)
created_byUserRef
deleted_atstring (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_fromstringRedirectedFrom is the old address the request used, when the page was renamed.
rev (required)integerRev is the latest revision; an edit names it as base_rev.
slug (required)string
title (required)string
updated_at (required)string (date-time)
updated_byUserRef

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

NameInTypeRequiredDescription
slugpathstringyesThe page's address.

Responses

StatusMeaningBody
200The page.Page
401No valid session (UNAUTHORIZED): missing, expired or revoked cookie, or the account was disabled.ErrorResponse
403FORBIDDEN: missing View wiki, or cross-origin request rejected.ErrorResponse
404NOT_FOUND: no such page.ErrorResponse
429RATE_LIMITED: too many requests.ErrorResponse
500INTERNAL_ERROR: sanitized server failure.ErrorResponse
Page
FieldTypeDescription
content (required)string
created_at (required)string (date-time)
created_byUserRef
deleted_atstring (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_fromstringRedirectedFrom is the old address the request used, when the page was renamed.
rev (required)integerRev is the latest revision; an edit names it as base_rev.
slug (required)string
title (required)string
updated_at (required)string (date-time)
updated_byUserRef

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

NameInTypeRequiredDescription
slugpathstringyesThe page's address.

Request body (application/json, required): PageChange

FieldTypeDescription
base_rev (required)integer
contentstring
parent_idstring (uuid)
positioninteger
slugstringSlug, ParentID (the zero UUID moves the page to the top) and Position are the page tree's and need Manage wiki.
summarystring
titlestring

Responses

StatusMeaningBody
200The page after the change.Page
400Invalid input (INVALID_INPUT): malformed JSON, missing base_rev, text too long or failed validation.ErrorResponse
401No valid session (UNAUTHORIZED): missing, expired or revoked cookie, or the account was disabled.ErrorResponse
403FORBIDDEN: missing View wiki, Edit wiki or (to rename or move) Manage wiki as well, the page is locked, or cross-origin request rejected.ErrorResponse
404NOT_FOUND: no such page or parent.ErrorResponse
409STALE_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
429RATE_LIMITED: too many requests.ErrorResponse
500INTERNAL_ERROR: sanitized server failure.ErrorResponse
Page
FieldTypeDescription
content (required)string
created_at (required)string (date-time)
created_byUserRef
deleted_atstring (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_fromstringRedirectedFrom is the old address the request used, when the page was renamed.
rev (required)integerRev is the latest revision; an edit names it as base_rev.
slug (required)string
title (required)string
updated_at (required)string (date-time)
updated_byUserRef

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

NameInTypeRequiredDescription
slugpathstringyesThe page's address.

Request body (application/json, required): LockInput

FieldTypeDescription
locked (required)boolean

Responses

StatusMeaningBody
200The page.Page
400Invalid input (INVALID_INPUT): malformed JSON or unknown JSON fields.ErrorResponse
401No valid session (UNAUTHORIZED): missing, expired or revoked cookie, or the account was disabled.ErrorResponse
403FORBIDDEN: missing Manage wiki or Edit wiki, or cross-origin request rejected.ErrorResponse
404NOT_FOUND: no such page.ErrorResponse
429RATE_LIMITED: too many requests.ErrorResponse
500INTERNAL_ERROR: sanitized server failure.ErrorResponse
Page
FieldTypeDescription
content (required)string
created_at (required)string (date-time)
created_byUserRef
deleted_atstring (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_fromstringRedirectedFrom is the old address the request used, when the page was renamed.
rev (required)integerRev is the latest revision; an edit names it as base_rev.
slug (required)string
title (required)string
updated_at (required)string (date-time)
updated_byUserRef

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

NameInTypeRequiredDescription
slugpathstringyesThe page's address.
beforequeryintegernoOnly revisions below this number.

Responses

StatusMeaningBody
200The revisions.Revision[]
401No valid session (UNAUTHORIZED): missing, expired or revoked cookie, or the account was disabled.ErrorResponse
403FORBIDDEN: missing View wiki, or cross-origin request rejected.ErrorResponse
404NOT_FOUND: no such page.ErrorResponse
429RATE_LIMITED: too many requests.ErrorResponse
500INTERNAL_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

NameInTypeRequiredDescription
slugpathstringyesThe page's address.
revpathintegeryesThe revision number.

Responses

StatusMeaningBody
200The revision.Revision
400Invalid input (INVALID_INPUT): bad revision number.ErrorResponse
401No valid session (UNAUTHORIZED): missing, expired or revoked cookie, or the account was disabled.ErrorResponse
403FORBIDDEN: missing View wiki, or cross-origin request rejected.ErrorResponse
404NOT_FOUND: no such page or revision (old ones are pruned).ErrorResponse
429RATE_LIMITED: too many requests.ErrorResponse
500INTERNAL_ERROR: sanitized server failure.ErrorResponse
Revision
FieldTypeDescription
contentstring
created_at (required)string (date-time)
editorUserRef
restored_frominteger
rev (required)integer
size (required)integer
summary (required)string
titlestring

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

NameInTypeRequiredDescription
slugpathstringyesThe page's address.
revpathintegeryesThe revision to restore.

Request body (application/json, required): RestoreInput

FieldTypeDescription
base_rev (required)integer
summarystring

Responses

StatusMeaningBody
200The page after the restore.Page
400Invalid input (INVALID_INPUT): malformed JSON, missing base_rev, bad revision number, or the page already is that revision.ErrorResponse
401No valid session (UNAUTHORIZED): missing, expired or revoked cookie, or the account was disabled.ErrorResponse
403FORBIDDEN: missing Edit wiki, the page is locked, or cross-origin request rejected.ErrorResponse
404NOT_FOUND: no such page or revision.ErrorResponse
409STALE_REVISION: the page changed meanwhile. CONFLICT: another page has that title now.ErrorResponse
429RATE_LIMITED: too many requests.ErrorResponse
500INTERNAL_ERROR: sanitized server failure.ErrorResponse
Page
FieldTypeDescription
content (required)string
created_at (required)string (date-time)
created_byUserRef
deleted_atstring (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_fromstringRedirectedFrom is the old address the request used, when the page was renamed.
rev (required)integerRev is the latest revision; an edit names it as base_rev.
slug (required)string
title (required)string
updated_at (required)string (date-time)
updated_byUserRef

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

NameInTypeRequiredDescription
slugpathstringyesThe page's address.

Responses

StatusMeaningBody
200The restored page.Page
401No valid session (UNAUTHORIZED): missing, expired or revoked cookie, or the account was disabled.ErrorResponse
403FORBIDDEN: missing Manage wiki or Edit wiki, or cross-origin request rejected.ErrorResponse
404NOT_FOUND: no such page.ErrorResponse
409CONFLICT: the page is not deleted, its title is used by another page, or the page limit is reached.ErrorResponse
429RATE_LIMITED: too many requests.ErrorResponse
500INTERNAL_ERROR: sanitized server failure.ErrorResponse
Page
FieldTypeDescription
content (required)string
created_at (required)string (date-time)
created_byUserRef
deleted_atstring (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_fromstringRedirectedFrom is the old address the request used, when the page was renamed.
rev (required)integerRev is the latest revision; an edit names it as base_rev.
slug (required)string
title (required)string
updated_at (required)string (date-time)
updated_byUserRef

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

NameInTypeRequiredDescription
qquerystringyesWhat to look for.

Responses

StatusMeaningBody
200The matching pages.SearchHit[]
401No valid session (UNAUTHORIZED): missing, expired or revoked cookie, or the account was disabled.ErrorResponse
403FORBIDDEN: missing View wiki, or cross-origin request rejected.ErrorResponse
429RATE_LIMITED: too many requests.ErrorResponse
500INTERNAL_ERROR: sanitized server failure.ErrorResponse

Something wrong on this page? Tell us.