Skip to main content

Wikis

Create, edit, delete and list wikis.

At their core, wikis are free form blocks of wiki text that are rendered into HTML and displayed to the user. There are several wiki namespaces that are used for different purposes and have different sets of features enabled. The namespace and title uniquely defines a wiki. The display_title, if available, is displayed to the user in place of the wiki's title but does not change the location of the wiki.

Namespaces

The namespace determines which fields are returned in API responses and also which fields are modifiable at the wiki create and edit endpoints. There are 6 namespaces:

  • CATEGORY: The content hierarchy — these wikis can be nested in a tree structure. Guides are associated with a wiki in this namespace.
  • ITEM: Parts and tools that can be attached to guides.
  • TEAM: About pages for teams with the title matching the team's teamid.
  • USER: About pages for users with the title matching the user's userid.
  • INFO: Site information such as licensing and about.
  • WIKI: Documentation that doesn't belong in the other namespaces.

GET /wikis/CATEGORY?display=hierarchy

Returns a hierarchical list of categories along with their display titles. Categories with the stub flag can be included with the 'includeStubs' parameter.

GET /wikis/{namespace}

Returns a flat list of light wiki objects.

GET /wikis/{namespace}?display=titles

Returns a flat list of wiki titles.

GET /wikis/{namespace}/{title}

Returns detailed information about the wiki with the given namespace and title.

GET /wikis/{namespace}/title/{title}

Returns detailed information about the wiki with the given namespace and title, at the requested revision, for the wiki page. Unlike GET /wikis/{namespace}/{title}, it checks that the current user can view the displayed revision and returns the fields below. A numeric title is treated as a title, not a wikiid. WIKI and INFO wikis also add the current user's page permissions to permissions, and WIKI wikis return the quiz call to action for the displayed revision (hasQuizButton, is_draft_only_quiz and, when there is a quiz to take, quizUrl, quizTitleName, hasOpenQuizSession). WIKI and INFO wikis also return is_translation (boolean), master_langid, show_header (boolean, the topic header is shown), revision ({revisionid, date, author} of the displayed revision, whose author may differ from author; WIKI only, otherwise null), major_approval_process_name and minor_approval_process_name (null when not set) and parent ({wikiid, namespace, title, display_title, link} of the parent category, or null).

GET /wikis/{namespace}/{title}/tags

Get all tags on a wiki

GET /wikis/CATEGORY/{title}/children

Get all children of a wiki.

GET /wikis/CATEGORY/{title}/identification

Get the HTML source of the identification section of a device wiki.

GET /wikis/{wikiid}/translations/{langid}

Returns the wiki's translation state in one language: `source_langid` (the wiki's source language), `is_source` (whether `langid` is the source language), `percent_translated` (always 100 for wikis), `has_accepted` (whether `langid` has an accepted revision; always true for the source language) and `translators` (users credited with the translation and their share of it; empty unless human translation is enabled). Returns 403 when the current user cannot view the wiki, 404 when the wiki does not exist and 422 when `langid` is not a supported language.

POST /wikis

Create a new wiki. The fields available to set as well as the ones returned are determined by the namespace of the new wiki. See namespace definitions.

PATCH /wikis/{namespace}/{title}

Modify an existing wiki. The fields available to set as well as the ones returned are determined by the namespace of the modified wiki. See namespace definitions.

DELETE /wikis/{namespace}/{title}

Delete the wiki. The history of the deleted wiki is still available after deletion and can be accessed by creating a new wiki with the same namespace and title.

POST /wikis/{namespace}/{title}/revert

Revert the wiki to a previous revision.

PUT /wikis/CATEGORY/{title}/parent

Make the category a child of the specified category.

PUT /wikis/WIKI/{title}/parent

Set the parent category of a wiki page.

PUT /wikis/{namespace}/{title}/tag

Adds a tag to a wiki, creating the tag if needed.

DELETE /wikis/{namespace}/{title}/tag

Removes a tag from a wiki.

GET /wikis/{wikiid}/stats

Returns `contributors_count` (contributors other than the author, as shown in the wiki's topic header) and `contributor_userids`, the userids of up to 50 users who have edited the wiki, for @mention suggestions; it is empty unless unique usernames are enabled. Returns 403 when the current user cannot view the wiki and 404 when the wiki does not exist.