Skip to content

List pull requests

GET
/repositories/{workspace}/{repo_slug}/pullrequests

Returns all pull requests on the specified repository.

By default only open pull requests are returned. This can be controlled using the state query parameter. To retrieve pull requests that are in one of multiple states, repeat the state parameter for each individual state.

This endpoint also supports filtering and sorting of the results. See filtering and sorting for more details.

repo_slug
required
string

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace
required
string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

state
string
Allowed values: OPEN MERGED DECLINED SUPERSEDED

Only return pull requests that are in this state. This parameter can be repeated.

All pull requests on the specified repository.

Media type application/json
Paginated Pull Requests

A paginated list of pullrequests.

object
size

Total number of objects in the response. This is an optional element that is not provided in all responses, as it can be expensive to compute.

integer
page

Page number of the current results. This is an optional element that is not provided in all responses.

integer
>= 1
pagelen

Current number of objects on the existing page. The default value is 10 with 100 being the maximum allowed value. Individual APIs may enforce different values.

integer
>= 1
next

Link to the next page if it exists. The last page of a collection does not have this value. Use this link to navigate the result set and refrain from constructing your own URLs.

string format: uri
previous

Link to previous page if it exists. A collections first page does not have this value. This is an optional element that is not provided in all responses. Some result sets strictly support forward navigation and never provide previous links. Clients must anticipate that backwards navigation is not always available. Use this link to navigate the result set and refrain from constructing your own URLs.

string format: uri
values
Array
0 unique items
object
type
required
string
links
object
self
Link

A link to a resource related to this object.

object
href
string format: uri
name
string
html
Link

A link to a resource related to this object.

object
href
string format: uri
name
string
commits
Link

A link to a resource related to this object.

object
href
string format: uri
name
string
approve
Link

A link to a resource related to this object.

object
href
string format: uri
name
string
diff
Link

A link to a resource related to this object.

object
href
string format: uri
name
string
diffstat
Link

A link to a resource related to this object.

object
href
string format: uri
name
string
comments
Link

A link to a resource related to this object.

object
href
string format: uri
name
string
activity
Link

A link to a resource related to this object.

object
href
string format: uri
name
string
merge
Link

A link to a resource related to this object.

object
href
string format: uri
name
string
decline
Link

A link to a resource related to this object.

object
href
string format: uri
name
string
id

The pull request’s unique ID. Note that pull request IDs are only unique within their associated repository.

integer
title

Title of the pull request.

string
rendered
Rendered Pull Request Markup

User provided pull request text, interpreted in a markup language and rendered in HTML

object
title
object
raw

The text as it was typed by a user.

string
markup

The type of markup language the raw content is to be interpreted in.

string
Allowed values: markdown creole plaintext
html

The user’s content rendered as HTML.

string
description
object
raw

The text as it was typed by a user.

string
markup

The type of markup language the raw content is to be interpreted in.

string
Allowed values: markdown creole plaintext
html

The user’s content rendered as HTML.

string
reason
object
raw

The text as it was typed by a user.

string
markup

The type of markup language the raw content is to be interpreted in.

string
Allowed values: markdown creole plaintext
html

The user’s content rendered as HTML.

string
summary
object
raw

The text as it was typed by a user.

string
markup

The type of markup language the raw content is to be interpreted in.

string
Allowed values: markdown creole plaintext
html

The user’s content rendered as HTML.

string
state

The pull request’s current status.

string
Allowed values: OPEN MERGED DECLINED SUPERSEDED
author
object
type
required
string
links
Account Links

Links related to an Account.

object
avatar
Link

A link to a resource related to this object.

object
href
string format: uri
name
string
key
additional properties
any
created_on
string format: date-time
display_name
string
uuid
string
source
Pull Request Endpoint
object
repository
object
type
required
string
links
object
self
Link

A link to a resource related to this object.

object
href
string format: uri
name
string
html
Link

A link to a resource related to this object.

object
href
string format: uri
name
string
avatar
Link

A link to a resource related to this object.

object
href
string format: uri
name
string
pullrequests
Link

A link to a resource related to this object.

object
href
string format: uri
name
string
commits
Link

A link to a resource related to this object.

object
href
string format: uri
name
string
forks
Link

A link to a resource related to this object.

object
href
string format: uri
name
string
watchers
Link

A link to a resource related to this object.

object
href
string format: uri
name
string
downloads
Link

A link to a resource related to this object.

object
href
string format: uri
name
string
clone
Array<object>
Link

