Documentation
Documentation
https://docs.gitlab.com/api/
APIReference
https://docs.gitlab.com/api/api_resources/
Authentication
https://docs.gitlab.com/api/rest/authentication/
swagger: '2.0'
info:
title: GitLab access_requests issues API
version: v4
description: Operations related to access requests
host: gitlab.com
produces:
- application/json
tags:
- name: issues
description: Operations about issues
paths:
/api/v4/projects/{id}/issues/{issue_iid}/links:
get:
summary: List issue relations
description: Get a list of a given issue’s linked issues, sorted by the relationship creation datetime (ascending).Issues are filtered according to the user authorizations.
produces:
- application/json
parameters:
- in: path
name: id
description: The ID or URL-encoded path of the project owned by the authenticated user
type: string
required: true
- in: path
name: issue_iid
description: The internal ID of a project’s issue
type: integer
format: int32
required: true
responses:
'200':
description: List issue relations
schema:
type: array
items:
$ref: '#/definitions/API_Entities_RelatedIssue'
'401':
description: Unauthorized
'404':
description: Not found
tags:
- issues
operationId: getApiV4ProjectsIdIssuesIssueIidLinks
post:
summary: Create an issue link
description: Creates a two-way relation between two issues.The user must be allowed to update both issues to succeed.
produces:
- application/json
consumes:
- application/json
parameters:
- in: path
name: id
description: The ID or URL-encoded path of the project owned by the authenticated user
type: string
required: true
- in: path
name: issue_iid
description: The internal ID of a project’s issue
type: integer
format: int32
required: true
- name: postApiV4ProjectsIdIssuesIssueIidLinks
in: body
required: true
schema:
$ref: '#/definitions/postApiV4ProjectsIdIssuesIssueIidLinks'
responses:
'201':
description: Create an issue link
schema:
$ref: '#/definitions/API_Entities_IssueLink'
'400':
description: Bad Request
'401':
description: Unauthorized
tags:
- issues
operationId: postApiV4ProjectsIdIssuesIssueIidLinks
/api/v4/projects/{id}/issues/{issue_iid}/links/{issue_link_id}:
get:
summary: Get an issue link
description: Gets details about an issue link. This feature was introduced in GitLab 15.1.
produces:
- application/json
parameters:
- in: path
name: id
description: The ID or URL-encoded path of the project owned by the authenticated user
type: string
required: true
- in: path
name: issue_iid
description: The internal ID of a project’s issue
type: integer
format: int32
required: true
- in: path
name: issue_link_id
description: ID of an issue relationship
type: string
required: true
responses:
'200':
description: Get an issue link
schema:
$ref: '#/definitions/API_Entities_IssueLink'
'401':
description: Unauthorized
'404':
description: Not found
tags:
- issues
operationId: getApiV4ProjectsIdIssuesIssueIidLinksIssueLinkId
delete:
summary: Delete an issue link
description: Deletes an issue link, thus removes the two-way relationship.
produces:
- application/json
parameters:
- in: path
name: id
description: The ID or URL-encoded path of the project owned by the authenticated user
type: string
required: true
- in: path
name: issue_iid
description: The internal ID of a project’s issue
type: integer
format: int32
required: true
- in: path
name: issue_link_id
description: The ID of an issue relationship
type: string
required: true
responses:
'401':
description: Unauthorized
'204':
description: Delete an issue link
schema:
$ref: '#/definitions/API_Entities_IssueLink'
'404':
description: Not found
tags:
- issues
operationId: deleteApiV4ProjectsIdIssuesIssueIidLinksIssueLinkId
/api/v4/projects/{id}/issues/{issue_iid}/time_estimate:
post:
summary: Set a time estimate for a issue
description: Sets an estimated time of work for this issue.
produces:
- application/json
consumes:
- application/json
parameters:
- in: path
name: id
description: The ID or URL-encoded path of the project
type: string
required: true
- in: path
name: issue_iid
description: The internal ID of the issue.
type: integer
format: int32
required: true
- name: postApiV4ProjectsIdIssuesIssueIidTimeEstimate
in: body
required: true
schema:
$ref: '#/definitions/postApiV4ProjectsIdIssuesIssueIidTimeEstimate'
responses:
'201':
description: Set a time estimate for a issue
schema:
$ref: '#/definitions/API_Entities_IssuableTimeStats'
'401':
description: Unauthorized
'400':
description: Bad request
'404':
description: Not found
tags:
- issues
operationId: postApiV4ProjectsIdIssuesIssueIidTimeEstimate
/api/v4/projects/{id}/issues/{issue_iid}/reset_time_estimate:
post:
summary: Reset the time estimate for a project issue
description: Resets the estimated time for this issue to 0 seconds.
produces:
- application/json
consumes:
- application/json
parameters:
- in: path
name: id
description: The ID or URL-encoded path of the project
type: string
required: true
- in: path
name: issue_iid
description: The internal ID of the issue.
type: integer
format: int32
required: true
responses:
'201':
description: Reset the time estimate for a project issue
schema:
$ref: '#/definitions/API_Entities_IssuableTimeStats'
'401':
description: Unauthorized
'404':
description: Not found
tags:
- issues
operationId: postApiV4ProjectsIdIssuesIssueIidResetTimeEstimate
/api/v4/projects/{id}/issues/{issue_iid}/add_spent_time:
post:
summary: Add spent time for a issue
description: Adds spent time for this issue.
produces:
- application/json
consumes:
- application/json
parameters:
- in: path
name: id
description: The ID or URL-encoded path of the project
type: string
required: true
- in: path
name: issue_iid
description: The internal ID of the issue.
type: integer
format: int32
required: true
- name: postApiV4ProjectsIdIssuesIssueIidAddSpentTime
in: body
required: true
schema:
$ref: '#/definitions/postApiV4ProjectsIdIssuesIssueIidAddSpentTime'
responses:
'201':
description: Add spent time for a issue
schema:
$ref: '#/definitions/API_Entities_IssuableTimeStats'
'401':
description: Unauthorized
'404':
description: Not found
tags:
- issues
operationId: postApiV4ProjectsIdIssuesIssueIidAddSpentTime
/api/v4/projects/{id}/issues/{issue_iid}/reset_spent_time:
post:
summary: Reset spent time for a issue
description: Resets the total spent time for this issue to 0 seconds.
produces:
- application/json
consumes:
- application/json
parameters:
- in: path
name: id
description: The ID or URL-encoded path of the project
type: string
required: true
- in: path
name: issue_iid
description: The internal ID of the issue
type: integer
format: int32
required: true
responses:
'201':
description: Reset spent time for a issue
schema:
$ref: '#/definitions/API_Entities_IssuableTimeStats'
'401':
description: Unauthorized
'404':
description: Not found
tags:
- issues
operationId: postApiV4ProjectsIdIssuesIssueIidResetSpentTime
/api/v4/projects/{id}/issues/{issue_iid}/time_stats:
get:
summary: Get time tracking stats
description: Get time tracking stats
produces:
- application/json
parameters:
- in: path
name: id
description: The ID or URL-encoded path of the project
type: string
required: true
- in: path
name: issue_iid
description: The internal ID of the issue
type: integer
format: int32
required: true
responses:
'200':
description: Get time tracking stats
schema:
$ref: '#/definitions/API_Entities_IssuableTimeStats'
'401':
description: Unauthorized
'404':
description: Not found
tags:
- issues
operationId: getApiV4ProjectsIdIssuesIssueIidTimeStats
/api/v4/projects/{id}/issues/{issue_iid}/related_merge_requests:
get:
description: List merge requests that are related to the issue
produces:
- application/json
parameters:
- in: path
name: id
description: The ID or URL-encoded path of the project
type: string
required: true
- in: path
name: issue_iid
description: The internal ID of a project issue
type: integer
format: int32
required: true
responses:
'200':
description: List merge requests that are related to the issue
schema:
$ref: '#/definitions/API_Entities_MergeRequestBasic'
tags:
- issues
operationId: getApiV4ProjectsIdIssuesIssueIidRelatedMergeRequests
/api/v4/projects/{id}/issues/{issue_iid}/participants:
get:
description: List participants for an issue
produces:
- application/json
parameters:
- in: path
name: id
description: The ID or URL-encoded path of the project
type: string
required: true
- in: path
name: issue_iid
description: The internal ID of a project issue
type: integer
format: int32
required: true
responses:
'200':
description: List participants for an issue
schema:
$ref: '#/definitions/API_Entities_UserBasic'
tags:
- issues
operationId: getApiV4ProjectsIdIssuesIssueIidParticipants
/api/v4/projects/{id}/issues/{issue_iid}/user_agent_detail:
get:
description: Get the user agent details for an issue
produces:
- application/json
parameters:
- in: path
name: id
description: The ID or URL-encoded path of the project
type: string
required: true
- in: path
name: issue_iid
description: The internal ID of a project issue
type: integer
format: int32
required: true
responses:
'200':
description: Get the user agent details for an issue
schema:
$ref: '#/definitions/API_Entities_UserAgentDetail'
tags:
- issues
operationId: getApiV4ProjectsIdIssuesIssueIidUserAgentDetail
/api/v4/issues:
get:
description: Get currently authenticated user's issues
produces:
- application/json
parameters:
- in: query
name: with_labels_details
description: Return titles of labels and other details
type: boolean
default: false
required: false
- in: query
name: state
description: Return opened, closed, or all issues
type: string
default: all
enum:
- opened
- closed
- all
required: false
- in: query
name: closed_by_id
description: Return issues which were closed by the user with the given ID.
type: integer
format: int32
required: false
- in: query
name: order_by
description: Return issues ordered by `created_at`, `due_date`, `label_priority`, `milestone_due`, `popularity`, `priority`, `relative_position`, `title`, or `updated_at` fields.
type: string
default: created_at
enum:
- created_at
- due_date
- label_priority
- milestone_due
- popularity
- priority
- relative_position
- title
- updated_at
- weight
required: false
- in: query
name: sort
description: Return issues sorted in `asc` or `desc` order.
type: string
default: desc
enum:
- asc
- desc
required: false
- in: query
name: due_date
description: 'Return issues that have no due date (`0`), or whose due date is this week, this month, between two weeks ago and next month, or which are overdue. Accepts: `overdue`, `week`, `month`, `next_month_and_previous_two_weeks`, `0`'
type: string
enum:
- '0'
- any
- today
- tomorrow
- overdue
- week
- month
- next_month_and_previous_two_weeks
- ''
required: false
- in: query
name: issue_type
description: 'The type of the issue. Accepts: issue, incident, test_case, requirement, task, ticket'
type: string
enum:
- issue
- incident
- test_case
- requirement
- task
- ticket
required: false
- in: query
name: labels
description: Comma-separated list of label names
type: array
items:
type: string
required: false
- in: query
name: milestone
description: Milestone title
type: string
required: false
- in: query
name: milestone_id
description: Return issues assigned to milestones with the specified timebox value ("Any", "None", "Upcoming" or "Started")
type: string
enum:
- Any
- None
- Upcoming
- Started
required: false
- in: query
name: iids
description: The IID array of issues
type: array
items:
type: integer
format: int32
required: false
- in: query
name: search
description: Search issues for text present in the title, description, or any combination of these
type: string
required: false
- in: query
name: in
description: '`title`, `description`, or a string joining them with comma'
type: string
required: false
- in: query
name: author_id
description: Return issues which are authored by the user with the given ID
type: integer
format: int32
required: false
- in: query
name: author_username
description: Return issues which are authored by the user with the given username
type: string
required: false
- in: query
name: assignee_id
description: Return issues which are assigned to the user with the given ID
type: integer
format: int32
required: false
- in: query
name: assignee_username
description: Return issues which are assigned to the user with the given username
type: array
items:
type: string
required: false
- in: query
name: created_after
description: Return issues created after the specified time
type: string
format: date-time
required: false
- in: query
name: created_before
description: Return issues created before the specified time
type: string
format: date-time
required: false
- in: query
name: updated_after
description: Return issues updated after the specified time
type: string
format: date-time
required: false
- in: query
name: updated_before
description: Return issues updated before the specified time
type: string
format: date-time
required: false
- in: query
name: not[labels]
description: Comma-separated list of label names
type: array
items:
type: string
required: false
- in: query
name: not[milestone]
description: Milestone title
type: string
required: false
- in: query
name: not[milestone_id]
description: Return issues assigned to milestones without the specified timebox value ("Any", "None", "Upcoming" or "Started")
type: string
enum:
- Any
- None
- Upcoming
- Started
required: false
- in: query
name: not[iids]
description: The IID array of issues
type: array
items:
type: integer
format: int32
required: false
- in: query
name: not[author_id]
description: Return issues which are not authored by the user with the given ID
type: integer
format: int32
required: false
- in: query
name: not[author_username]
description: Return issues which are not authored by the user with the given username
type: string
required: false
- in: query
name: not[assignee_id]
description: Return issues which are not assigned to the user with the given ID
type: integer
format: int32
required: false
- in: query
name: not[assignee_username]
description: Return issues which are not assigned to the user with the given username
type: array
items:
type: string
required: false
- in: query
name: not[weight]
description: Return issues without the specified weight
type: integer
format: int32
required: false
- in: query
name: not[iteration_id]
description: Return issues which are not assigned to the iteration with the given ID
type: integer
format: int32
required: false
- in: query
name: not[iteration_title]
description: Return issues which are not assigned to the iteration with the given title
type: string
required: false
- in: query
name: scope
description: 'Return issues for the given scope: `created_by_me`, `assigned_to_me` or `all`'
type: string
default: created_by_me
enum:
- created-by-me
- assigned-to-me
- created_by_me
- assigned_to_me
- all
required: false
- in: query
name: my_reaction_emoji
description: Return issues reacted by the authenticated user by the given emoji
type: string
required: false
- in: query
name: confidential
description: Filter confidential or public issues
type: boolean
required: false
- in: query
name: weight
description: The weight of the issue
type: integer
format: int32
required: false
- in: query
name: epic_id
description: The ID of an epic associated with the issues
type: integer
format: int32
required: false
- in: query
name: health_status
description: 'The health status of the issue. Must be one of: on_track, needs_attention, at_risk, none, any'
type: string
enum:
- on_track
- needs_attention
- at_risk
- none
- any
required: false
- in: query
name: iteration_id
description: Return issues which are assigned to the iteration with the given ID
type: integer
format: int32
required: false
- in: query
name: iteration_title
description: Return issues which are assigned to the iteration with the given title
type: string
required: false
- in: query
name: page
description: Current page number
type: integer
format: int32
default: 1
required: false
example: 1
- in: query
name: per_page
description: Number of items per page
type: integer
format: int32
default: 20
required: false
example: 20
- in: query
name: non_archived
description: Return issues from non archived projects
type: boolean
default: true
required: false
responses:
'200':
description: Get currently authenticated user's issues
schema:
$ref: '#/definitions/API_Entities_Issue'
tags:
- issues
operationId: getApiV4Issues
/api/v4/issues/{id}:
get:
description: Get specified issue (admin only)
produces:
- application/json
parameters:
- in: path
name: id
description: The ID of the Issue
type: string
required: true
responses:
'200':
description: Get specified issue (admin only)
schema:
$ref: '#/definitions/API_Entities_Issue'
tags:
- issues
operationId: getApiV4IssuesId
/api/v4/issues_statistics:
get:
description: Get currently authenticated user's issues statistics
produces:
- application/json
parameters:
- in: query
name: labels
description: Comma-separated list of label names
type: array
items:
type: string
required: false
- in: query
name: milestone
description: Milestone title
type: string
required: false
- in: query
name: milestone_id
description: Return issues assigned to milestones with the specified timebox value ("Any", "None", "Upcoming" or "Started")
type: string
enum:
- Any
- None
- Upcoming
- Started
required: false
- in: query
name: iids
description: The IID array of issues
type: array
items:
type: integer
format: int32
required: false
- in: query
name: search
description: Search issues for text present in the title, description, or any combination of these
type: string
required: false
- in: query
name: in
description: '`title`, `description`, or a string joining them with comma'
type: string
required: false
- in: query
name: author_id
description: Return issues which are authored by the user with the given ID
type: integer
format: int32
required: false
- in: query
name: author_username
description: Return issues which are authored by the user with the given username
type: string
required: false
- in: query
name: assignee_id
description: Return issues which are assigned to the user with the given ID
type: integer
format: int32
required: false
- in: query
name: assignee_username
description: Return issues which are assigned to the user with the given username
type: array
items:
type: string
required: false
- in: query
name: created_after
description: Return issues created after the specified time
type: string
format: date-time
required: false
- in: query
name: created_before
description: Return issues created before the specified time
type: string
format: date-time
required: false
- in: query
name: updated_after
description: Return issues updated after the specified time
type: string
format: date-time
required: false
- in: query
name: updated_before
description: Return issues updated before the specified time
type: string
format: date-time
required: false
- in: query
name: not[labels]
description: Comma-separated list of label names
type: array
items:
type: string
required: false
- in: query
name: not[milestone]
description: Milestone title
type: string
required: false
- in: query
name: not[milestone_id]
description: Return issues assigned to milestones without the specified timebox value ("Any", "None", "Upcoming" or "Started")
type: string
enum:
- Any
- None
- Upcoming
- Started
required: false
- in: query
name: not[iids]
description: The IID array of issues
type: array
items:
type: integer
format: int32
required: false
- in: query
name: not[author_id]
description: Return issues which are not authored by the user with the given ID
type: integer
format: int32
required: false
- in: query
name: not[author_username]
description: Return issues which are not authored by the user with the given username
type: string
required: false
- in: query
name: not[assignee_id]
description: Return issues which are not assigned to the user with the given ID
type: integer
format: int32
required: false
- in: query
name: not[assignee_username]
description: Return issues which are not assigned to the user with the given username
type: array
items:
type: string
required: false
- in: query
name: not[weight]
description: Return issues without the specified weight
type: integer
format: int32
required: false
- in: query
name: not[iteration_id]
description: Return issues which are not assigned to the iteration with the given ID
type: integer
format: int32
required: false
- in: query
name: not[iteration_title]
description: Return issues which are not assigned to the iteration with the given title
type: string
required: false
- in: query
name: scope
description: 'Return issues for the given scope: `created_by_me`, `assigned_to_me` or `all`'
type: string
default: created_by_me
enum:
- created_by_me
- assigned_to_me
- all
required: false
- in: query
name: my_reaction_emoji
description: Return issues reacted by the authenticated user by the given emoji
type: string
required: false
- in: query
name: confidential
description: Filter confidential or public issues
type: boolean
required: false
- in: query
name: weight
description: The weight of the issue
type: integer
format: int32
required: false
- in: query
name: epic_id
description: The ID of an epic associated with the issues
type: integer
format: int32
required: false
- in: query
name: health_status
description: 'The health status of the issue. Must be one of: on_track, needs_attention, at_risk, none, any'
type: string
enum:
- on_track
- needs_attention
- at_risk
- none
- any
required: false
- in: query
name: iteration_id
description: Return issues which are assigned to the iteration with the given ID
type: integer
format: int32
required: false
- in: query
name: iteration_title
description: Return issues which are assigned to the iteration with the given title
type: string
required: false
responses:
'200':
description: Get currently authenticated user's issues statistics
tags:
- issues
operationId: getApiV4IssuesStatistics
definitions:
API_Entities_UserAgentDetail:
type: object
properties:
user_agent:
type: string
example: AppleWebKit/537.36
ip_address:
type: string
example: 127.0.0.1
akismet_submitted:
type: boolean
example: false
required:
- user_agent
- ip_address
- akismet_submitted
description: API_Entities_UserAgentDetail model
API_Entities_CustomAttribute:
type: object
properties:
key:
type: string
example: foo
value:
type: string
example: bar
required:
- key
- value
description: API_Entities_CustomAttribute model
API_Entities_Milestone:
type: object
properties:
id:
type: integer
format: int32
iid:
type: integer
format: int32
project_id:
type: integer
format: int32
group_id:
type: string
title:
type: string
description:
type: string
state:
type: string
created_at:
type: string
updated_at:
type: string
due_date:
type: string
start_date:
type: string
expired:
type: boolean
web_url:
type: string
required:
- id
- iid
- title
- description
- state
- created_at
- updated_at
- due_date
- start_date
- expired
- web_url
API_Entities_Iteration:
type: object
properties:
id:
type: integer
format: int32
example: 1
iid:
type: integer
format: int32
example: 1
sequence:
type: integer
format: int32
example: 1
group_id:
type: integer
format: int32
example: 1
title:
type: string
example: Iteration I
description:
type: string
example: Iteration description
state:
type: integer
format: int32
example: 1
created_at:
type: string
format: date-time
example: '2022-01-31T15:10:45.080Z'
updated_at:
type: string
format: date-time
example: '2022-01-31T15:10:45.080Z'
start_date:
type: string
format: date
example: '2022-01-01'
due_date:
type: string
format: date
example: '2022-01-31'
web_url:
type: string
example: https://gitlab.example.com/groups/gitlab-org/-/iterations/1
required:
- id
- iid
- sequence
- group_id
- title
- description
- state
- created_at
- updated_at
- start_date
- due_date
- web_url
EpicBaseEntity:
type: object
properties:
id:
type: string
iid:
type: string
title:
type: string
url:
type: string
group_id:
type: string
human_readable_end_date:
type: string
human_readable_timestamp:
type: string
required:
- id
- iid
- title
- url
- group_id
API_Entities_MergeRequestBasic:
type: object
properties:
id:
type: integer
format: int32
example: 84
iid:
type: integer
format: int32
example: 14
project_id:
type: integer
format: int32
example: 4
title:
type: string
example: Impedit et ut et dolores vero provident ullam est
description:
type: string
example: Repellendus impedit et vel velit dignissimos.
state:
type: string
example: closed
created_at:
type: string
format: date-
# --- truncated at 32 KB (52 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/gitlab-ci/refs/heads/main/openapi/gitlab-ci-issues-api-openapi.yml