Use this API to interact with pipeline schedules.

List all pipeline schedules

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

Lists all pipeline schedules for a project.

Parameters

NameTypeDescription
id
Path, required
String or integerThe ID or URL-encoded path of the project
Example: 18
page
Query
IntegerCurrent page number
Default: 1
Example: 1
per_page
Query
IntegerNumber of items per page
Default: 20
Example: 20
scope
Query
StringThe scope of pipeline schedules
Allowed values: active, inactive
Example: active

Responses

CodeDescriptionSchema
200OKAPIEntitiesCiPipelineSchedule
400Bad Request—
401Unauthorized—
403Forbidden—
404Not found—

Create a pipeline schedule

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

Creates a pipeline schedule.

Parameters

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

Request body (application/json)

PropertyTypeDescription
activeBooleanThe activation of pipeline schedule
Default: true
Example: true
cron
Required
StringThe cron
Example: * * * * *
cron_timezoneStringThe timezone
Default: UTC
Example: Asia/Tokyo
description
Required
StringThe description of pipeline schedule
Example: Test schedule pipeline
inputsArray of objectsInputs for the pipeline schedule
inputs[].name
Required
StringThe name of the input
Example: deploy_strategy
inputs[].value
Required
String or array or number or booleanThe value of the input
ref
Required
StringThe branch/tag name will be triggered
Example: develop

Responses

CodeDescriptionSchema
201CreatedAPIEntitiesCiPipelineScheduleDetails
400Bad request—
401Unauthorized—
403Forbidden—
404Not found—

Retrieve a pipeline schedule

GET /api/v4/projects/{id}/pipeline_schedules/{pipeline_schedule_id}

Retrieves a pipeline schedule for a project.

Parameters

NameTypeDescription
id
Path, required
String or integerThe ID or URL-encoded path of the project
Example: 18
pipeline_schedule_id
Path, required
IntegerThe pipeline schedule id
Example: 13

Responses

CodeDescriptionSchema
200OKAPIEntitiesCiPipelineScheduleDetails
400Bad Request—
401Unauthorized—
403Forbidden—
404Not found—

Update a pipeline schedule

PUT /api/v4/projects/{id}/pipeline_schedules/{pipeline_schedule_id}

Updates a pipeline schedule for a project. After the update is done, it is rescheduled automatically.

Parameters

NameTypeDescription
id
Path, required
String or integerThe ID or URL-encoded path of the project
Example: 18
pipeline_schedule_id
Path, required
IntegerThe pipeline schedule id
Example: 13

Request body (application/json)

PropertyTypeDescription
activeBooleanThe activation of pipeline schedule
Example: true
cronStringThe cron
Example: * * * * *
cron_timezoneStringThe timezone
Example: Asia/Tokyo
descriptionStringThe description of pipeline schedule
Example: Test schedule pipeline
inputsArray of objectsInputs for the pipeline schedule
inputs[].destroyBooleanWhether to delete the input
inputs[].name
Required
StringThe name of the input
Example: deploy_strategy
inputs[].value
Required
String or array or number or booleanThe value of the input
refStringThe branch/tag name will be triggered
Example: develop

Responses

CodeDescriptionSchema
200OKAPIEntitiesCiPipelineScheduleDetails
400Bad request—
401Unauthorized—
403Forbidden—
404Not found—

Delete a pipeline schedule

DELETE /api/v4/projects/{id}/pipeline_schedules/{pipeline_schedule_id}

Deletes a pipeline schedule for a project.

Parameters

NameTypeDescription
id
Path, required
String or integerThe ID or URL-encoded path of the project
Example: 18
pipeline_schedule_id
Path, required
IntegerThe pipeline schedule id
Example: 13

Responses

CodeDescriptionSchema
204No Content—
400Bad Request—
401Unauthorized—
403Forbidden—
404Not found—
412Precondition Failed—

List all pipelines triggered by a pipeline schedule

GET /api/v4/projects/{id}/pipeline_schedules/{pipeline_schedule_id}/pipelines

Lists all pipelines triggered by a pipeline schedule in a project.

Parameters