A link to a resource related to this object.

object
href
string format: uri
name
string
hooks
Link

A link to a resource related to this object.

object
href
string format: uri
name
string
uuid

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.

string
full_name

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.

string
is_private
boolean
parent
object recursive
scm
string
Allowed values: git
owner
object
type
required
string
links
Account Links

Links related to an Account.

object
avatar
Link

A link to a resource related to this object.

object
href
string format: uri
name
string
key
additional properties
any
created_on
string format: date-time
display_name
string
uuid
string
name
string
description
string
created_on
string format: date-time
updated_on
string format: date-time
size
integer
language
string
has_issues

The issue tracker for this repository is enabled. Issue Tracker features are not supported for repositories in workspaces administered through admin.atlassian.com.

boolean
has_wiki

The wiki for this repository is enabled. Wiki features are not supported for repositories in workspaces administered through admin.atlassian.com.

boolean
fork_policy

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
string
Allowed values: allow_forks no_public_forks no_forks
project
object
type
required
string
links
object
html
Link

A link to a resource related to this object.

object
href
string format: uri
name
string
avatar
Link

A link to a resource related to this object.

object
href
string format: uri
name
string
uuid

The project’s immutable id.

string
key

The project’s key.

string
owner
object
type
required
string
links
Account Links

Links related to an Account.

object
avatar
Link

A link to a resource related to this object.

object
href
string format: uri
name
string
key
additional properties
any
created_on
string format: date-time
display_name
string
uuid
string
links
object
avatar
Link

A link to a resource related to this object.

object
href
string format: uri
name
string
self
Link

A link to a resource related to this object.

object
href
string format: uri
name
string
html
Link

A link to a resource related to this object.

object
href
string format: uri
name
string
members
Link

A link to a resource related to this object.

object
href
string format: uri
name
string
projects
Link

A link to a resource related to this object.

object
href
string format: uri
name
string
repositories
Link

A link to a resource related to this object.

object
href
string format: uri
name
string
name

The name of the project.

string
description
string
is_private

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.

boolean
created_on
string format: date-time
updated_on
string format: date-time
has_publicly_visible_repos

Indicates whether the project contains publicly visible repositories. Note that private projects cannot contain public repositories.

boolean
mainbranch
object
type
required
string
links
object
self
Link

A link to a resource related to this object.

object
href
string format: uri
name
string
commits
Link

A link to a resource related to this object.

object
href
string format: uri
name
string
html
Link

A link to a resource related to this object.

object
href
string format: uri
name
string
name

The name of the ref.

string
target
object
type
required
string
hash
string
/[0-9a-f]{7,}?/
date
string format: date-time
author
object
type
required
string
raw

The raw author value from the repository. This may be the only value available if the author does not match a user in Bitbucket.

string
user
object
type
required
string
links
Account Links

Links related to an Account.

object
avatar
Link

A link to a resource related to this object.

object
href
string format: uri
name
string
key
additional properties
any
created_on
string format: date-time
display_name
string
uuid
string
committer
object
type
required
string
raw

The raw committer value from the repository. This may be the only value available if the committer does not match a user in Bitbucket.

string
user
object
type
required
string
links
Account Links

Links related to an Account.

object
avatar
Link

A link to a resource related to this object.

object
href
string format: uri
name
string
key
additional properties
any
created_on
string format: date-time
display_name
string
uuid
string
message
string
summary
object
raw

The text as it was typed by a user.

string
markup

The type of markup language the raw content is to be interpreted in.

string
Allowed values: markdown creole plaintext
html

The user’s content rendered as HTML.

string
parents
Array<object> recursive
repository
object recursive
participants
Array
0
object
type
required
string
user
object
type
required
string
links
Account Links

Links related to an Account.

object
avatar
Link

A link to a resource related to this object.

object
href
string format: uri
name
string
key
additional properties
any
created_on
string format: date-time
display_name
string
uuid
string
role
string
Allowed values: PARTICIPANT REVIEWER
approved
boolean
state
string
Allowed values: approved changes_requested
participated_on

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.

string format: date-time
merge_strategies

Available merge strategies for pull requests targeting this branch.

Array<string>
Allowed values: merge_commit squash fast_forward squash_fast_forward rebase_fast_forward rebase_merge
default_merge_strategy

The default merge strategy for pull requests targeting this branch.

string
branch
Pull Request Branch
object
name
string
merge_strategies

Available merge strategies, when this endpoint is the destination of the pull request.

