Skip to main content
POST
/
api
/
bitbucket
/
repositories
/
pullrequests
/bitbucket/repositories/pullrequests
curl --request POST \
  --url https://api.anysite.io/api/bitbucket/repositories/pullrequests \
  --header 'Content-Type: application/json' \
  --header 'access-token: <api-key>' \
  --data '
{
  "repo": "<string>",
  "count": 2,
  "timeout": 300,
  "state": "OPEN",
  "query": "state=\"MERGED\"",
  "sort": "-updated_on"
}
'
[
  {
    "id": 123,
    "@type": "BitbucketPullRequest",
    "pull_title": "",
    "text": "<string>",
    "state": "",
    "is_draft": false,
    "comment_count": 0,
    "task_count": 0,
    "close_source_branch": false,
    "created_at": "",
    "updated_at": "",
    "author": {
      "@type": "BitbucketAccount",
      "uuid": "",
      "display_name": "",
      "nickname": "<string>",
      "account_id": "<string>",
      "account_type": "",
      "account_status": "<string>",
      "is_staff": false,
      "location": "<string>",
      "created_at": "<string>",
      "image": "<string>",
      "web_url": ""
    },
    "closed_by": {
      "@type": "BitbucketAccount",
      "uuid": "",
      "display_name": "",
      "nickname": "<string>",
      "account_id": "<string>",
      "account_type": "",
      "account_status": "<string>",
      "is_staff": false,
      "location": "<string>",
      "created_at": "<string>",
      "image": "<string>",
      "web_url": ""
    },
    "merge_commit_hash": "<string>",
    "reason": "",
    "source_branch": "",
    "source_commit_hash": "",
    "source_repository_alias": "<string>",
    "destination_branch": "",
    "destination_commit_hash": "",
    "destination_repository_alias": "<string>",
    "reviewers": [],
    "participants": [],
    "web_url": ""
  }
]

Authorizations

access-token
string
header
required

API token from the dashboard

Headers

access-token
string
required

Body

application/json
repo
string
required

Repository in 'workspace/repo' format or a Bitbucket repository URL

Minimum string length: 1
Examples:

"atlassian/aui"

"https://bitbucket.org/atlassian/aui"

count
integer
required

Number of pull requests to return

Required range: x >= 1
timeout
integer
default:300

Max scrapping execution timeout (in seconds)

Required range: 20 <= x <= 1500
state
enum<string>
default:OPEN

Filter pull requests by state

Available options:
OPEN,
MERGED,
DECLINED,
SUPERSEDED
query
string | null

Bitbucket query filter over pull request fields, e.g. 'author.nickname="jdoe"'

Example:

"state=\"MERGED\""

sort
enum<string>
default:-updated_on

Sort pull requests by this field

Available options:
-updated_on,
updated_on,
-created_on,
created_on

Response

Successful Response

id
integer
required
@type
string
default:BitbucketPullRequest
pull_title
string
default:""
text
string | null
state
string
default:""
is_draft
boolean
default:false
comment_count
integer
default:0
task_count
integer
default:0
close_source_branch
boolean
default:false
created_at
string
default:""
updated_at
string
default:""
author
object | null
closed_by
object | null
merge_commit_hash
string | null
reason
string
default:""
source_branch
string
default:""
source_commit_hash
string
default:""
source_repository_alias
string | null
destination_branch
string
default:""
destination_commit_hash
string
default:""
destination_repository_alias
string | null
reviewers
object[]
participants
object[]
web_url
string
default:""