---
title: "Create a schedule"
method: POST
path: "/repositories/{workspace}/{repo_slug}/pipelines_config/schedules"
tags: ["Pipelines"]
---

# Create a schedule

`POST /repositories/{workspace}/{repo_slug}/pipelines_config/schedules`

## Request

- Base URL: `https://api.bitbucket.org/2.0`
- URL: `https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/pipelines_config/schedules`
- Auth: one of:
  - OAuth 2
    - Authorization code: `https://bitbucket.org/site/oauth2/authorize`
    - Token URL: `https://bitbucket.org/site/oauth2/access_token` scopes: `pipeline:write`
  - HTTP basic
  - API key in header `Authorization`

Create a schedule for the given repository.

## Path parameters

- `workspace` string, required
- `repo_slug` string, required

## Request body

- PipelineSchedulePostRequestBody: Base type for most resource objects. It defines the common `type` element that identifies an object's type. It also identifies the element as Swagger's `discriminator`.
  - `type` string, required
  - `target` object, required: The target on which the schedule will be executed.
    - `selector` PipelineSelector, required: A representation of the selector that was used to identify the pipeline in the YML file.
      - `type` 'branches' | 'tags' | 'bookmarks' | 'default' | 'custom', required: The type of selector.
      - `pattern` string: The name of the matching pipeline definition.
    - `ref_name` string, required: The name of the reference.
    - `ref_type` 'branch', required: The type of reference (branch only).
  - `enabled` boolean: Whether the schedule is enabled.
  - `cron_pattern` string, required: The cron expression with second precision (7 fields) that the schedule applies. For example, for expression: 0 0 12 * * ? *, will execute at 12pm UTC every day.

## Response `201`

The created schedule.

