---
title: "Create a pull request"
method: POST
path: "/repositories/{workspace}/{repo_slug}/pullrequests"
tags: ["Pullrequests"]
---

# Create a pull request

`POST /repositories/{workspace}/{repo_slug}/pullrequests`

Creates a new pull request where the destination repository is
this repository and the author is the authenticated user.

The minimum required fields to create a pull request are `title` and
`source`, specified by a branch name.

```
curl https://api.bitbucket.org/2.0/repositories/my-workspace/my-repository/pullrequests \
    -u my-username:my-password \
    --request POST \
    --header 'Content-Type: application/json' \
    --data '{
        "title": "My Title",
        "source": {
            "branch": {
                "name": "staging"
            }
        }
    }'
```

If the pull request's `destination` is not specified, it will default
to the `repository.mainbranch`. To open a pull request to a
different branch, say from a feature branch to a staging branch,
specify a `destination` (same format as the `source`):

```
{
    "title": "My Title",
    "source": {
        "branch": {
            "name": "my-feature-branch"
        }
    },
    "destination": {
        "branch": {
            "name": "staging"
        }
    }
}
```

Reviewers can be specified by adding an array of user objects as the
`reviewers` property.

```
{
    "title": "My Title",
    "source": {
        "branch": {
            "name": "my-feature-branch"
        }
    },
    "reviewers": [
        {
            "uuid": "{504c3b62-8120-4f0c-a7bc-87800b9d6f70}"
        }
    ]
}
```

Other fields:

* `description` - a string
* `close_source_branch` - boolean that specifies if the source branch should be closed upon merging
* `draft` - boolean that specifies whether the pull request is a draft

## Request body

- Pullrequest — A pull request object.
  - `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
    - `commits` object — A link to a resource related to this object.
      - `href` string, uri
      - `name` string
    - `approve` object — A link to a resource related to this object.
      - `href` string, uri
      - `name` string
    - `diff` object — A link to a resource related to this object.
      - `href` string, uri
      - `name` string
    - `diffstat` object — A link to a resource related to this object.
      - `href` string, uri
      - `name` string
    - `comments` object — A link to a resource related to this object.
      - `href` string, uri
      - `name` string
    - `activity` object — A link to a resource related to this object.
      - `href` string, uri
      - `name` string
    - `merge` object — A link to a resource related to this object.
      - `href` string, uri
      - `name` string
    - `decline` object — A link to a resource related to this object.
      - `href` string, uri
      - `name` string
  - `id` integer — The pull request's unique ID. Note that pull request IDs are only unique within their associated repository.
  - `title` string — Title of the pull request.
  - `rendered` object — User provided pull request text, interpreted in a markup language and rendered in HTML
    - `title` 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.
    - `description` 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.
    - `reason` 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.
  - `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.
  - `state` 'OPEN' | 'MERGED' | 'DECLINED' | 'SUPERSEDED' — The pull request's current status.
  - `author` 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.
        - `href` string, uri
        - `name` string
    - `created_on` string, date-time
    - `display_name` string
    - `uuid` string
  - `source` PullrequestEndpoint
    - `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.
            - `href` string, uri
            - `name` string
        - `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.
            - `href` string, uri
            - `name` string
          - `avatar` object — A link to a resource related to this object.
            - `href` string, uri
            - `name` string
        - `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.
            - `avatar` Link — A link to a resource related to this object.
              - …
            - `self` Link — A link to a resource related to this object.
              - …
            - `html` Link — A link to a resource related to this object.
              - …
            - `members` Link — A link to a resource related to this object.
              - …
            - `projects` Link — A link to a resource related to this object.
              - …
            - `repositories` Link — A link to a resource related to this object.
              - …
          - `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.
            - `href` string, uri
            - `name` string
          - `commits` 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
        - `name` string — The name of the ref.
        - `target` 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.
              - …
          - `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.
              - …
          - `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
              - …
            - `committer` Committer — The committer of a change in a repository
              - …
            - `message` string
            - `summary` object
              - …
            - `parents` BaseCommit[]
          - `repository` Repository — recursive
          - `participants` Participant[]
            - `type` string, required
            - `user` Account — An account object.
              - …
            - `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.
        - `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.
    - `branch` object
      - `name` string
      - `merge_strategies` string[] — Available merge strategies, when this endpoint is the destination of the pull request.
      - `default_merge_strategy` string — The default merge strategy, when this endpoint is the destination of the pull request.
    - `commit` object
      - `hash` string
  - `destination` PullrequestEndpoint
    - `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.
            - `href` string, uri
            - `name` string
        - `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.
            - `href` string, uri
            - `name` string
          - `avatar` object — A link to a resource related to this object.
            - `href` string, uri
            - `name` string
        - `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.
            - `avatar` Link — A link to a resource related to this object.
              - …
            - `self` Link — A link to a resource related to this object.
              - …
            - `html` Link — A link to a resource related to this object.
              - …
            - `members` Link — A link to a resource related to this object.
              - …
            - `projects` Link — A link to a resource related to this object.
              - …
            - `repositories` Link — A link to a resource related to this object.
              - …
          - `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.
            - `href` string, uri
            - `name` string
          - `commits` 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
        - `name` string — The name of the ref.
        - `target` 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.
              - …
          - `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.
              - …
          - `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
              - …
            - `committer` Committer — The committer of a change in a repository
              - …
            - `message` string
            - `summary` object
              - …
            - `parents` BaseCommit[]
          - `repository` Repository — recursive
          - `participants` Participant[]
            - `type` string, required
            - `user` Account — An account object.
              - …
            - `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.
        - `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.
    - `branch` object
      - `name` string
      - `merge_strategies` string[] — Available merge strategies, when this endpoint is the destination of the pull request.
      - `default_merge_strategy` string — The default merge strategy, when this endpoint is the destination of the pull request.
    - `commit` object
      - `hash` string
  - `merge_commit` object
    - `hash` string
  - `comment_count` integer — The number of comments for a specific pull request.
  - `task_count` integer — The number of open tasks for a specific pull request.
  - `close_source_branch` boolean — A boolean flag indicating if merging the pull request closes the source branch.
  - `closed_by` 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.
        - `href` string, uri
        - `name` string
    - `created_on` string, date-time
    - `display_name` string
    - `uuid` string
  - `reason` string — Explains why a pull request was declined. This field is only applicable to pull requests in rejected state.
  - `created_on` string, date-time — The ISO8601 timestamp the request was created.
  - `updated_on` string, date-time — The ISO8601 timestamp the request was last updated.
  - `reviewers` Account[] — The list of users that were added as reviewers on this pull request when it was created. For performance reasons, the API only includes this list on a pull request's `self` URL.
    - `type` string, required
    - `links` AccountLinks — Links related to an Account.
      - `avatar` Link — A link to a resource related to this object.
        - `href` string, uri
        - `name` string
    - `created_on` string, date-time
    - `display_name` string
    - `uuid` string
  - `participants` Participant[] — The list of users that are collaborating on this pull request. Collaborators are user that: * are added to the pull request as a reviewer (part of the reviewers list) * are not explicit reviewers, but have commented on the pull request * are not explicit reviewers, but have approved the pull request Each user is wrapped in an object that indicates the user's role and whether they have approved the pull request. For performance reasons, the API only returns this list when an API requests a pull request by id.
    - `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.
          - `href` string, uri
          - `name` string
      - `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.
  - `draft` boolean — A boolean flag indicating whether the pull request is a draft.
  - `queued` boolean — A boolean flag indicating whether the pull request is queued

