pipeline_schedules

Create a pipeline schedule

Creates a pipeline schedule.

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

Request

  • Base URL
    https://gitlab.com
  • Auth
    none declared

Path parameters

idstring required

The ID or URL-encoded path of the project

Request body

descriptionstring required

The description of pipeline schedule

refstring required

The branch/tag name will be triggered

cronstring required

The cron

cron_timezonestring

The timezone

activeboolean

The activation of pipeline schedule

Example request

{
  "description": "Test schedule pipeline",
  "ref": "develop",
  "cron": "* * * * *",
  "cron_timezone": "Asia/Tokyo",
  "active": true,
  "inputs": [
    {
      "name": "array_input",
      "value": [
        1,
        2
      ]
    },
    {
      "name": "boolean_input",
      "value": true
    }
  ]
}

Response

Create a pipeline schedule

idinteger required
descriptionstring required
refstring required
cronstring required
cron_timezonestring required
next_run_atstring date-time required
activeboolean required
created_atstring date-time required
updated_atstring date-time required

Example response

{
  "id": 13,
  "description": "Test schedule pipeline",
  "ref": "develop",
  "cron": "* * * * *",
  "cron_timezone": "Asia/Tokyo",
  "next_run_at": "2017-05-19T13:41:00.000Z",
  "active": true,
  "created_at": "2017-05-19T13:31:08.849Z",
  "updated_at": "2017-05-19T13:40:17.727Z",
  "owner": {
    "id": 1,
    "username": "admin",
    "public_email": "john@example.com",
    "name": "Administrator",
    "state": "active",
    "avatar_url": "https://gravatar.com/avatar/1",
    "avatar_path": "/user/avatar/28/The-Big-Lebowski-400-400.png",
    "custom_attributes": [
      {
        "key": "foo",
        "value": "bar"
      }
    ],
    "web_url": "https://gitlab.example.com/root"
  },
  "last_pipeline": {
    "id": 1,
    "iid": 2,
    "project_id": 3,
    "sha": "0ec9e58fdfca6cdd6652c083c9edb53abc0bad52",
    "ref": "feature-branch",
    "status": "success",
    "source": "push",
    "created_at": "2022-10-21T16:49:48.000+02:00",
    "updated_at": "2022-10-21T16:49:48.000+02:00",
    "web_url": "https://gitlab.example.com/gitlab-org/gitlab-foss/-/pipelines/61"
  },
  "variables": {
    "variable_type": "env_var",
    "key": "TEST_VARIABLE_1",
    "value": "TEST_1",
    "environment_scope": "*",
    "description": "This variable is being used for ..."
  }
}

Changes

No recorded changes to this operation across all 5 revisions of this API.