Use this API to manage group wikis. An API for project wikis is also available.

Comments on a wiki page are called notes. To interact with them, use the notes API.

List all wiki pages for a group

GET /api/v4/groups/{id}/wikis

Lists all wiki pages for a specified group.

Parameters

NameTypeDescription
id
Path, required
String or integerThe ID or URL-encoded path of the group or project
with_content
Query
BooleanInclude pages’ content
Default: false

Responses

CodeDescriptionSchema
200OKAPIEntitiesWikiPageBasic
400Bad Request—
404Not found—

Create a wiki page for a group

POST /api/v4/groups/{id}/wikis

Creates a wiki page for a specified group. Requests can define the title, slug, and content.

Parameters

NameTypeDescription
id
Path, required
String or integerThe ID or URL-encoded path of the group or project

Request body (application/json)

PropertyTypeDescription
content
Required
StringContent of a wiki page
formatStringFormat of a wiki page. Available formats are markdown, rdoc, asciidoc and org
Allowed values: markdown, rdoc, asciidoc, org
Default: markdown
front_matterObjectObject that contains YAML frontmatter
front_matter.titleStringFrontmatter title of a wiki page
title
Required
StringTitle of a wiki page

Responses

CodeDescriptionSchema
201CreatedAPIEntitiesWikiPage
400Validation error—
404Not found—
422Unprocessable entity—

Upload an attachment to a group wiki

POST /api/v4/groups/{id}/wikis/attachments

Uploads a file to the uploads directory in a specified group wiki.

Parameters

NameTypeDescription
id
Path, required
String or integerThe ID or URL-encoded path of the group or project

Request body (multipart/form-data)

PropertyTypeDescription
branchStringThe name of the branch
file
Required
String (binary)The attachment file to be uploaded

Responses

CodeDescriptionSchema
201CreatedAPIEntitiesWikiAttachment
400Bad Request—
404Not found—

Retrieve a wiki page for a group

GET /api/v4/groups/{id}/wikis/{slug}

Retrieves a specified wiki page for a group.

Parameters

NameTypeDescription
id
Path, required
String or integerThe ID or URL-encoded path of the group or project
slug
Path, required
StringThe slug of a wiki page
version
Query
StringThe version hash of a wiki page
render_html
Query
BooleanRender content to HTML
Default: false

Responses

CodeDescriptionSchema
200OKAPIEntitiesWikiPage
400Bad Request—
404Not found—

Update a wiki page for a group

PUT /api/v4/groups/{id}/wikis/{slug}

Updates a specified wiki page for a group.

Parameters

NameTypeDescription
id
Path, required
String or integerThe ID or URL-encoded path of the group or project
slug
Path, required
StringThe slug of a wiki page

Request body (application/json)

PropertyTypeDescription
contentStringContent of a wiki page
formatStringFormat of a wiki page. Available formats are markdown, rdoc, asciidoc and org
Allowed values: markdown, rdoc, asciidoc, org
Default: markdown
front_matterObjectObject that contains YAML frontmatter
front_matter.titleStringFrontmatter title of a wiki page
titleStringTitle of a wiki page

Responses

CodeDescriptionSchema
200OKAPIEntitiesWikiPage
400Validation error—
404Not found—
422Unprocessable entity—

Delete a wiki page for a group

DELETE /api/v4/groups/{id}/wikis/{slug}

Deletes a specified wiki page from a group.

Parameters

NameTypeDescription
id
Path, required
String or integerThe ID or URL-encoded path of the group or project
slug
Path, required
StringThe slug of a wiki page

Responses

CodeDescriptionSchema
204No Content—
400Validation error—
404Not found—

List all wiki pages for a project

GET /api/v4/projects/{id}/wikis

Lists all wiki pages for a specified project.

Parameters

NameTypeDescription
id
Path, required
String or integerThe ID or URL-encoded path of the group or project
with_content
Query
BooleanInclude pages’ content
Default: false

Responses

CodeDescriptionSchema
200OKAPIEntitiesWikiPageBasic
400Bad Request—
404Not found—

Create a wiki page for a project

POST /api/v4/projects/{id}/wikis

