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. The inputs field is included only for users with the Maintainer or Owner role, or for the schedule owner.

Parameters

NameTypeDescription
id
Path, required
String or integerID or URL-encoded path of the project
Example: 18
page
Query
IntegerPage number of results to retrieve
Default: 1
Example: 1
per_page
Query
IntegerNumber of items to list per page
Default: 20
Example: 20
scope
Query
StringScope of pipeline schedules
Allowed values: active, inactive
Example: active

Responses

CodeDescriptionSchema
200OKArray of APIEntitiesCiPipelineSchedule
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 integerID or URL-encoded path of the project
Example: 18

Request body (application/json)

PropertyTypeDescription
activeBooleanIf true, activates the pipeline schedule. If false, the pipeline schedule is initially deactivated
Default: true
Example: true
cron
Required
StringCron schedule, for example 0 1 * * *
Example: * * * * *
cron_timezoneStringTime zone supported by ActiveSupport::TimeZone, for example Pacific Time (US & Canada), or TZInfo::Timezone, for example America/Los_Angeles
Default: UTC
Example: Asia/Tokyo
description
Required
StringDescription of the pipeline schedule
Example: Test schedule pipeline
inputsArray of objectsArray of inputs to pass to the pipeline schedule. Each input has a name and a value, which can be a string, array, number, or boolean. To delete an existing input, include the name field and set destroy to true. Introduced in GitLab 17.11
inputs[].name
Required
StringName of the input
Example: deploy_strategy
inputs[].value
Required
String or array or number or booleanValue of the input
ref
Required
StringBranch or tag name that triggers the pipeline. Accepts either short refs (main) or full refs (refs/heads/main or refs/tags/main). Short refs are automatically expanded to full refs, unless the value could match either a branch or a tag
Example: develop

Responses

CodeDescriptionSchema
201CreatedAPIEntitiesCiPipelineScheduleDetails
400Bad request—
401Unauthorized—
403Forbidden—
404Not found—
429Too Many Requests—

Retrieve a pipeline schedule

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

Retrieves a pipeline schedule for a project. The inputs and variables fields are included only for users with the Maintainer or Owner role, or for the schedule owner.

Parameters

NameTypeDescription
id
Path, required
String or integerID or URL-encoded path of the project
Example: 18
pipeline_schedule_id
Path, required
IntegerID of the pipeline schedule
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 integerID or URL-encoded path of the project
Example: 18
pipeline_schedule_id
Path, required
IntegerID of the pipeline schedule
Example: 13

Request body (application/json)

PropertyTypeDescription
activeBooleanIf true, activates the pipeline schedule. If false, the pipeline schedule is initially deactivated
Example: true
cronStringCron schedule, for example 0 1 * * *
Example: * * * * *
cron_timezoneStringTime zone supported by ActiveSupport::TimeZone, for example Pacific Time (US & Canada), or TZInfo::Timezone, for example America/Los_Angeles
Example: Asia/Tokyo
descriptionStringDescription of the pipeline schedule
Example: Test schedule pipeline
inputsArray of objectsArray of inputs to pass to the pipeline schedule. Each input has a name and a value, which can be a string, array, number, or boolean. To delete an existing input, include the name field and set destroy to true
inputs[].destroyBooleanIf true, deletes the input
inputs[].name
Required
StringName of the input
Example: deploy_strategy
inputs[].value
Required
String or array or number or booleanValue of the input
refStringBranch or tag name that triggers the pipeline. Accepts either short refs (main) or full refs (refs/heads/main or refs/tags/main). Short refs are automatically expanded to full refs, unless the value could match either a branch or a tag
Example: develop

Responses

CodeDescriptionSchema
200OKAPIEntitiesCiPipelineScheduleDetails
400Bad request—
401Unauthorized—
403Forbidden—
404Not found—
429Too Many Requests—

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 integerID or URL-encoded path of the project
Example: 18
pipeline_schedule_id
Path, required
IntegerID of the pipeline schedule
Example: 13

Responses

CodeDescriptionSchema
204No Content—
400Bad request—
401Unauthorized—
403Forbidden—
404Not found—
412Precondition Failed—
429Too Many Requests—

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 integerID or URL-encoded path of the project
Example: 18
page
Query
IntegerPage number of results to retrieve
Default: 1
Example: 1
per_page
Query
IntegerNumber of items to list per page
Default: 20
Example: 20
pipeline_schedule_id
Path, required
IntegerID of the pipeline schedule
Example: 13
scope
Query
StringReturn pipelines in the specified scope
Allowed values: running, pending, finished, branches, tags
Example: pending
status
Query
StringReturn pipelines with the specified status
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 on or before the specified time
Example: 2015-12-24T15:51:21.880Z
updated_after
Query
String (date-time)Return pipelines updated on or after the specified time
Example: 2015-12-24T15:51:21.880Z
created_before
Query
String (date-time)Return pipelines created before the specified time
Example: 2015-12-24T15:51:21.880Z
created_after
Query
String (date-time)Return pipelines created after the specified time
Example: 2015-12-24T15:51:21.880Z
sort
Query
StringSort results in ascending or descending order
Allowed values: asc, desc
Default: asc
Example: desc