NameTypeDescription
id
Path, required
String or integerThe ID or URL-encoded path of the project
Example: 18
page
Query
IntegerCurrent page number
Default: 1
Example: 1
per_page
Query
IntegerNumber of items per page
Default: 20
Example: 20
pipeline_schedule_id
Path, required
IntegerThe pipeline schedule ID
Example: 13
scope
Query
StringThe scope of pipelines
Allowed values: running, pending, finished, branches, tags
Example: pending
status
Query
StringThe status of pipelines
Allowed values: created, waiting_for_resource, preparing, waiting_for_callback, pending, running, success, failed, canceling, canceled, skipped, manual, scheduled
Example: pending
updated_before
Query
String (date-time)Return pipelines updated before the specified datetime. Format: ISO 8601 YYYY-MM-DDTHH:MM:SSZ
Example: 2015-12-24T15:51:21.880Z
updated_after
Query
String (date-time)Return pipelines updated after the specified datetime. Format: ISO 8601 YYYY-MM-DDTHH:MM:SSZ
Example: 2015-12-24T15:51:21.880Z
created_before
Query
String (date-time)Return pipelines created before the specified datetime. Format: ISO 8601 YYYY-MM-DDTHH:MM:SSZ
Example: 2015-12-24T15:51:21.880Z
created_after
Query
String (date-time)Return pipelines created after the specified datetime. Format: ISO 8601 YYYY-MM-DDTHH:MM:SSZ
Example: 2015-12-24T15:51:21.880Z
sort
Query
StringSort pipelines
Allowed values: asc, desc
Default: asc
Example: desc

Responses

CodeDescriptionSchema
200OKAPIEntitiesCiPipelineBasic
400Bad Request—
401Unauthorized—
403Forbidden—
404Not found—

Run a pipeline schedule

POST /api/v4/projects/{id}/pipeline_schedules/{pipeline_schedule_id}/play

Runs a pipeline schedule immediately. The next scheduled run of this pipeline is not affected.

Parameters

NameTypeDescription
id
Path, required
String or integerThe ID or URL-encoded path of the project
Example: 18
pipeline_schedule_id
Path, required
IntegerThe pipeline schedule id
Example: 13

Responses

CodeDescriptionSchema
201Created—
400Bad Request—
401Unauthorized—
403Forbidden—
404Not found—

Create or update ownership of a pipeline schedule

POST /api/v4/projects/{id}/pipeline_schedules/{pipeline_schedule_id}/take_ownership

Creates or updates the owner of a pipeline schedule for a project.

Parameters

NameTypeDescription
id
Path, required
String or integerThe ID or URL-encoded path of the project
Example: 18
pipeline_schedule_id
Path, required
IntegerThe pipeline schedule id
Example: 13

Responses

CodeDescriptionSchema
201CreatedAPIEntitiesCiPipelineScheduleDetails
400Bad request—
401Unauthorized—
403Forbidden—
404Not found—

Create a variable for a pipeline schedule

POST /api/v4/projects/{id}/pipeline_schedules/{pipeline_schedule_id}/variables

Creates a variable for a pipeline schedule.

Parameters

NameTypeDescription
id
Path, required
String or integerThe ID or URL-encoded path of the project
Example: 18
pipeline_schedule_id
Path, required
IntegerThe pipeline schedule id
Example: 13

Request body (application/json)

PropertyTypeDescription
key
Required
StringThe key of the variable
Example: NEW_VARIABLE
value
Required
StringThe value of the variable
Example: new value
variable_typeStringThe type of variable, must be one of env_var or file. Defaults to env_var
Allowed values: env_var, file

Responses

CodeDescriptionSchema
201CreatedAPIEntitiesCiVariable
400Bad request—
401Unauthorized—
403Forbidden—
404Not found—

Retrieve a variable for a pipeline schedule

GET /api/v4/projects/{id}/pipeline_schedules/{pipeline_schedule_id}/variables/{key}

Retrieves a specified variable for a pipeline schedule.

Parameters

NameTypeDescription
id
Path, required
String or integerThe ID or URL-encoded path of the project
Example: 18
pipeline_schedule_id
Path, required
IntegerThe pipeline schedule id
Example: 13
key
Path, required
StringThe key of the variable
Example: NEW_VARIABLE

Responses

CodeDescriptionSchema
200OKAPIEntitiesCiVariable
400Bad Request—
401Unauthorized—
403Forbidden—
404Not found—

Update a variable for a pipeline schedule

PUT /api/v4/projects/{id}/pipeline_schedules/{pipeline_schedule_id}/variables/{key}

Updates a variable for a pipeline schedule.