Array<string>
Allowed values: merge_commit squash fast_forward squash_fast_forward rebase_fast_forward rebase_merge
default_merge_strategy

The default merge strategy, when this endpoint is the destination of the pull request.

string
commit
Pull Request Commit
object
hash
string
/[0-9a-f]{7,}?/
destination
Pull Request Endpoint
object
repository
object
type
required
string
links
object
self
Link

A link to a resource related to this object.

object
href
string format: uri
name
string
html
Link

A link to a resource related to this object.

object
href
string format: uri
name
string
avatar
Link

A link to a resource related to this object.

object
href
string format: uri
name
string
pullrequests
Link

A link to a resource related to this object.

object
href
string format: uri
name
string
commits
Link

A link to a resource related to this object.

object
href
string format: uri
name
string
forks
Link

A link to a resource related to this object.

object
href
string format: uri
name
string
watchers
Link

A link to a resource related to this object.

object
href
string format: uri
name
string
downloads
Link

A link to a resource related to this object.

object
href
string format: uri
name
string
clone
Array<object>
Link

A link to a resource related to this object.

object
href
string format: uri
name
string
hooks
Link

A link to a resource related to this object.

object
href
string format: uri
name
string
uuid

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.

string
full_name

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.

string
is_private
boolean
parent
object recursive
scm
string
Allowed values: git
owner
object
type
required
string
links
Account Links

Links related to an Account.

object
avatar
Link

A link to a resource related to this object.

object
href
string format: uri
name
string
key
additional properties
any
created_on
string format: date-time
display_name
string
uuid
string
name
string
description
string
created_on
string format: date-time
updated_on
string format: date-time
size
integer
language
string
has_issues

The issue tracker for this repository is enabled. Issue Tracker features are not supported for repositories in workspaces administered through admin.atlassian.com.

boolean
has_wiki

The wiki for this repository is enabled. Wiki features are not supported for repositories in workspaces administered through admin.atlassian.com.

boolean
fork_policy

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
string
Allowed values: allow_forks no_public_forks no_forks
project
object
type
required
string
links
object
html
Link

A link to a resource related to this object.

object
href
string format: uri
name
string
avatar
Link

A link to a resource related to this object.

object
href
string format: uri
name
string
uuid

The project’s immutable id.

string
key

The project’s key.

string
owner
object
type
required
string
links
Account Links

Links related to an Account.

object
avatar
Link

A link to a resource related to this object.

object
href
string format: uri
name
string
key
additional properties
any
created_on
string format: date-time
display_name
string
uuid
string
links
object
avatar
Link

A link to a resource related to this object.

object
href
string format: uri
name
string
self
Link

A link to a resource related to this object.

object
href
string format: uri
name
string
html
Link

A link to a resource related to this object.

object
href
string format: uri
name
string
members
Link

A link to a resource related to this object.

object
href
string format: uri
name
string
projects
Link

A link to a resource related to this object.

object
href
string format: uri
name
string
repositories
Link

A link to a resource related to this object.

object
href
string format: uri
name
string
name

The name of the project.

string
description
string
is_private

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.

boolean
created_on
string format: date-time
updated_on
string format: date-time
has_publicly_visible_repos

Indicates whether the project contains publicly visible repositories. Note that private projects cannot contain public repositories.

boolean
mainbranch
object
type
required
string
links
object
self
Link

A link to a resource related to this object.

object
href
string format: uri
name
string
commits
Link

A link to a resource related to this object.

object
href
string format: uri
name
string
html
Link

A link to a resource related to this object.

object
href
string format: uri
name
string
name

The name of the ref.

string
target
object
type
required
string
hash
string
/[0-9a-f]{7,}?/
date
string format: date-time
author
object
type
required
string
raw

The raw author value from the repository. This may be the only value available if the author does not match a user in Bitbucket.

string
user
object
type
required
string
links
Account Links

Links related to an Account.

object
avatar
Link

A link to a resource related to this object.

object
href
string format: uri
name
string
key
additional properties
any
created_on
string format: date-time
display_name
string
uuid
string
committer
object
type
required
string
raw

The raw committer value from the repository. This may be the only value available if the committer does not match a user in Bitbucket.

string
user
object
type
required
string
links
Account Links

Links related to an Account.

object
avatar
Link

A link to a resource related to this object.

object
href
string format: uri
name
string
key
additional properties
any
created_on
string format: date-time
display_name
string
uuid
string
message
string
summary
object
raw

The text as it was typed by a user.

