Use this API to interact with project topics. For more information, see project topics.

List all topics

GET /api/v4/topics

Lists all project topics sorted by the number of associated projects.

Parameters

NameTypeDescription
search
Query
StringReturn list of topics matching the search criteria
Example: search
without_projects
Query
BooleanReturn list of topics without assigned projects
organization_id
Query
IntegerThe organization id for the topics
page
Query
IntegerCurrent page number
Default: 1
Example: 1
per_page
Query
IntegerNumber of items per page
Default: 20
Example: 20

Responses

CodeDescriptionSchema
200OKAPIEntitiesProjectsTopic
400Bad Request—

Create a project topic

POST /api/v4/topics

Creates a project topic. Administrators only.

Request body (multipart/form-data)

PropertyTypeDescription
avatarString (binary)Avatar image for topic
descriptionStringDescription
name
Required
StringSlug (name)
organization_idIntegerThe organization id for the topic
title
Required
StringTitle

Responses

CodeDescriptionSchema
201CreatedAPIEntitiesProjectsTopic
400Bad Request—

Merge topics

POST /api/v4/topics/merge

Merges a source topic into a target topic. This action deletes the source topic and moves all assigned projects to the target topic. Administrators only.

Request body (application/json)

PropertyTypeDescription
source_topic_id
Required
IntegerID of source project topic
target_topic_id
Required
IntegerID of target project topic

Responses

CodeDescriptionSchema
201CreatedAPIEntitiesProjectsTopic
400Bad Request—

Retrieve a topic

GET /api/v4/topics/{id}

Retrieves a specified project topic.

Parameters

NameTypeDescription
id
Path, required
IntegerID of project topic

Responses

CodeDescriptionSchema
200OKAPIEntitiesProjectsTopic
400Bad Request—
404Not Found—

Update a project topic

PUT /api/v4/topics/{id}

Updates a specified project topic. Administrators only.

Parameters

NameTypeDescription
id
Path, required
IntegerID of project topic

Request body (multipart/form-data)

PropertyTypeDescription
avatarString (binary)Avatar image for topic
descriptionStringDescription
nameStringSlug (name)
titleStringTitle

Responses

CodeDescriptionSchema
200OKAPIEntitiesProjectsTopic
400Bad Request—
404Not Found—

Delete a project topic

DELETE /api/v4/topics/{id}

Deletes a specified project topic. Administrators only.

Parameters

NameTypeDescription
id
Path, required
IntegerID of project topic

Responses

CodeDescriptionSchema
204Resource deleted—
400Bad Request—
404Not Found—

Schemas

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

APIEntitiesProjectsTopic

PropertyTypeDescription
avatar_urlStringExample: http://gitlab.example.com/uploads/topic/avatar/1/avatar.png
descriptionStringExample: A description
idInteger (int64)Example: 1
nameStringExample: topic1
organization_idInteger (int64)Example: 1
titleStringExample: Topic 1
total_projects_countIntegerExample: 1