Parameters

NameTypeDescription
id
Path, required
String or integerThe ID or URL-encoded path of the project
Example: 18
pipeline_schedule_id
Path, required
IntegerThe pipeline schedule id
Example: 13
key
Path, required
StringThe key of the variable
Example: NEW_VARIABLE

Request body (application/json)

PropertyTypeDescription
valueStringThe value of the variable
Example: new value
variable_typeStringThe type of variable, must be one of env_var or file
Allowed values: env_var, file

Responses

CodeDescriptionSchema
200OKAPIEntitiesCiVariable
400Bad request—
401Unauthorized—
403Forbidden—
404Not found—

Delete a variable for a pipeline schedule

DELETE /api/v4/projects/{id}/pipeline_schedules/{pipeline_schedule_id}/variables/{key}

Deletes a specified variable for a pipeline schedule.

Parameters

NameTypeDescription
id
Path, required
String or integerThe ID or URL-encoded path of the project
Example: 18
pipeline_schedule_id
Path, required
IntegerThe pipeline schedule id
Example: 13
key
Path, required
StringThe key of the variable
Example: NEW_VARIABLE

Responses

CodeDescriptionSchema
202AcceptedAPIEntitiesCiVariable
400Bad Request—
401Unauthorized—
403Forbidden—
404Not found—

Schemas

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

APIEntitiesCiInput

PropertyTypeDescription
nameString—
valueString—

APIEntitiesCiPipelineBasic

PropertyTypeDescription
created_atString (date-time)Example: 2022-10-21T16:49:48.000+02:00
idInteger (int64)Example: 1
iidIntegerExample: 2
project_idInteger (int64)Example: 3
refStringExample: feature-branch
shaStringExample: 0ec9e58fdfca6cdd6652c083c9edb53abc0bad52
sourceStringExample: push
statusStringExample: success
updated_atString (date-time)Example: 2022-10-21T16:49:48.000+02:00
web_urlStringExample: https://gitlab.example.com/gitlab-org/gitlab-foss/-/pipelines/61

APIEntitiesCiPipelineSchedule

PropertyTypeDescription
activeBooleanExample: true
created_atString (date-time)Example: 2017-05-19T13:31:08.849Z
cronStringExample: * * * * *
cron_timezoneStringExample: Asia/Tokyo
descriptionStringExample: Test schedule pipeline
idInteger (int64)Example: 13
inputsAPIEntitiesCiInput—
next_run_atString (date-time)Example: 2017-05-19T13:41:00.000Z
ownerAPIEntitiesUserBasic—
refStringExample: develop
updated_atString (date-time)Example: 2017-05-19T13:40:17.727Z

APIEntitiesCiPipelineScheduleDetails

PropertyTypeDescription
activeBooleanExample: true
created_atString (date-time)Example: 2017-05-19T13:31:08.849Z
cronStringExample: * * * * *
cron_timezoneStringExample: Asia/Tokyo
descriptionStringExample: Test schedule pipeline
idInteger (int64)Example: 13
inputsAPIEntitiesCiInput—
last_pipelineAPIEntitiesCiPipelineBasic—
next_run_atString (date-time)Example: 2017-05-19T13:41:00.000Z
ownerAPIEntitiesUserBasic—
refStringExample: develop
updated_atString (date-time)Example: 2017-05-19T13:40:17.727Z
variablesAPIEntitiesCiVariable—

APIEntitiesCiVariable

PropertyTypeDescription
descriptionStringExample: This variable is being used for ...
environment_scopeStringExample: *
hiddenBoolean—
keyStringExample: TEST_VARIABLE_1
maskedBoolean—
protectedBoolean—
rawBoolean—
valueStringExample: TEST_1
variable_typeStringExample: env_var

APIEntitiesCustomAttribute

PropertyTypeDescription
keyStringExample: foo
valueStringExample: bar

APIEntitiesUserBasic

PropertyTypeDescription
avatar_pathStringExample: /user/avatar/28/The-Big-Lebowski-400-400.png
avatar_urlStringExample: https://gravatar.com/avatar/1
custom_attributesArray of APIEntitiesCustomAttribute—
idInteger (int64)Example: 1
lockedBoolean—
nameStringExample: Administrator
public_emailStringExample: john@example.com
stateStringExample: active
usernameStringExample: admin
web_urlStringExample: https://gitlab.example.com/root