string
markup

The type of markup language the raw content is to be interpreted in.

string
Allowed values: markdown creole plaintext
html

The user’s content rendered as HTML.

string
parents
Array<object> recursive
repository
object recursive
participants
Array
0
object
type
required
string
user
object
type
required
string
links
Account Links

Links related to an Account.

object
avatar
Link

A link to a resource related to this object.

object
href
string format: uri
name
string
key
additional properties
any
created_on
string format: date-time
display_name
string
uuid
string
role
string
Allowed values: PARTICIPANT REVIEWER
approved
boolean
state
string
Allowed values: approved changes_requested
participated_on

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.

string format: date-time
merge_strategies

Available merge strategies for pull requests targeting this branch.

Array<string>
Allowed values: merge_commit squash fast_forward squash_fast_forward rebase_fast_forward rebase_merge
default_merge_strategy

The default merge strategy for pull requests targeting this branch.

string
branch
Pull Request Branch
object
name
string
merge_strategies

Available merge strategies, when this endpoint is the destination of the pull request.

Array<string>
Allowed values: merge_commit squash fast_forward squash_fast_forward rebase_fast_forward rebase_merge
default_merge_strategy

The default merge strategy, when this endpoint is the destination of the pull request.

string
commit
Pull Request Commit
object
hash
string
/[0-9a-f]{7,}?/
merge_commit
Pull Request Commit
object
hash
string
/[0-9a-f]{7,}?/
comment_count

The number of comments for a specific pull request.

integer
task_count

The number of open tasks for a specific pull request.

integer
close_source_branch

A boolean flag indicating if merging the pull request closes the source branch.

boolean
closed_by
object
type
required
string
links
Account Links

Links related to an Account.

object
avatar
Link

A link to a resource related to this object.

object
href
string format: uri
name
string
key
additional properties
any
created_on
string format: date-time
display_name
string
uuid
string
reason

Explains why a pull request was declined. This field is only applicable to pull requests in rejected state.

string
created_on

The ISO8601 timestamp the request was created.

string format: date-time
updated_on

The ISO8601 timestamp the request was last updated.

string format: date-time
reviewers

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.

Array
object
type
required
string
links
Account Links

Links related to an Account.

object
avatar
Link

A link to a resource related to this object.

object
href
string format: uri
name
string
key
additional properties
any
created_on
string format: date-time
display_name
string
uuid
string
participants
    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.
    
Array
object
type
required
string
user
object
type
required
string
links
Account Links

Links related to an Account.

object
avatar
Link

A link to a resource related to this object.

object
href
string format: uri
name
string
key
additional properties
any
created_on
string format: date-time
display_name
string
uuid
string
role
string
Allowed values: PARTICIPANT REVIEWER
approved
boolean
state
string
Allowed values: approved changes_requested
participated_on

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.

string format: date-time
draft

A boolean flag indicating whether the pull request is a draft.

boolean
queued

A boolean flag indicating whether the pull request is queued

boolean
Example
{
"values": [
{
"rendered": {
"title": {
"markup": "markdown"
},
"description": {
"markup": "markdown"
},
"reason": {
"markup": "markdown"
}
},
"summary": {
"markup": "markdown"
},
"state": "OPEN",
"source": {
"repository": {
"scm": "git",
"fork_policy": "allow_forks",
"mainbranch": {
"target": {
"summary": {
"markup": "markdown"
},
"participants": [
{
"role": "PARTICIPANT",
"state": "approved"
}
]
},
"merge_strategies": [
"merge_commit"
]
}
},
"branch": {
"merge_strategies": [
"merge_commit"
]
}
},
"destination": {
"repository": {
"scm": "git",
"fork_policy": "allow_forks",
"mainbranch": {
"target": {
"summary": {
"markup": "markdown"
},
"participants": [
{
"role": "PARTICIPANT",
"state": "approved"
}
]
},
"merge_strategies": [
"merge_commit"
]
}
},
"branch": {
"merge_strategies": [
"merge_commit"
]
}
},
"participants": [
{
"role": "PARTICIPANT",
"state": "approved"
}
]
}
]
}

If the repository is private and the request was not authenticated.

If the specified repository does not exist.

Media type application/json
Error

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.

object
type
required
string
error
object
message
required
string
detail
string
data

Optional structured data that is endpoint-specific.

object
key
additional properties
any
key
additional properties
any
Example generated
{
"type": "example",
"error": {
"message": "example",
"detail": "example",
"data": {}
}
}