<< Back to GForge REST API

Entity: Wiki

GET

getContent

Returns the content of a wiki page. URL: GET /api/wiki/{id}/content

Parameters (3)

Name Type Description
version int Page version number to retrieve. Defaults to the latest version.
editable bool When true, includes editableContent (raw source) in the response in addition to rendered HTML. Default false.
skipHitCount bool When true, suppresses the page-view counter increment. Default false.

Return: \stdClass

Object with the following fields:

FieldTypeDescription
content_typestringMIME type of the stored source content. Either text/html or text/markdown. Reflects how the content was originally saved — not the format of the rendered data field (which is always HTML). Use this field to detect markdown pages in web editors and MCP/LLM tool calls.
encodingstringCharacter encoding. Always utf-8.
datastringRendered HTML string.
idintFilesystem record id.
editableContentstringRaw source content (only present when editable=true).

getDiff

Returns a diff between two versions of a wiki page.

Parameters (3)

Name Type Description
id string Wiki page id or pagename. Required.
version1 int First version number to compare. Required.
version2 int Second version number to compare. Required.

Return: \stdClass

getOrphans

Returns wiki pages that would become orphans (unreferenced) if the given wiki page were deleted. These are pages linked from the target page that have no other incoming links.

Parameters (1)

Name Type Description
id string Wiki page id or pagename. Required.

Return: \gforge\plugins\wiki\models\api\WikiPageBasic[]

Name Type Description
id int
section string
refId int
pagename string
flags int
latestVersion int
pageViews int
html_url string Relative path to the wikipage's html page (display)
content_url string Relative path to the wikipage content data (API)
displayName string|null Human-readable display name parsed from link syntax

getReferrers

Returns wiki pages that link to the given wiki page.

Parameters (1)

Name Type Description
id string Wiki page id or pagename. Required.

Return: \gforge\plugins\wiki\models\api\WikiVersionBasic[]

Name Type Description
id int Id of the wikiVersion
pageVersion int Version number
lastModifiedDate string Date this version was last modified
createDate string Date this version was created
wikiPage \WikiPageBasic Related wiki page
user \gforge\core\models\api\UserBasic User that created this version

getVersions

Returns the version history of a wiki page.

Parameters (3)

Name Type Description
id string Wiki page id or pagename. Required.
page_num int Page number (zero-based). Default 0.
page_size int Number of versions per page. Default 20.
Pageable
Use the page_size and page_num parameters to control the set of records returned.

Return: \gforge\plugins\wiki\models\api\WikiVersionBasic[]

Name Type Description
id int Id of the wikiVersion
pageVersion int Version number
lastModifiedDate string Date this version was last modified
createDate string Date this version was created
wikiPage \WikiPageBasic Related wiki page
user \gforge\core\models\api\UserBasic User that created this version

getWiki

User needs to be authenticated to use this service. Returns 0 or more WikiPageBasic models. If an id is provided, returns that single record; otherwise performs a filtered, pageable search.

Parameters (9)

Name Type Description
id string Wiki page id or pagename. When provided, returns a single record.
project string Project id or unixName. Filter to project wiki pages.
user string User id or unixName. Filter to user wiki pages.
section string Section type (e.g. project, user). Use with refId for tracker-item pages.
refId int Id of the section entity. Use with section.
sort_field string Field name to sort by. Default id.
sort_dir string Sort direction: asc or desc. Default asc.
page_num int Page number (zero-based). Default 0.
page_size int Records per page. Default from config query.pagsize.
Sortable
Use the sort_field and sort_dir parameters to control the order in which records are returned.
Pageable
Use the page_size and page_num parameters to control the set of records returned.

Related Entities (4)

Return: \gforge\plugins\wiki\models\api\WikiPageBasic

Single object if id is provided, paged array otherwise.

Name Type Description
id int
section string
refId int
pagename string
flags int
latestVersion int
pageViews int
html_url string Relative path to the wikipage's html page (display)
content_url string Relative path to the wikipage content data (API)
displayName string|null Human-readable display name parsed from link syntax

Example 1

Find a wikipage by id:
  GET http://api.mygforge.tld/api/wiki/1234

  {
  id: 55,
  section: "project",
  refId: 134,
  pagename: "FrontPage",
  flags: 0,
  latestVersion: 1,
  pageViews: 1,
  html_url: "/gf/project/msproject/wiki/?pagename=FrontPage",
  content_url: "/api/wiki/55/content"
  }