Creates a wiki page for a specified project. Requests can define the title, slug, and content.

Parameters

NameTypeDescription
id
Path, required
String or integerThe ID or URL-encoded path of the group or project

Request body (application/json)

PropertyTypeDescription
content
Required
StringContent of a wiki page
formatStringFormat of a wiki page. Available formats are markdown, rdoc, asciidoc and org
Allowed values: markdown, rdoc, asciidoc, org
Default: markdown
front_matterObjectObject that contains YAML frontmatter
front_matter.titleStringFrontmatter title of a wiki page
title
Required
StringTitle of a wiki page

Responses

CodeDescriptionSchema
201CreatedAPIEntitiesWikiPage
400Validation error—
404Not found—
422Unprocessable entity—

Upload an attachment to a project wiki

POST /api/v4/projects/{id}/wikis/attachments

Uploads a file to the uploads directory in a specified project wiki.

Parameters

NameTypeDescription
id
Path, required
String or integerThe ID or URL-encoded path of the group or project

Request body (multipart/form-data)

PropertyTypeDescription
branchStringThe name of the branch
file
Required
String (binary)The attachment file to be uploaded

Responses

CodeDescriptionSchema
201CreatedAPIEntitiesWikiAttachment
400Bad Request—
404Not found—

Retrieve a wiki page for a project

GET /api/v4/projects/{id}/wikis/{slug}

Retrieves a specified wiki page for a project.

Parameters

NameTypeDescription
id
Path, required
String or integerThe ID or URL-encoded path of the group or project
slug
Path, required
StringThe slug of a wiki page
version
Query
StringThe version hash of a wiki page
render_html
Query
BooleanRender content to HTML
Default: false

Responses

CodeDescriptionSchema
200OKAPIEntitiesWikiPage
400Bad Request—
404Not found—

Update a wiki page for a project

PUT /api/v4/projects/{id}/wikis/{slug}

Updates a specified wiki page for a project.

Parameters

NameTypeDescription
id
Path, required
String or integerThe ID or URL-encoded path of the group or project
slug
Path, required
StringThe slug of a wiki page

Request body (application/json)

PropertyTypeDescription
contentStringContent of a wiki page
formatStringFormat of a wiki page. Available formats are markdown, rdoc, asciidoc and org
Allowed values: markdown, rdoc, asciidoc, org
Default: markdown
front_matterObjectObject that contains YAML frontmatter
front_matter.titleStringFrontmatter title of a wiki page
titleStringTitle of a wiki page

Responses

CodeDescriptionSchema
200OKAPIEntitiesWikiPage
400Validation error—
404Not found—
422Unprocessable entity—

Delete a wiki page for a project

DELETE /api/v4/projects/{id}/wikis/{slug}

Deletes a specified wiki page from a project.

Parameters

NameTypeDescription
id
Path, required
String or integerThe ID or URL-encoded path of the group or project
slug
Path, required
StringThe slug of a wiki page

Responses

CodeDescriptionSchema
204No Content—
400Validation error—
404Not found—

Schemas

Objects returned by the operations above and objects nested in their request bodies.

APIEntitiesWikiAttachment

PropertyTypeDescription
branchStringExample: main
file_nameStringExample: dk.png
file_pathStringExample: uploads/6a061c4cf9f1c28cb22c384b4b8d4e3c/dk.png
linkObject—
link.markdownStringExample: ![dk](uploads/6a061c4cf9f1c28cb22c384b4b8d4e3c/dk.png)
link.urlStringExample: uploads/6a061c4cf9f1c28cb22c384b4b8d4e3c/dk.png

APIEntitiesWikiPage

PropertyTypeDescription
contentStringExample: Here is an instruction how to deploy this project.
encodingStringExample: UTF-8
formatStringExample: markdown
front_matterObjectExample: {"title":"deploy"}
slugStringExample: deploy
titleStringExample: deploy
wiki_page_meta_idInteger (int64)Example: 123

APIEntitiesWikiPageBasic

PropertyTypeDescription
formatStringExample: markdown
slugStringExample: deploy
titleStringExample: deploy
wiki_page_meta_idInteger (int64)Example: 123