## Response `201`

The newly created pull request.

- Pullrequest — A pull request object.
  - `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
    - `commits` object — A link to a resource related to this object.
      - `href` string, uri
      - `name` string
    - `approve` object — A link to a resource related to this object.
      - `href` string, uri
      - `name` string
    - `diff` object — A link to a resource related to this object.
      - `href` string, uri
      - `name` string
    - `diffstat` object — A link to a resource related to this object.
      - `href` string, uri
      - `name` string
    - `comments` object — A link to a resource related to this object.
      - `href` string, uri
      - `name` string
    - `activity` object — A link to a resource related to this object.
      - `href` string, uri
      - `name` string
    - `merge` object — A link to a resource related to this object.
      - `href` string, uri
      - `name` string
    - `decline` object — A link to a resource related to this object.
      - `href` string, uri
      - `name` string
  - `id` integer — The pull request's unique ID. Note that pull request IDs are only unique within their associated repository.
  - `title` string — Title of the pull request.
  - `rendered` object — User provided pull request text, interpreted in a markup language and rendered in HTML
    - `title` 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.
    - `description` 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.
    - `reason` 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.
  - `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.
  - `state` 'OPEN' | 'MERGED' | 'DECLINED' | 'SUPERSEDED' — The pull request's current status.
  - `author` 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.
        - `href` string, uri
        - `name` string
    - `created_on` string, date-time
    - `display_name` string
    - `uuid` string
  - `source` PullrequestEndpoint
    - `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.
            - `href` string, uri
            - `name` string
        - `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.
            - `href` string, uri
            - `name` string
          - `avatar` object — A link to a resource related to this object.
            - `href` string, uri
            - `name` string
        - `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.
            - `avatar` Link — A link to a resource related to this object.
              - …
            - `self` Link — A link to a resource related to this object.
              - …
            - `html` Link — A link to a resource related to this object.
              - …
            - `members` Link — A link to a resource related to this object.
              - …
            - `projects` Link — A link to a resource related to this object.
              - …
            - `repositories` Link — A link to a resource related to this object.
              - …
          - `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.
            - `href` string, uri
            - `name` string
          - `commits` 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
        - `name` string — The name of the ref.
        - `target` 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.
              - …
          - `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.
              - …
          - `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
              - …
            - `committer` Committer — The committer of a change in a repository
              - …
            - `message` string
            - `summary` object
              - …
            - `parents` BaseCommit[]
          - `repository` Repository — recursive
          - `participants` Participant[]
            - `type` string, required
            - `user` Account — An account object.
              - …
            - `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.
        - `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.
    - `branch` object
      - `name` string
      - `merge_strategies` string[] — Available merge strategies, when this endpoint is the destination of the pull request.
      - `default_merge_strategy` string — The default merge strategy, when this endpoint is the destination of the pull request.
    - `commit` object
      - `hash` string
  - `destination` PullrequestEndpoint
    - `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.
            - `href` string, uri
            - `name` string
        - `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.
            - `href` string, uri
            - `name` string
          - `avatar` object — A link to a resource related to this object.
            - `href` string, uri
            - `name` string
        - `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.
            - `avatar` Link — A link to a resource related to this object.
              - …
            - `self` Link — A link to a resource related to this object.
              - …
            - `html` Link — A link to a resource related to this object.
              - …
            - `members` Link — A link to a resource related to this object.
              - …
            - `projects` Link — A link to a resource related to this object.
              - …
            - `repositories` Link — A link to a resource related to this object.
              - …
          - `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.
            - `href` string, uri
            - `name` string
          - `commits` 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
        - `name` string — The name of the ref.
        - `target` 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.
              - …
          - `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.
              - …
          - `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
              - …
            - `committer` Committer — The committer of a change in a repository
              - …
            - `message` string
            - `summary` object
              - …
            - `parents` BaseCommit[]
          - `repository` Repository — recursive
          - `participants` Participant[]
            - `type` string, required
            - `user` Account — An account object.
              - …
            - `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.
        - `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.
    - `branch` object
      - `name` string
      - `merge_strategies` string[] — Available merge strategies, when this endpoint is the destination of the pull request.
      - `default_merge_strategy` string — The default merge strategy, when this endpoint is the destination of the pull request.
    - `commit` object
      - `hash` string
  - `merge_commit` object
    - `hash` string
  - `comment_count` integer — The number of comments for a specific pull request.
  - `task_count` integer — The number of open tasks for a specific pull request.
  - `close_source_branch` boolean — A boolean flag indicating if merging the pull request closes the source branch.
  - `closed_by` 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.
        - `href` string, uri
        - `name` string
    - `created_on` string, date-time
    - `display_name` string
    - `uuid` string
  - `reason` string — Explains why a pull request was declined. This field is only applicable to pull requests in rejected state.
  - `created_on` string, date-time — The ISO8601 timestamp the request was created.
  - `updated_on` string, date-time — The ISO8601 timestamp the request was last updated.
  - `reviewers` Account[] — The list of users that were added as reviewers on this pull request when it was created. For performance reasons, the API only includes this list on a pull request's `self` URL.
    - `type` string, required
    - `links` AccountLinks — Links related to an Account.
      - `avatar` Link — A link to a resource related to this object.
        - `href` string, uri
        - `name` string
    - `created_on` string, date-time
    - `display_name` string
    - `uuid` string
  - `participants` Participant[] — The list of users that are collaborating on this pull request. Collaborators are user that: * are added to the pull request as a reviewer (part of the reviewers list) * are not explicit reviewers, but have commented on the pull request * are not explicit reviewers, but have approved the pull request Each user is wrapped in an object that indicates the user's role and whether they have approved the pull request. For performance reasons, the API only returns this list when an API requests a pull request by id.
    - `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.
          - `href` string, uri
          - `name` string
      - `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.
  - `draft` boolean — A boolean flag indicating whether the pull request is a draft.
  - `queued` boolean — A boolean flag indicating whether the pull request is queued

## Other responses

- `400` — If the input document was invalid, or if the caller lacks the privilege to create repositories under the targeted account.
- `401` — If the request was not authenticated.

---

[API](https://skmtc.net/bitbucket/apis/bitbucket-api.md) · [All operations](https://skmtc.net/bitbucket/apis/bitbucket-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/bitbucket/bitbucket-api/versions/7e9be973015d/schema)