Example 2

Find wikipages with project id 134, return 3 elements, page 1, sort by 'pagename' DESC:
  GET http://api.mygforge.tld/api/wiki/?refId=134&page_size=3&page_num=1&sort_field=pagename&sort_dir=desc

[
  {"id":61,"section":"project","refId":134,"pagename":"MostPopular","flags":0,"latestVersion":1,"pageViews":0},
  {"id":57,"section":"project","refId":134,"pagename":"HowToUseWiki","flags":0,"latestVersion":1,"pageViews":0},
  {"id":63,"section":"project","refId":134,"pagename":"GoodStyle","flags":0,"latestVersion":1,"pageViews":0}
]

Example 3

Find wikipages with project unixname 'gforge5', pagename 'FrontPage':
  GET http://api.mygforge.tld/api/wiki/?project=gforge5&pagename=FrontPage

Example 4

Find wikipages with user id 123, pagename 'My User Wiki':
  GET http://api.mygforge.tld/api/wiki/?user=123&pagename=My+User+Wiki

[
  {"id":68,"section":"user","refId":123,"pagename":"My+User+Wiki","flags":0,"latestVersion":1,"pageViews":1},
]

POST

postConvert

Converts the HTML content of a wiki page to Markdown. If the page is already stored as Markdown, returns it unchanged.

Parameters (2)

Name Type Description
id string Wiki page id or pagename. Required.
version int Page version number to convert. Defaults to the latest version.

Return: array

Result object:

FieldTypeDescription
successboolAlways true.
originalHtmlstringThe original HTML before conversion. Empty if already Markdown.
markdownstringThe converted or existing Markdown content.
validationobjectConversion validation result with success and warnings.
qualityfloatEstimated conversion quality score (0.0–1.0).
wikiPageIdintDatabase id of the wiki page.
pagenamestringPage name of the wiki page.

postCreate

Create a new wiki page entry if necessary

Parameters (2)

Name Type Description
id string In route this should be the pagename. Required
project string Project associated with wiki. Required

Return: (none)

postLock

Set the locked/unlocked status of a wiki page. Requires admin rights on the page.

Parameters (2)

Name Type Description
id string Wiki page id or pagename. Required.
lock_status int Lock state. 1 = locked, 0 = unlocked. Required.

Return: void

postOptions

Update wiki settings for a project.

Parameters (5)

Name Type Description
project string Project id or unixName. Required.
isPublic bool Whether the wiki is publicly readable.
wikiType int Content type for the project wiki. 1 = HTML, 2 = plain text, 3 = Markdown.
showAssociationsTab bool Whether to show the associations tab.
showTagsTab bool Whether to show the tags tab.

Return: \gforge\plugins\wiki\models\api\WikiProjectSettingBasic

Name Type Description
isPublic bool Whether the wiki is publicly readable
wikiType int Content type: 1 = HTML, 2 = plain text, 3 = Markdown
showAssociationsTab bool Whether the associations tab is shown
showTagsTab bool Whether the tags tab is shown
project \gforge\core\models\api\ProjectBasic Associated project

postWiki

Create or update a wiki page and save its content.

Parameters (7)

Name Type Description
id int Database ID of the wiki page. Required for updates; omit to create a new page.
content string Content to save. Required.
content_type string MIME type of the content being saved. Accepted values: text/html (default) or text/markdown. Determines how the content is stored and interpreted by the rendering layer. Use text/markdown when posting from markdown editors or MCP/LLM tool calls.
project string Project id or unixName. Required when creating a new page without section/refId.
pagename string Page name. Defaults to FrontPage.
section string Section type (e.g. project or user). Use with refId as an alternative to project.
refId int Id of the section entity (project id or user id). Use with section.

Return: \gforge\plugins\wiki\models\api\WikiPageBasic

The saved wiki page record.

Name Type Description
id int
section string
refId int
pagename string
flags int
latestVersion int
pageViews int
html_url string Relative path to the wikipage's html page (display)
content_url string Relative path to the wikipage content data (API)
displayName string|null Human-readable display name parsed from link syntax

PUT

DELETE

deleteWiki

Delete a wiki page and all its versions.

Parameters (1)

Name Type Description
id string Wiki page id or pagename. Required.

Return: void