- PipelineSchedule: A Pipelines schedule.
  - `type` string, required
  - `uuid` string: The UUID identifying the schedule.
  - `enabled` boolean: Whether the schedule is enabled.
  - `target` PipelineRefTarget: A Bitbucket Pipelines reference target.
    - `type` string, required
    - `ref_type` 'branch' | 'tag' | 'named_branch' | 'bookmark': The type of reference (branch/tag).
    - `ref_name` string: The name of the reference.
    - `commit` Commit: A repository commit object.
      - `type` string, required
      - `hash` string
      - `date` string, date-time
      - `author` Author: The author of a change in a repository
        - `type` string, required
        - `raw` string: The raw author value from the repository. This may be the only value available if the author does not match a user in Bitbucket.
        - `user` Account: An account object.
          - `type` string, required
          - `links` AccountLinks: Links related to an Account.
            - `avatar` Link: A link to a resource related to this object.
              - …
          - `created_on` string, date-time
          - `display_name` string
          - `uuid` string
      - `committer` Committer: The committer of a change in a repository
        - `type` string, required
        - `raw` string: The raw committer value from the repository. This may be the only value available if the committer does not match a user in Bitbucket.
        - `user` Account: An account object.
          - `type` string, required
          - `links` AccountLinks: Links related to an Account.
            - `avatar` Link: A link to a resource related to this object.
              - …
          - `created_on` string, date-time
          - `display_name` string
          - `uuid` string
      - `message` string
      - `summary` object
        - `raw` string: The text as it was typed by a user.
        - `markup` 'markdown' | 'creole' | 'plaintext': The type of markup language the raw content is to be interpreted in.
        - `html` string: The user's content rendered as HTML.
      - `parents` BaseCommit[]
        - `type` string, required
        - `hash` string
        - `date` string, date-time
        - `author` Author: The author of a change in a repository
          - `type` string, required
          - `raw` string: The raw author value from the repository. This may be the only value available if the author does not match a user in Bitbucket.
          - `user` Account: An account object.
            - `type` string, required
            - `links` AccountLinks: Links related to an Account.
              - …
            - `created_on` string, date-time
            - `display_name` string
            - `uuid` string
        - `committer` Committer: The committer of a change in a repository
          - `type` string, required
          - `raw` string: The raw committer value from the repository. This may be the only value available if the committer does not match a user in Bitbucket.
          - `user` Account: An account object.
            - `type` string, required
            - `links` AccountLinks: Links related to an Account.
              - …
            - `created_on` string, date-time
            - `display_name` string
            - `uuid` string
        - `message` string
        - `summary` object
          - `raw` string: The text as it was typed by a user.
          - `markup` 'markdown' | 'creole' | 'plaintext': The type of markup language the raw content is to be interpreted in.
          - `html` string: The user's content rendered as HTML.
        - `parents` BaseCommit[]
      - `repository` Repository: A Bitbucket repository.
        - `type` string, required
        - `links` object
          - `self` object: A link to a resource related to this object.
            - `href` string, uri
            - `name` string
          - `html` object: A link to a resource related to this object.
            - `href` string, uri
            - `name` string
          - `avatar` object: A link to a resource related to this object.
            - `href` string, uri
            - `name` string
          - `pullrequests` object: A link to a resource related to this object.
            - `href` string, uri
            - `name` string
          - `commits` object: A link to a resource related to this object.
            - `href` string, uri
            - `name` string
          - `forks` object: A link to a resource related to this object.
            - `href` string, uri
            - `name` string
          - `watchers` object: A link to a resource related to this object.
            - `href` string, uri
            - `name` string
          - `downloads` object: A link to a resource related to this object.
            - `href` string, uri
            - `name` string
          - `clone` object[]
            - `href` string, uri
            - `name` string
          - `hooks` object: A link to a resource related to this object.
            - `href` string, uri
            - `name` string
        - `uuid` string: The repository's immutable id. This can be used as a substitute for the slug segment in URLs. Doing this guarantees your URLs will survive renaming of the repository by its owner, or even transfer of the repository to a different user.
        - `full_name` string: The concatenation of the repository owner's username and the slugified name, e.g. "evzijst/interruptingcow". This is the same string used in Bitbucket URLs.
        - `is_private` boolean
        - `parent` Repository (recursive)
        - `scm` 'git'
        - `owner` Account: An account object.
          - `type` string, required
          - `links` AccountLinks: Links related to an Account.
            - `avatar` Link: A link to a resource related to this object.
              - …
          - `created_on` string, date-time
          - `display_name` string
          - `uuid` string
        - `name` string
        - `description` string
        - `created_on` string, date-time
        - `updated_on` string, date-time
        - `size` integer
        - `language` string
        - `has_issues` boolean: The issue tracker for this repository is enabled. Issue Tracker features are not supported for repositories in workspaces administered through admin.atlassian.com.
        - `has_wiki` boolean: The wiki for this repository is enabled. Wiki features are not supported for repositories in workspaces administered through admin.atlassian.com.
        - `fork_policy` 'allow_forks' | 'no_public_forks' | 'no_forks': Controls the rules for forking this repository. * **allow_forks**: unrestricted forking * **no_public_forks**: restrict forking to private forks (forks cannot be made public later) * **no_forks**: deny all forking
        - `project` Project: A Bitbucket project. Projects are used by teams to organize repositories.
          - `type` string, required
          - `links` object
            - `html` object: A link to a resource related to this object.
              - …
            - `avatar` object: A link to a resource related to this object.
              - …
          - `uuid` string: The project's immutable id.
          - `key` string: The project's key.
          - `owner` Team: A team object.
            - `type` string, required
            - `links` object: Links related to a Team.
              - …
            - `created_on` string, date-time
            - `display_name` string
            - `uuid` string
          - `name` string: The name of the project.
          - `description` string
          - `is_private` boolean: Indicates whether the project is publicly accessible, or whether it is private to the team and consequently only visible to team members. Note that private projects cannot contain public repositories.
          - `created_on` string, date-time
          - `updated_on` string, date-time
          - `has_publicly_visible_repos` boolean: Indicates whether the project contains publicly visible repositories. Note that private projects cannot contain public repositories.
        - `mainbranch` Branch: A branch object, representing a branch in a repository.
          - `type` string, required
          - `links` object
            - `self` object: A link to a resource related to this object.
              - …
            - `commits` object: A link to a resource related to this object.
              - …
            - `html` object: A link to a resource related to this object.
              - …
          - `name` string: The name of the ref.
          - `target` Commit (recursive)
          - `merge_strategies` string[]: Available merge strategies for pull requests targeting this branch.
          - `default_merge_strategy` string: The default merge strategy for pull requests targeting this branch.
      - `participants` Participant[]
        - `type` string, required
        - `user` Account: An account object.
          - `type` string, required
          - `links` AccountLinks: Links related to an Account.
            - `avatar` Link: A link to a resource related to this object.
              - …
          - `created_on` string, date-time
          - `display_name` string
          - `uuid` string
        - `role` 'PARTICIPANT' | 'REVIEWER'
        - `approved` boolean
        - `state` string
        - `participated_on` string, date-time: The ISO8601 timestamp of the participant's action. For approvers, this is the time of their approval. For commenters and pull request reviewers who are not approvers, this is the time they last commented, or null if they have not commented.
    - `selector` PipelineSelector: A representation of the selector that was used to identify the pipeline in the YML file.
      - `type` 'branches' | 'tags' | 'bookmarks' | 'default' | 'custom', required: The type of selector.
      - `pattern` string: The name of the matching pipeline definition.
  - `cron_pattern` string: The cron expression with second precision (7 fields) that the schedule applies. For example, for expression: 0 0 12 * * ? *, will execute at 12pm UTC every day.
  - `created_on` string, date-time: The timestamp when the schedule was created.
  - `updated_on` string, date-time: The timestamp when the schedule was updated.

## Other responses

- `400`: There were errors validating the request.
- `401`: The maximum limit of schedules for this repository was reached.
- `404`: The account or repository was not found.

## Changes

- **2026-07-13** `d344164ecb11`: 2 warning, 1 info
  - removed the optional property `allOf[subschema #2: Pipeline Schedule]/target/allOf[subschema #2: Pipeline Ref Target]/commit/allOf[#/components/schemas/base_commit]/allOf[subschema #2: Base Commit]/author/allOf[subschema #2: Author]/user/allOf[subschema #2: Account]/username` from the response with the `201` status
  - removed the optional property `allOf[subschema #2: Pipeline Schedule]/target/allOf[subschema #2: Pipeline Ref Target]/commit/allOf[subschema #2: Commit]/participants/items/allOf[subschema #2: Participant]/user/allOf[subschema #2: Account]/username` from the response with the `201` status
  - added the optional property `allOf[subschema #2: Pipeline Schedule]/target/allOf[subschema #2: Pipeline Ref Target]/commit/allOf[#/components/schemas/base_commit]/allOf[subschema #2: Base Commit]/committer` to the response with the `201` status

[Operation history](https://skmtc.dev/atlassian/apis/bitbucket-api/changes/repositories/:workspace/:repo_slug/pipelines_config/schedules/post.md)

---

[API](https://skmtc.dev/atlassian/apis/bitbucket-api.md) - [All operations](https://skmtc.dev/atlassian/apis/bitbucket-api/llms.txt) - [OpenAPI document](https://skmtc.dev/atlassian/apis/bitbucket-api/revisions/6ae783fa75da?raw)
