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 ci_triggers API
version: v4
description: Operations related to access requests
host: gitlab.com
produces:
- application/json
tags:
- name: ci_triggers
description: Operations about ci_triggers
paths:
/api/v4/projects/{id}/(ref/{ref}/)trigger/pipeline:
post:
description: Trigger a GitLab project pipeline
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
example: 18
- in: path
name: ref
description: The commit sha or name of a branch or tag
type: string
required: true
example: develop
- name: postApiV4ProjectsId(refRef)triggerPipeline
in: body
required: true
schema:
$ref: '#/definitions/postApiV4ProjectsId(refRef)triggerPipeline'
responses:
'201':
description: Trigger a GitLab project pipeline
schema:
$ref: '#/definitions/API_Entities_Ci_Pipeline'
'400':
description: Bad request
'401':
description: Unauthorized
'403':
description: Forbidden
'404':
description: Not found
tags:
- ci_triggers
operationId: postApiV4ProjectsId(refRef)triggerPipeline
/api/v4/projects/{id}/triggers:
get:
description: Get trigger tokens list
produces:
- application/json
parameters:
- in: path
name: id
description: The ID or URL-encoded path of the project
type: string
required: true
example: 18
- 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
responses:
'200':
description: Get trigger tokens list
schema:
type: array
items:
$ref: '#/definitions/API_Entities_Trigger'
'401':
description: Unauthorized
'403':
description: Forbidden
'404':
description: Not found
tags:
- ci_triggers
operationId: getApiV4ProjectsIdTriggers
post:
description: Create a trigger token
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
example: 18
- name: postApiV4ProjectsIdTriggers
in: body
required: true
schema:
$ref: '#/definitions/postApiV4ProjectsIdTriggers'
responses:
'201':
description: Create a trigger token
schema:
$ref: '#/definitions/API_Entities_Trigger'
'400':
description: Bad request
'401':
description: Unauthorized
'403':
description: Forbidden
'404':
description: Not found
tags:
- ci_triggers
operationId: postApiV4ProjectsIdTriggers
/api/v4/projects/{id}/triggers/{trigger_id}:
get:
description: Get specific trigger token of a project
produces:
- application/json
parameters:
- in: path
name: id
description: The ID or URL-encoded path of the project
type: string
required: true
example: 18
- in: path
name: trigger_id
description: The trigger token ID
type: integer
format: int32
required: true
example: 10
responses:
'200':
description: Get specific trigger token of a project
schema:
$ref: '#/definitions/API_Entities_Trigger'
'401':
description: Unauthorized
'403':
description: Forbidden
'404':
description: Not found
tags:
- ci_triggers
operationId: getApiV4ProjectsIdTriggersTriggerId
put:
description: Update a trigger token
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
example: 18
- in: path
name: trigger_id
description: The trigger token ID
type: integer
format: int32
required: true
- name: putApiV4ProjectsIdTriggersTriggerId
in: body
required: true
schema:
$ref: '#/definitions/putApiV4ProjectsIdTriggersTriggerId'
responses:
'200':
description: Update a trigger token
schema:
$ref: '#/definitions/API_Entities_Trigger'
'400':
description: Bad request
'401':
description: Unauthorized
'403':
description: Forbidden
'404':
description: Not found
tags:
- ci_triggers
operationId: putApiV4ProjectsIdTriggersTriggerId
delete:
description: Delete a trigger token
produces:
- application/json
parameters:
- in: path
name: id
description: The ID or URL-encoded path of the project
type: string
required: true
example: 18
- in: path
name: trigger_id
description: The trigger token ID
type: integer
format: int32
required: true
example: 10
responses:
'204':
description: Delete a trigger token
'401':
description: Unauthorized
'403':
description: Forbidden
'404':
description: Not found
'412':
description: Precondition Failed
tags:
- ci_triggers
operationId: deleteApiV4ProjectsIdTriggersTriggerId
definitions:
postApiV4ProjectsId(refRef)triggerPipeline:
type: object
properties:
token:
type: string
description: The unique token of trigger or job token
example: 6d056f63e50fe6f8c5f8f4aa10edb7
variables:
type: object
description: The list of variables to be injected into build
example:
VAR1: value1
VAR2: value2
inputs:
type: object
description: The list of inputs to be used to create the pipeline.
required:
- token
description: Trigger a GitLab project pipeline
API_Entities_CustomAttribute:
type: object
properties:
key:
type: string
example: foo
value:
type: string
example: bar
required:
- key
- value
description: API_Entities_CustomAttribute model
postApiV4ProjectsIdTriggers:
type: object
properties:
description:
type: string
description: The trigger token description
example: my trigger token description
expires_at:
type: string
format: date-time
description: Timestamp of when the pipeline trigger token expires.
example: '2024-07-01T00:00:00.000Z'
required:
- description
description: Create a trigger token
API_Entities_Ci_Pipeline:
type: object
properties:
id:
type: integer
format: int32
example: 1
iid:
type: integer
format: int32
example: 2
project_id:
type: integer
format: int32
example: 3
sha:
type: string
example: 0ec9e58fdfca6cdd6652c083c9edb53abc0bad52
ref:
type: string
example: feature-branch
status:
type: string
example: success
source:
type: string
example: push
created_at:
type: string
format: date-time
example: '2015-12-24T15:51:21.880Z'
updated_at:
type: string
format: date-time
example: '2015-12-24T17:54:31.198Z'
web_url:
type: string
example: https://gitlab.example.com/gitlab-org/gitlab-foss/-/pipelines/61
before_sha:
type: string
example: a91957a858320c0e17f3a0eca7cfacbff50ea29a
tag:
type: boolean
example: false
yaml_errors:
type: string
example: 'widgets:build: needs ''widgets:test'''
user:
$ref: '#/definitions/API_Entities_UserBasic'
started_at:
type: string
format: date-time
example: '2015-12-24T17:54:30.733Z'
finished_at:
type: string
format: date-time
example: '2015-12-24T17:54:31.198Z'
committed_at:
type: string
format: date-time
example: '2015-12-24T15:51:21.880Z'
duration:
type: integer
format: int32
example: 127
description: Time spent running in seconds
queued_duration:
type: integer
format: int32
example: 63
description: Time spent enqueued in seconds
coverage:
type: number
format: float
example: 98.29
detailed_status:
$ref: '#/definitions/DetailedStatusEntity'
archived:
type: boolean
example: false
required:
- id
- iid
- project_id
- sha
- ref
- status
- source
- created_at
- updated_at
- web_url
- before_sha
- tag
- yaml_errors
- user
- started_at
- finished_at
- committed_at
- duration
- queued_duration
- coverage
- detailed_status
- archived
description: API_Entities_Ci_Pipeline model
DetailedStatusEntity:
type: object
properties:
icon:
type: string
example: status_success
text:
type: string
example: passed
label:
type: string
example: passed
group:
type: string
example: success
tooltip:
type: string
example: passed
has_details:
type: boolean
example: true
details_path:
type: string
example: /test-group/test-project/-/pipelines/287
illustration:
type: object
example:
image: illustrations/empty-state/empty-job-not-triggered-md.svg
size: ''
title: This job has not been triggered yet
content: This job depends on upstream jobs that need to succeed in order for this job to be triggered
favicon:
type: string
example: /assets/ci_favicons/favicon_status_success.png
action:
type: object
properties:
icon:
type: string
example: cancel
title:
type: string
example: Cancel
path:
type: string
example: /namespace1/project1/-/jobs/2/cancel
method:
type: string
example: post
button_title:
type: string
example: Cancel this job
confirmation_message:
type: string
example: Are you sure?
required:
- icon
- title
- path
- method
- button_title
- confirmation_message
required:
- icon
- text
- label
- group
- tooltip
- has_details
- details_path
- illustration
- favicon
putApiV4ProjectsIdTriggersTriggerId:
type: object
properties:
description:
type: string
description: The trigger token description
description: Update a trigger token
API_Entities_UserBasic:
type: object
properties:
id:
type: integer
format: int32
example: 1
username:
type: string
example: admin
public_email:
type: string
example: john@example.com
name:
type: string
example: Administrator
state:
type: string
example: active
locked:
type: boolean
avatar_url:
type: string
example: https://gravatar.com/avatar/1
avatar_path:
type: string
example: /user/avatar/28/The-Big-Lebowski-400-400.png
custom_attributes:
type: array
items:
$ref: '#/definitions/API_Entities_CustomAttribute'
web_url:
type: string
example: https://gitlab.example.com/root
required:
- id
- username
- public_email
- name
- state
- locked
- avatar_url
- web_url
description: API_Entities_UserBasic model
API_Entities_Trigger:
type: object
properties:
id:
type: integer
format: int32
example: 10
token:
type: string
example: 6d056f63e50fe6f8c5f8f4aa10edb7
description:
type: string
example: test
created_at:
type: string
format: date-time
example: '2015-12-24T15:51:21.880Z'
updated_at:
type: string
format: date-time
example: '2015-12-24T17:54:31.198Z'
last_used:
type: string
format: date-time
example: '2015-12-24T17:54:31.198Z'
expires_at:
type: string
format: date-time
example: '2015-12-24T17:54:31.198Z'
owner:
$ref: '#/definitions/API_Entities_UserBasic'
required:
- id
- token
- description
- created_at
- updated_at
- last_used
- expires_at
- owner
description: API_Entities_Trigger model
securityDefinitions:
access_token_header:
type: apiKey
name: PRIVATE-TOKEN
in: header
access_token_query:
type: apiKey
name: private_token
in: query