Responses

CodeDescriptionSchema
200OKArray of APIEntitiesCiPipelineBasic
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. This endpoint has a rate limit of one request per minute for each user for a given pipeline schedule.

Parameters

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

Responses

CodeDescriptionSchema
201Created—
400Bad Request—
401Unauthorized—
403Forbidden—
404Not found—
429Too Many Requests—

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 integerID or URL-encoded path of the project
Example: 18
pipeline_schedule_id
Path, required
IntegerID of the pipeline schedule
Example: 13

Responses

CodeDescriptionSchema
201CreatedAPIEntitiesCiPipelineScheduleDetails
400Bad request—
401Unauthorized—
403Forbidden—
404Not found—
429Too Many Requests—

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 integerID or URL-encoded path of the project
Example: 18
pipeline_schedule_id
Path, required
IntegerID of the pipeline schedule
Example: 13

Request body (application/json)

PropertyTypeDescription
key
Required
StringKey of the pipeline schedule variable. Must be 255 characters or fewer and contain only A-Z, a-z, 0-9, and _
Example: NEW_VARIABLE
value
Required
StringValue of the variable
Example: new value
variable_typeStringType of the variable. 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. This feature was introduced in GitLab 18.7.

Parameters

NameTypeDescription
id
Path, required
String or integerID or URL-encoded path of the project
Example: 18
pipeline_schedule_id
Path, required
IntegerID of the pipeline schedule
Example: 13
key
Path, required
StringKey of the pipeline schedule variable. Must be 255 characters or fewer and contain only A-Z, a-z, 0-9, and _
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 integerID or URL-encoded path of the project
Example: 18
pipeline_schedule_id
Path, required
IntegerID of the pipeline schedule
Example: 13
key
Path, required
StringKey of the pipeline schedule variable. Must be 255 characters or fewer and contain only A-Z, a-z, 0-9, and _
Example: NEW_VARIABLE

Request body (application/json)

PropertyTypeDescription
valueStringValue of the variable
Example: new value
variable_typeStringType of the variable. Defaults to env_var
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 integerID or URL-encoded path of the project
Example: 18
pipeline_schedule_id
Path, required
IntegerID of the pipeline schedule
Example: 13
key
Path, required
StringKey of the pipeline schedule variable. Must be 255 characters or fewer and contain only A-Z, a-z, 0-9, and _
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)Timestamp when the pipeline was created
Example: 2022-10-21T16:49:48.000+02:00
idInteger (int64)ID of the pipeline
Example: 1
iidIntegerInternal ID of the pipeline
Example: 2
project_idInteger (int64)ID of the project of the pipeline
Example: 3
refStringGit reference of the pipeline
Example: feature-branch
shaStringSHA of the commit the pipeline runs for
Example: 0ec9e58fdfca6cdd6652c083c9edb53abc0bad52
sourceStringSource that triggered the pipeline
Example: push
statusStringStatus of the pipeline
Example: success
updated_atString (date-time)Timestamp when the pipeline was last updated
Example: 2022-10-21T16:49:48.000+02:00
web_urlStringURL of the pipeline in the GitLab UI
Example: 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
inputsArray of APIEntitiesCiInput—
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
inputsArray of APIEntitiesCiInput—
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
variablesArray of APIEntitiesCiVariable—

APIEntitiesCiVariable

PropertyTypeDescription
descriptionStringExample: This variable is being used for ...
environment_scopeStringExample: *
hiddenBoolean—
keyStringKey of the variable
Example: TEST_VARIABLE_1
maskedBoolean—
protectedBoolean—
rawBooleanWhether the variable is treated as a raw string. When false, variable references in the value are expanded
valueStringValue of the variable
Example: TEST_1
variable_typeStringType of the variable. Either env_var or file
Example: env_var

APIEntitiesCustomAttribute

PropertyTypeDescription
keyStringExample: foo
valueStringExample: bar

APIEntitiesUserBasic

PropertyTypeDescription
avatar_pathStringExample: /user/avatar/28/The-Big-Lebowski-400-400.png
avatar_urlStringURL of the user’s avatar
Example: https://gravatar.com/avatar/1
custom_attributesArray of APIEntitiesCustomAttribute—
idInteger (int64)ID of the user
Example: 1
lockedBooleanIf true, the user account is locked, and the user cannot sign in until the lock expires or an administrator unlocks the account
nameStringName of the user. For a bot user, **** if the current user cannot read the bot’s project or group
Example: Administrator
public_emailStringPublic email address of the user
Example: john@example.com
stateStringState of the user account. Possible values: active, blocked, ldap_blocked, blocked_pending_approval, banned, or deactivated
Example: active
usernameStringUsername of the user
Example: admin
web_urlStringURL of the user’s profile
Example: https://gitlab.example.com/root