Skip to content

Latest commit

 

History

History
1268 lines (822 loc) · 95.9 KB

PullrequestsApi.md

File metadata and controls

1268 lines (822 loc) · 95.9 KB

{{classname}}

All URIs are relative to https://api.bitbucket.org/2.0

Method HTTP request Description
GetPullrequestsForCommit Get /repositories/{workspace}/{repo_slug}/commit/{commit}/pullrequests List pull requests that contain a commit
PullrequestsSelectedUserGet Get /pullrequests/{selected_user} List pull requests for a user
RepositoriesWorkspaceRepoSlugDefaultReviewersGet Get /repositories/{workspace}/{repo_slug}/default-reviewers List default reviewers
RepositoriesWorkspaceRepoSlugDefaultReviewersTargetUsernameDelete Delete /repositories/{workspace}/{repo_slug}/default-reviewers/{target_username} Remove a user from the default reviewers
RepositoriesWorkspaceRepoSlugDefaultReviewersTargetUsernameGet Get /repositories/{workspace}/{repo_slug}/default-reviewers/{target_username} Get a default reviewer
RepositoriesWorkspaceRepoSlugDefaultReviewersTargetUsernamePut Put /repositories/{workspace}/{repo_slug}/default-reviewers/{target_username} Add a user to the default reviewers
RepositoriesWorkspaceRepoSlugEffectiveDefaultReviewersGet Get /repositories/{workspace}/{repo_slug}/effective-default-reviewers List effective default reviewers
RepositoriesWorkspaceRepoSlugPullrequestsActivityGet Get /repositories/{workspace}/{repo_slug}/pullrequests/activity List a pull request activity log
RepositoriesWorkspaceRepoSlugPullrequestsGet Get /repositories/{workspace}/{repo_slug}/pullrequests List pull requests
RepositoriesWorkspaceRepoSlugPullrequestsPost Post /repositories/{workspace}/{repo_slug}/pullrequests Create a pull request
RepositoriesWorkspaceRepoSlugPullrequestsPullRequestIdActivityGet Get /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/activity List a pull request activity log
RepositoriesWorkspaceRepoSlugPullrequestsPullRequestIdApproveDelete Delete /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/approve Unapprove a pull request
RepositoriesWorkspaceRepoSlugPullrequestsPullRequestIdApprovePost Post /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/approve Approve a pull request
RepositoriesWorkspaceRepoSlugPullrequestsPullRequestIdCommentsCommentIdDelete Delete /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/comments/{comment_id} Delete a comment on a pull request
RepositoriesWorkspaceRepoSlugPullrequestsPullRequestIdCommentsCommentIdGet Get /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/comments/{comment_id} Get a comment on a pull request
RepositoriesWorkspaceRepoSlugPullrequestsPullRequestIdCommentsCommentIdPut Put /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/comments/{comment_id} Update a comment on a pull request
RepositoriesWorkspaceRepoSlugPullrequestsPullRequestIdCommentsCommentIdResolveDelete Delete /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/comments/{comment_id}/resolve Reopen a comment thread
RepositoriesWorkspaceRepoSlugPullrequestsPullRequestIdCommentsCommentIdResolvePost Post /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/comments/{comment_id}/resolve Resolve a comment thread
RepositoriesWorkspaceRepoSlugPullrequestsPullRequestIdCommentsGet Get /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/comments List comments on a pull request
RepositoriesWorkspaceRepoSlugPullrequestsPullRequestIdCommentsPost Post /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/comments Create a comment on a pull request
RepositoriesWorkspaceRepoSlugPullrequestsPullRequestIdCommitsGet Get /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/commits List commits on a pull request
RepositoriesWorkspaceRepoSlugPullrequestsPullRequestIdDeclinePost Post /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/decline Decline a pull request
RepositoriesWorkspaceRepoSlugPullrequestsPullRequestIdDiffGet Get /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/diff List changes in a pull request
RepositoriesWorkspaceRepoSlugPullrequestsPullRequestIdDiffstatGet Get /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/diffstat Get the diff stat for a pull request
RepositoriesWorkspaceRepoSlugPullrequestsPullRequestIdGet Get /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id} Get a pull request
RepositoriesWorkspaceRepoSlugPullrequestsPullRequestIdMergePost Post /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/merge Merge a pull request
RepositoriesWorkspaceRepoSlugPullrequestsPullRequestIdMergeTaskStatusTaskIdGet Get /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/merge/task-status/{task_id} Get the merge task status for a pull request
RepositoriesWorkspaceRepoSlugPullrequestsPullRequestIdPatchGet Get /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/patch Get the patch for a pull request
RepositoriesWorkspaceRepoSlugPullrequestsPullRequestIdPut Put /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id} Update a pull request
RepositoriesWorkspaceRepoSlugPullrequestsPullRequestIdRequestChangesDelete Delete /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/request-changes Remove change request for a pull request
RepositoriesWorkspaceRepoSlugPullrequestsPullRequestIdRequestChangesPost Post /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/request-changes Request changes for a pull request
RepositoriesWorkspaceRepoSlugPullrequestsPullRequestIdStatusesGet Get /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/statuses List commit statuses for a pull request
RepositoriesWorkspaceRepoSlugPullrequestsPullRequestIdTasksGet Get /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/tasks List tasks on a pull request
RepositoriesWorkspaceRepoSlugPullrequestsPullRequestIdTasksPost Post /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/tasks Create a task on a pull request
RepositoriesWorkspaceRepoSlugPullrequestsPullRequestIdTasksTaskIdDelete Delete /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/tasks/{task_id} Delete a task on a pull request
RepositoriesWorkspaceRepoSlugPullrequestsPullRequestIdTasksTaskIdGet Get /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/tasks/{task_id} Get a task on a pull request
RepositoriesWorkspaceRepoSlugPullrequestsPullRequestIdTasksTaskIdPut Put /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/tasks/{task_id} Update a task on a pull request

GetPullrequestsForCommit

PaginatedPullrequests GetPullrequestsForCommit(ctx, workspace, repoSlug, commit, optional) List pull requests that contain a commit

Returns a paginated list of all pull requests as part of which this commit was reviewed. Pull Request Commit Links app must be installed first before using this API; installation automatically occurs when 'Go to pull request' is clicked from the web interface for a commit's details.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
workspace string This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces
repoSlug string The repository; either the UUID in curly braces, or the slug
commit string The SHA1 of the commit
optional *PullrequestsApiGetPullrequestsForCommitOpts optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a pointer to a PullrequestsApiGetPullrequestsForCommitOpts struct

Name Type Description Notes

page | optional.Int32| Which page to retrieve | [default to 1] pagelen | optional.Int32| How many pull requests to retrieve per page | [default to 30]

Return type

PaginatedPullrequests

Authorization

api_key, basic, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

PullrequestsSelectedUserGet

PaginatedPullrequests PullrequestsSelectedUserGet(ctx, selectedUser, optional) List pull requests for a user

Returns all pull requests authored by the specified user. 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.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
selectedUser string This can either be the username of the pull request author, the author's UUID surrounded by curly-braces, for example: `{account UUID}`, or the author's Atlassian ID.
optional *PullrequestsApiPullrequestsSelectedUserGetOpts optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a pointer to a PullrequestsApiPullrequestsSelectedUserGetOpts struct

Name Type Description Notes

state | optional.String| Only return pull requests that are in this state. This parameter can be repeated. | page | optional.Int32| page |

Return type

PaginatedPullrequests

Authorization

api_key, basic, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

RepositoriesWorkspaceRepoSlugDefaultReviewersGet

PaginatedAccounts RepositoriesWorkspaceRepoSlugDefaultReviewersGet(ctx, repoSlug, workspace, optional) List default reviewers

Returns the repository's default reviewers. These are the users that are automatically added as reviewers on every new pull request that is created. To obtain the repository's default reviewers as well as the default reviewers inherited from the project, use the effective-default-reveiwers endpoint.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
repoSlug string This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.
workspace string This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: `{workspace UUID}`.
optional *PullrequestsApiRepositoriesWorkspaceRepoSlugDefaultReviewersGetOpts optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a pointer to a PullrequestsApiRepositoriesWorkspaceRepoSlugDefaultReviewersGetOpts struct

Name Type Description Notes

page | optional.Int32| page |

Return type

PaginatedAccounts

Authorization

api_key, basic, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

RepositoriesWorkspaceRepoSlugDefaultReviewersTargetUsernameDelete

RepositoriesWorkspaceRepoSlugDefaultReviewersTargetUsernameDelete(ctx, repoSlug, targetUsername, workspace) Remove a user from the default reviewers

Removes a default reviewer from the repository.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
repoSlug string This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.
targetUsername string This can either be the username or the UUID of the default reviewer, surrounded by curly-braces, for example: `{account UUID}`.
workspace string This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: `{workspace UUID}`.

Return type

(empty response body)

Authorization

api_key, basic, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

RepositoriesWorkspaceRepoSlugDefaultReviewersTargetUsernameGet

Account RepositoriesWorkspaceRepoSlugDefaultReviewersTargetUsernameGet(ctx, repoSlug, targetUsername, workspace) Get a default reviewer

Returns the specified reviewer. This can be used to test whether a user is among the repository's default reviewers list. A 404 indicates that that specified user is not a default reviewer.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
repoSlug string This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.
targetUsername string This can either be the username or the UUID of the default reviewer, surrounded by curly-braces, for example: `{account UUID}`.
workspace string This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: `{workspace UUID}`.

Return type

Account

Authorization

api_key, basic, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

RepositoriesWorkspaceRepoSlugDefaultReviewersTargetUsernamePut

Account RepositoriesWorkspaceRepoSlugDefaultReviewersTargetUsernamePut(ctx, repoSlug, targetUsername, workspace) Add a user to the default reviewers

Adds the specified user to the repository's list of default reviewers. This method is idempotent. Adding a user a second time has no effect.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
repoSlug string This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.
targetUsername string This can either be the username or the UUID of the default reviewer, surrounded by curly-braces, for example: `{account UUID}`.
workspace string This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: `{workspace UUID}`.

Return type

Account

Authorization

api_key, basic, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

RepositoriesWorkspaceRepoSlugEffectiveDefaultReviewersGet

PaginatedDefaultReviewerAndType RepositoriesWorkspaceRepoSlugEffectiveDefaultReviewersGet(ctx, repoSlug, workspace, optional) List effective default reviewers

Returns the repository's effective default reviewers. This includes both default reviewers defined at the repository level as well as those inherited from its project. These are the users that are automatically added as reviewers on every new pull request that is created.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
repoSlug string This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.
workspace string This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: `{workspace UUID}`.
optional *PullrequestsApiRepositoriesWorkspaceRepoSlugEffectiveDefaultReviewersGetOpts optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a pointer to a PullrequestsApiRepositoriesWorkspaceRepoSlugEffectiveDefaultReviewersGetOpts struct

Name Type Description Notes

page | optional.Int32| page |

Return type

PaginatedDefaultReviewerAndType

Authorization

api_key, basic, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

RepositoriesWorkspaceRepoSlugPullrequestsActivityGet

RepositoriesWorkspaceRepoSlugPullrequestsActivityGet(ctx, repoSlug, workspace) List a pull request activity log

Returns a paginated list of the pull request's activity log. This handler serves both a v20 and internal endpoint. The v20 endpoint returns reviewer comments, updates, approvals and request changes. The internal endpoint includes those plus tasks and attachments. Comments created on a file or a line of code have an inline property. Comment example: { \"pagelen\": 20, \"values\": [ { \"comment\": { \"links\": { \"self\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/atlassian/atlaskit-mk-2/pullrequests/5695/comments/118571088\" }, \"html\": { \"href\": \"https://bitbucket.org/atlassian/atlaskit-mk-2/pull-requests/5695/_/diff#comment-118571088\" } }, \"deleted\": false, \"pullrequest\": { \"type\": \"pullrequest\", \"id\": 5695, \"links\": { \"self\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/atlassian/atlaskit-mk-2/pullrequests/5695\" }, \"html\": { \"href\": \"https://bitbucket.org/atlassian/atlaskit-mk-2/pull-requests/5695\" } }, \"title\": \"username/NONE: small change from onFocus to onClick to handle tabbing through the page and not expand the editor unless a click event triggers it\" }, \"content\": { \"raw\": \"inline with to a dn from lines\", \"markup\": \"markdown\", \"html\": \"<p>inline with to a dn from lines</p>\", \"type\": \"rendered\" }, \"created_on\": \"2019-09-27T00:33:46.039178+00:00\", \"user\": { \"display_name\": \"Name Lastname\", \"uuid\": \"{}\", \"links\": { \"self\": { \"href\": \"https://api.bitbucket.org/2.0/users/%7B%7D\" }, \"html\": { \"href\": \"https://bitbucket.org/%7B%7D/\" }, \"avatar\": { \"href\": \"https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/:/128\" } }, \"type\": \"user\", \"nickname\": \"Name\", \"account_id\": \"\" }, \"created_on\": \"2019-09-27T00:33:46.039178+00:00\", \"user\": { \"display_name\": \"Name Lastname\", \"uuid\": \"{}\", \"links\": { \"self\": { \"href\": \"https://api.bitbucket.org/2.0/users/%7B%7D\" }, \"html\": { \"href\": \"https://bitbucket.org/%7B%7D/\" }, \"avatar\": { \"href\": \"https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/:/128\" } }, \"type\": \"user\", \"nickname\": \"Name\", \"account_id\": \"\" }, \"updated_on\": \"2019-09-27T00:33:46.055384+00:00\", \"inline\": { \"context_lines\": \"\", \"to\": null, \"path\": \"\", \"outdated\": false, \"from\": 211 }, \"type\": \"pullrequest_comment\", \"id\": 118571088 }, \"pull_request\": { \"type\": \"pullrequest\", \"id\": 5695, \"links\": { \"self\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/atlassian/atlaskit-mk-2/pullrequests/5695\" }, \"html\": { \"href\": \"https://bitbucket.org/atlassian/atlaskit-mk-2/pull-requests/5695\" } }, \"title\": \"username/NONE: small change from onFocus to onClick to handle tabbing through the page and not expand the editor unless a click event triggers it\" } } ] } Updates include a state property of OPEN, MERGED, or DECLINED. Update example: { \"pagelen\": 20, \"values\": [ { \"update\": { \"description\": \"\", \"title\": \"username/NONE: small change from onFocus to onClick to handle tabbing through the page and not expand the editor unless a click event triggers it\", \"destination\": { \"commit\": { \"type\": \"commit\", \"hash\": \"6a2c16e4a152\", \"links\": { \"self\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/atlassian/atlaskit-mk-2/commit/6a2c16e4a152\" }, \"html\": { \"href\": \"https://bitbucket.org/atlassian/atlaskit-mk-2/commits/6a2c16e4a152\" } } }, \"branch\": { \"name\": \"master\" }, \"repository\": { \"name\": \"Atlaskit-MK-2\", \"type\": \"repository\", \"full_name\": \"atlassian/atlaskit-mk-2\", \"links\": { \"self\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/atlassian/atlaskit-mk-2\" }, \"html\": { \"href\": \"https://bitbucket.org/atlassian/atlaskit-mk-2\" }, \"avatar\": { \"href\": \"https://bytebucket.org/ravatar/%7B%7D?ts=js\" } }, \"uuid\": \"{}\" } }, \"reason\": \"\", \"source\": { \"commit\": { \"type\": \"commit\", \"hash\": \"728c8bad1813\", \"links\": { \"self\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/atlassian/atlaskit-mk-2/commit/728c8bad1813\" }, \"html\": { \"href\": \"https://bitbucket.org/atlassian/atlaskit-mk-2/commits/728c8bad1813\" } } }, \"branch\": { \"name\": \"username/NONE-add-onClick-prop-for-accessibility\" }, \"repository\": { \"name\": \"Atlaskit-MK-2\", \"type\": \"repository\", \"full_name\": \"atlassian/atlaskit-mk-2\", \"links\": { \"self\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/atlassian/atlaskit-mk-2\" }, \"html\": { \"href\": \"https://bitbucket.org/atlassian/atlaskit-mk-2\" }, \"avatar\": { \"href\": \"https://bytebucket.org/ravatar/%7B%7D?ts=js\" } }, \"uuid\": \"{}\" } }, \"state\": \"OPEN\", \"author\": { \"display_name\": \"Name Lastname\", \"uuid\": \"{}\", \"links\": { \"self\": { \"href\": \"https://api.bitbucket.org/2.0/users/%7B%7D\" }, \"html\": { \"href\": \"https://bitbucket.org/%7B%7D/\" }, \"avatar\": { \"href\": \"https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/:/128\" } }, \"type\": \"user\", \"nickname\": \"Name\", \"account_id\": \"\" }, \"date\": \"2019-05-10T06:48:25.305565+00:00\" }, \"pull_request\": { \"type\": \"pullrequest\", \"id\": 5695, \"links\": { \"self\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/atlassian/atlaskit-mk-2/pullrequests/5695\" }, \"html\": { \"href\": \"https://bitbucket.org/atlassian/atlaskit-mk-2/pull-requests/5695\" } }, \"title\": \"username/NONE: small change from onFocus to onClick to handle tabbing through the page and not expand the editor unless a click event triggers it\" } } ] } Approval example: { \"pagelen\": 20, \"values\": [ { \"approval\": { \"date\": \"2019-09-27T00:37:19.849534+00:00\", \"pullrequest\": { \"type\": \"pullrequest\", \"id\": 5695, \"links\": { \"self\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/atlassian/atlaskit-mk-2/pullrequests/5695\" }, \"html\": { \"href\": \"https://bitbucket.org/atlassian/atlaskit-mk-2/pull-requests/5695\" } }, \"title\": \"username/NONE: small change from onFocus to onClick to handle tabbing through the page and not expand the editor unless a click event triggers it\" }, \"user\": { \"display_name\": \"Name Lastname\", \"uuid\": \"{}\", \"links\": { \"self\": { \"href\": \"https://api.bitbucket.org/2.0/users/%7B%7D\" }, \"html\": { \"href\": \"https://bitbucket.org/%7B%7D/\" }, \"avatar\": { \"href\": \"https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/:/128\" } }, \"type\": \"user\", \"nickname\": \"Name\", \"account_id\": \"\" } }, \"pull_request\": { \"type\": \"pullrequest\", \"id\": 5695, \"links\": { \"self\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/atlassian/atlaskit-mk-2/pullrequests/5695\" }, \"html\": { \"href\": \"https://bitbucket.org/atlassian/atlaskit-mk-2/pull-requests/5695\" } }, \"title\": \"username/NONE: small change from onFocus to onClick to handle tabbing through the page and not expand the editor unless a click event triggers it\" } } ] }

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
repoSlug string This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.
workspace string This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: `{workspace UUID}`.

Return type

(empty response body)

Authorization

api_key, basic, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

RepositoriesWorkspaceRepoSlugPullrequestsGet

PaginatedPullrequests RepositoriesWorkspaceRepoSlugPullrequestsGet(ctx, repoSlug, workspace, optional) List pull requests

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.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
repoSlug string This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.
workspace string This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: `{workspace UUID}`.
optional *PullrequestsApiRepositoriesWorkspaceRepoSlugPullrequestsGetOpts optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a pointer to a PullrequestsApiRepositoriesWorkspaceRepoSlugPullrequestsGetOpts struct

Name Type Description Notes

state | optional.String| Only return pull requests that are in this state. This parameter can be repeated. | page | optional.Int32| page |

Return type

PaginatedPullrequests

Authorization

api_key, basic, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

RepositoriesWorkspaceRepoSlugPullrequestsPost

Pullrequest RepositoriesWorkspaceRepoSlugPullrequestsPost(ctx, repoSlug, workspace, optional) Create a pull request

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

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
repoSlug string This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.
workspace string This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: `{workspace UUID}`.
optional *PullrequestsApiRepositoriesWorkspaceRepoSlugPullrequestsPostOpts optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a pointer to a PullrequestsApiRepositoriesWorkspaceRepoSlugPullrequestsPostOpts struct

Name Type Description Notes

body | optional.Interface of Pullrequest| The new pull request.

The request URL you POST to becomes the destination repository URL. For this reason, you must specify an explicit source repository in the request object if you want to pull from a different repository (fork).

Since not all elements are required or even mutable, you only need to include the elements you want to initialize, such as the source branch and the title. |

Return type

Pullrequest

Authorization

api_key, basic, oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

RepositoriesWorkspaceRepoSlugPullrequestsPullRequestIdActivityGet

RepositoriesWorkspaceRepoSlugPullrequestsPullRequestIdActivityGet(ctx, pullRequestId, repoSlug, workspace) List a pull request activity log

Returns a paginated list of the pull request's activity log. This handler serves both a v20 and internal endpoint. The v20 endpoint returns reviewer comments, updates, approvals and request changes. The internal endpoint includes those plus tasks and attachments. Comments created on a file or a line of code have an inline property. Comment example: { \"pagelen\": 20, \"values\": [ { \"comment\": { \"links\": { \"self\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/atlassian/atlaskit-mk-2/pullrequests/5695/comments/118571088\" }, \"html\": { \"href\": \"https://bitbucket.org/atlassian/atlaskit-mk-2/pull-requests/5695/_/diff#comment-118571088\" } }, \"deleted\": false, \"pullrequest\": { \"type\": \"pullrequest\", \"id\": 5695, \"links\": { \"self\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/atlassian/atlaskit-mk-2/pullrequests/5695\" }, \"html\": { \"href\": \"https://bitbucket.org/atlassian/atlaskit-mk-2/pull-requests/5695\" } }, \"title\": \"username/NONE: small change from onFocus to onClick to handle tabbing through the page and not expand the editor unless a click event triggers it\" }, \"content\": { \"raw\": \"inline with to a dn from lines\", \"markup\": \"markdown\", \"html\": \"<p>inline with to a dn from lines</p>\", \"type\": \"rendered\" }, \"created_on\": \"2019-09-27T00:33:46.039178+00:00\", \"user\": { \"display_name\": \"Name Lastname\", \"uuid\": \"{}\", \"links\": { \"self\": { \"href\": \"https://api.bitbucket.org/2.0/users/%7B%7D\" }, \"html\": { \"href\": \"https://bitbucket.org/%7B%7D/\" }, \"avatar\": { \"href\": \"https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/:/128\" } }, \"type\": \"user\", \"nickname\": \"Name\", \"account_id\": \"\" }, \"created_on\": \"2019-09-27T00:33:46.039178+00:00\", \"user\": { \"display_name\": \"Name Lastname\", \"uuid\": \"{}\", \"links\": { \"self\": { \"href\": \"https://api.bitbucket.org/2.0/users/%7B%7D\" }, \"html\": { \"href\": \"https://bitbucket.org/%7B%7D/\" }, \"avatar\": { \"href\": \"https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/:/128\" } }, \"type\": \"user\", \"nickname\": \"Name\", \"account_id\": \"\" }, \"updated_on\": \"2019-09-27T00:33:46.055384+00:00\", \"inline\": { \"context_lines\": \"\", \"to\": null, \"path\": \"\", \"outdated\": false, \"from\": 211 }, \"type\": \"pullrequest_comment\", \"id\": 118571088 }, \"pull_request\": { \"type\": \"pullrequest\", \"id\": 5695, \"links\": { \"self\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/atlassian/atlaskit-mk-2/pullrequests/5695\" }, \"html\": { \"href\": \"https://bitbucket.org/atlassian/atlaskit-mk-2/pull-requests/5695\" } }, \"title\": \"username/NONE: small change from onFocus to onClick to handle tabbing through the page and not expand the editor unless a click event triggers it\" } } ] } Updates include a state property of OPEN, MERGED, or DECLINED. Update example: { \"pagelen\": 20, \"values\": [ { \"update\": { \"description\": \"\", \"title\": \"username/NONE: small change from onFocus to onClick to handle tabbing through the page and not expand the editor unless a click event triggers it\", \"destination\": { \"commit\": { \"type\": \"commit\", \"hash\": \"6a2c16e4a152\", \"links\": { \"self\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/atlassian/atlaskit-mk-2/commit/6a2c16e4a152\" }, \"html\": { \"href\": \"https://bitbucket.org/atlassian/atlaskit-mk-2/commits/6a2c16e4a152\" } } }, \"branch\": { \"name\": \"master\" }, \"repository\": { \"name\": \"Atlaskit-MK-2\", \"type\": \"repository\", \"full_name\": \"atlassian/atlaskit-mk-2\", \"links\": { \"self\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/atlassian/atlaskit-mk-2\" }, \"html\": { \"href\": \"https://bitbucket.org/atlassian/atlaskit-mk-2\" }, \"avatar\": { \"href\": \"https://bytebucket.org/ravatar/%7B%7D?ts=js\" } }, \"uuid\": \"{}\" } }, \"reason\": \"\", \"source\": { \"commit\": { \"type\": \"commit\", \"hash\": \"728c8bad1813\", \"links\": { \"self\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/atlassian/atlaskit-mk-2/commit/728c8bad1813\" }, \"html\": { \"href\": \"https://bitbucket.org/atlassian/atlaskit-mk-2/commits/728c8bad1813\" } } }, \"branch\": { \"name\": \"username/NONE-add-onClick-prop-for-accessibility\" }, \"repository\": { \"name\": \"Atlaskit-MK-2\", \"type\": \"repository\", \"full_name\": \"atlassian/atlaskit-mk-2\", \"links\": { \"self\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/atlassian/atlaskit-mk-2\" }, \"html\": { \"href\": \"https://bitbucket.org/atlassian/atlaskit-mk-2\" }, \"avatar\": { \"href\": \"https://bytebucket.org/ravatar/%7B%7D?ts=js\" } }, \"uuid\": \"{}\" } }, \"state\": \"OPEN\", \"author\": { \"display_name\": \"Name Lastname\", \"uuid\": \"{}\", \"links\": { \"self\": { \"href\": \"https://api.bitbucket.org/2.0/users/%7B%7D\" }, \"html\": { \"href\": \"https://bitbucket.org/%7B%7D/\" }, \"avatar\": { \"href\": \"https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/:/128\" } }, \"type\": \"user\", \"nickname\": \"Name\", \"account_id\": \"\" }, \"date\": \"2019-05-10T06:48:25.305565+00:00\" }, \"pull_request\": { \"type\": \"pullrequest\", \"id\": 5695, \"links\": { \"self\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/atlassian/atlaskit-mk-2/pullrequests/5695\" }, \"html\": { \"href\": \"https://bitbucket.org/atlassian/atlaskit-mk-2/pull-requests/5695\" } }, \"title\": \"username/NONE: small change from onFocus to onClick to handle tabbing through the page and not expand the editor unless a click event triggers it\" } } ] } Approval example: { \"pagelen\": 20, \"values\": [ { \"approval\": { \"date\": \"2019-09-27T00:37:19.849534+00:00\", \"pullrequest\": { \"type\": \"pullrequest\", \"id\": 5695, \"links\": { \"self\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/atlassian/atlaskit-mk-2/pullrequests/5695\" }, \"html\": { \"href\": \"https://bitbucket.org/atlassian/atlaskit-mk-2/pull-requests/5695\" } }, \"title\": \"username/NONE: small change from onFocus to onClick to handle tabbing through the page and not expand the editor unless a click event triggers it\" }, \"user\": { \"display_name\": \"Name Lastname\", \"uuid\": \"{}\", \"links\": { \"self\": { \"href\": \"https://api.bitbucket.org/2.0/users/%7B%7D\" }, \"html\": { \"href\": \"https://bitbucket.org/%7B%7D/\" }, \"avatar\": { \"href\": \"https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/:/128\" } }, \"type\": \"user\", \"nickname\": \"Name\", \"account_id\": \"\" } }, \"pull_request\": { \"type\": \"pullrequest\", \"id\": 5695, \"links\": { \"self\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/atlassian/atlaskit-mk-2/pullrequests/5695\" }, \"html\": { \"href\": \"https://bitbucket.org/atlassian/atlaskit-mk-2/pull-requests/5695\" } }, \"title\": \"username/NONE: small change from onFocus to onClick to handle tabbing through the page and not expand the editor unless a click event triggers it\" } } ] }

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
pullRequestId int32 The id of the pull request.
repoSlug string This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.
workspace string This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: `{workspace UUID}`.

Return type

(empty response body)

Authorization

api_key, basic, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

RepositoriesWorkspaceRepoSlugPullrequestsPullRequestIdApproveDelete

RepositoriesWorkspaceRepoSlugPullrequestsPullRequestIdApproveDelete(ctx, pullRequestId, repoSlug, workspace) Unapprove a pull request

Redact the authenticated user's approval of the specified pull request.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
pullRequestId int32 The id of the pull request.
repoSlug string This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.
workspace string This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: `{workspace UUID}`.

Return type

(empty response body)

Authorization

api_key, basic, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

RepositoriesWorkspaceRepoSlugPullrequestsPullRequestIdApprovePost

Participant RepositoriesWorkspaceRepoSlugPullrequestsPullRequestIdApprovePost(ctx, pullRequestId, repoSlug, workspace) Approve a pull request

Approve the specified pull request as the authenticated user.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
pullRequestId int32 The id of the pull request.
repoSlug string This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.
workspace string This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: `{workspace UUID}`.

Return type

Participant

Authorization

api_key, basic, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

RepositoriesWorkspaceRepoSlugPullrequestsPullRequestIdCommentsCommentIdDelete

RepositoriesWorkspaceRepoSlugPullrequestsPullRequestIdCommentsCommentIdDelete(ctx, commentId, pullRequestId, repoSlug, workspace) Delete a comment on a pull request

Deletes a specific pull request comment.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
commentId int32 The id of the comment.
pullRequestId int32 The id of the pull request.
repoSlug string This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.
workspace string This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: `{workspace UUID}`.

Return type

(empty response body)

Authorization

api_key, basic, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

RepositoriesWorkspaceRepoSlugPullrequestsPullRequestIdCommentsCommentIdGet

PullrequestComment RepositoriesWorkspaceRepoSlugPullrequestsPullRequestIdCommentsCommentIdGet(ctx, commentId, pullRequestId, repoSlug, workspace) Get a comment on a pull request

Returns a specific pull request comment.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
commentId int32 The id of the comment.
pullRequestId int32 The id of the pull request.
repoSlug string This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.
workspace string This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: `{workspace UUID}`.

Return type

PullrequestComment

Authorization

api_key, basic, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

RepositoriesWorkspaceRepoSlugPullrequestsPullRequestIdCommentsCommentIdPut

PullrequestComment RepositoriesWorkspaceRepoSlugPullrequestsPullRequestIdCommentsCommentIdPut(ctx, body, commentId, pullRequestId, repoSlug, workspace) Update a comment on a pull request

Updates a specific pull request comment.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
body PullrequestComment The contents of the updated comment.
commentId int32 The id of the comment.
pullRequestId int32 The id of the pull request.
repoSlug string This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.
workspace string This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: `{workspace UUID}`.

Return type

PullrequestComment

Authorization

api_key, basic, oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

RepositoriesWorkspaceRepoSlugPullrequestsPullRequestIdCommentsCommentIdResolveDelete

RepositoriesWorkspaceRepoSlugPullrequestsPullRequestIdCommentsCommentIdResolveDelete(ctx, commentId, pullRequestId, repoSlug, workspace) Reopen a comment thread

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
commentId int32 The id of the comment.
pullRequestId int32 The id of the pull request.
repoSlug string This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.
workspace string This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: `{workspace UUID}`.

Return type

(empty response body)

Authorization

api_key, basic, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

RepositoriesWorkspaceRepoSlugPullrequestsPullRequestIdCommentsCommentIdResolvePost

ModelError RepositoriesWorkspaceRepoSlugPullrequestsPullRequestIdCommentsCommentIdResolvePost(ctx, commentId, pullRequestId, repoSlug, workspace) Resolve a comment thread

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
commentId int32 The id of the comment.
pullRequestId int32 The id of the pull request.
repoSlug string This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.
workspace string This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: `{workspace UUID}`.

Return type

ModelError

Authorization

api_key, basic, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

RepositoriesWorkspaceRepoSlugPullrequestsPullRequestIdCommentsGet

PaginatedPullrequestComments RepositoriesWorkspaceRepoSlugPullrequestsPullRequestIdCommentsGet(ctx, pullRequestId, repoSlug, workspace, optional) List comments on a pull request

Returns a paginated list of the pull request's comments. This includes both global, inline comments and replies. The default sorting is oldest to newest and can be overridden with the sort query parameter. This endpoint also supports filtering and sorting of the results. See filtering and sorting for more details.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
pullRequestId int32 The id of the pull request.
repoSlug string This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.
workspace string This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: `{workspace UUID}`.
optional *PullrequestsApiRepositoriesWorkspaceRepoSlugPullrequestsPullRequestIdCommentsGetOpts optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a pointer to a PullrequestsApiRepositoriesWorkspaceRepoSlugPullrequestsPullRequestIdCommentsGetOpts struct

Name Type Description Notes

page | optional.Int32| page |

Return type

PaginatedPullrequestComments

Authorization

api_key, basic, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

RepositoriesWorkspaceRepoSlugPullrequestsPullRequestIdCommentsPost

PullrequestComment RepositoriesWorkspaceRepoSlugPullrequestsPullRequestIdCommentsPost(ctx, body, pullRequestId, repoSlug, workspace) Create a comment on a pull request

Creates a new pull request comment. Returns the newly created pull request comment.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
body PullrequestComment The comment object.
pullRequestId int32 The id of the pull request.
repoSlug string This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.
workspace string This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: `{workspace UUID}`.

Return type

PullrequestComment

Authorization

api_key, basic, oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

RepositoriesWorkspaceRepoSlugPullrequestsPullRequestIdCommitsGet

RepositoriesWorkspaceRepoSlugPullrequestsPullRequestIdCommitsGet(ctx, pullRequestId, repoSlug, workspace) List commits on a pull request

Returns a paginated list of the pull request's commits. These are the commits that are being merged into the destination branch when the pull requests gets accepted.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
pullRequestId int32 The id of the pull request.
repoSlug string This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.
workspace string This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: `{workspace UUID}`.

Return type

(empty response body)

Authorization

api_key, basic, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

RepositoriesWorkspaceRepoSlugPullrequestsPullRequestIdDeclinePost

Pullrequest RepositoriesWorkspaceRepoSlugPullrequestsPullRequestIdDeclinePost(ctx, pullRequestId, repoSlug, workspace) Decline a pull request

Declines the pull request.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
pullRequestId int32 The id of the pull request.
repoSlug string This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.
workspace string This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: `{workspace UUID}`.

Return type

Pullrequest

Authorization

api_key, basic, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

RepositoriesWorkspaceRepoSlugPullrequestsPullRequestIdDiffGet

RepositoriesWorkspaceRepoSlugPullrequestsPullRequestIdDiffGet(ctx, pullRequestId, repoSlug, workspace) List changes in a pull request

Redirects to the repository diff with the revspec that corresponds to the pull request.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
pullRequestId int32 The id of the pull request.
repoSlug string This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.
workspace string This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: `{workspace UUID}`.

Return type

(empty response body)

Authorization

api_key, basic, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

RepositoriesWorkspaceRepoSlugPullrequestsPullRequestIdDiffstatGet

RepositoriesWorkspaceRepoSlugPullrequestsPullRequestIdDiffstatGet(ctx, pullRequestId, repoSlug, workspace) Get the diff stat for a pull request

Redirects to the repository diffstat with the revspec that corresponds to the pull request.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
pullRequestId int32 The id of the pull request.
repoSlug string This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.
workspace string This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: `{workspace UUID}`.

Return type

(empty response body)

Authorization

api_key, basic, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

RepositoriesWorkspaceRepoSlugPullrequestsPullRequestIdGet

Pullrequest RepositoriesWorkspaceRepoSlugPullrequestsPullRequestIdGet(ctx, pullRequestId, repoSlug, workspace) Get a pull request

Returns the specified pull request.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
pullRequestId int32 The id of the pull request.
repoSlug string This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.
workspace string This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: `{workspace UUID}`.

Return type

Pullrequest

Authorization

api_key, basic, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

RepositoriesWorkspaceRepoSlugPullrequestsPullRequestIdMergePost

Pullrequest RepositoriesWorkspaceRepoSlugPullrequestsPullRequestIdMergePost(ctx, pullRequestId, repoSlug, workspace, optional) Merge a pull request

Merges the pull request.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
pullRequestId int32 The id of the pull request.
repoSlug string This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.
workspace string This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: `{workspace UUID}`.
optional *PullrequestsApiRepositoriesWorkspaceRepoSlugPullrequestsPullRequestIdMergePostOpts optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a pointer to a PullrequestsApiRepositoriesWorkspaceRepoSlugPullrequestsPullRequestIdMergePostOpts struct

Name Type Description Notes

body | optional.Interface of ModelError| | async | optional.| Default value is false. When set to true, runs merge asynchronously and immediately returns a 202 with polling link to the task-status API in the Location header. When set to false, runs merge and waits for it to complete, returning 200 when it succeeds. If the duration of the merge exceeds a timeout threshold, the API returns a 202 with polling link to the task-status API in the Location header. |

Return type

Pullrequest

Authorization

api_key, basic, oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

RepositoriesWorkspaceRepoSlugPullrequestsPullRequestIdMergeTaskStatusTaskIdGet

RepositoriesWorkspaceRepoSlugPullrequestsPullRequestIdMergeTaskStatusTaskIdGet(ctx, pullRequestId, repoSlug, taskId, workspace) Get the merge task status for a pull request

When merging a pull request takes too long, the client receives a task ID along with a 202 status code. The task ID can be used in a call to this endpoint to check the status of a merge task. curl -X GET https://api.bitbucket.org/2.0/repositories/atlassian/bitbucket/pullrequests/2286/merge/task-status/<task_id> If the merge task is not yet finished, a PENDING status will be returned. HTTP/2 200 { \"task_status\": \"PENDING\", \"links\": { \"self\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/atlassian/bitbucket/pullrequests/2286/merge/task-status/<task_id>\" } } } If the merge was successful, a SUCCESS status will be returned. HTTP/2 200 { \"task_status\": \"SUCCESS\", \"links\": { \"self\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/atlassian/bitbucket/pullrequests/2286/merge/task-status/<task_id>\" } }, \"merge_result\": <the merged pull request object> } If the merge task failed, an error will be returned. { \"type\": \"error\", \"error\": { \"message\": \"<error message>\" } }

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
pullRequestId int32 The id of the pull request.
repoSlug string This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.
taskId string ID of the merge task
workspace string This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: `{workspace UUID}`.

Return type

(empty response body)

Authorization

api_key, basic, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

RepositoriesWorkspaceRepoSlugPullrequestsPullRequestIdPatchGet

RepositoriesWorkspaceRepoSlugPullrequestsPullRequestIdPatchGet(ctx, pullRequestId, repoSlug, workspace) Get the patch for a pull request

Redirects to the repository patch with the revspec that corresponds to pull request.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
pullRequestId int32 The id of the pull request.
repoSlug string This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.
workspace string This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: `{workspace UUID}`.

Return type

(empty response body)

Authorization

api_key, basic, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

RepositoriesWorkspaceRepoSlugPullrequestsPullRequestIdPut

Pullrequest RepositoriesWorkspaceRepoSlugPullrequestsPullRequestIdPut(ctx, pullRequestId, repoSlug, workspace, optional) Update a pull request

Mutates the specified pull request. This can be used to change the pull request's branches or description. Only open pull requests can be mutated.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
pullRequestId int32 The id of the pull request.
repoSlug string This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.
workspace string This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: `{workspace UUID}`.
optional *PullrequestsApiRepositoriesWorkspaceRepoSlugPullrequestsPullRequestIdPutOpts optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a pointer to a PullrequestsApiRepositoriesWorkspaceRepoSlugPullrequestsPullRequestIdPutOpts struct

Name Type Description Notes

body | optional.Interface of Pullrequest| The pull request that is to be updated. |

Return type

Pullrequest

Authorization

api_key, basic, oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

RepositoriesWorkspaceRepoSlugPullrequestsPullRequestIdRequestChangesDelete

RepositoriesWorkspaceRepoSlugPullrequestsPullRequestIdRequestChangesDelete(ctx, pullRequestId, repoSlug, workspace) Remove change request for a pull request

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
pullRequestId int32 The id of the pull request.
repoSlug string This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.
workspace string This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: `{workspace UUID}`.

Return type

(empty response body)

Authorization

api_key, basic, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

RepositoriesWorkspaceRepoSlugPullrequestsPullRequestIdRequestChangesPost

Participant RepositoriesWorkspaceRepoSlugPullrequestsPullRequestIdRequestChangesPost(ctx, pullRequestId, repoSlug, workspace) Request changes for a pull request

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
pullRequestId int32 The id of the pull request.
repoSlug string This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.
workspace string This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: `{workspace UUID}`.

Return type

Participant

Authorization

api_key, basic, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

RepositoriesWorkspaceRepoSlugPullrequestsPullRequestIdStatusesGet

PaginatedCommitstatuses RepositoriesWorkspaceRepoSlugPullrequestsPullRequestIdStatusesGet(ctx, pullRequestId, repoSlug, workspace, optional) List commit statuses for a pull request

Returns all statuses (e.g. build results) for the given pull request.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
pullRequestId int32 The id of the pull request.
repoSlug string This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.
workspace string This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: `{workspace UUID}`.
optional *PullrequestsApiRepositoriesWorkspaceRepoSlugPullrequestsPullRequestIdStatusesGetOpts optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a pointer to a PullrequestsApiRepositoriesWorkspaceRepoSlugPullrequestsPullRequestIdStatusesGetOpts struct

Name Type Description Notes

q | optional.String| Query string to narrow down the response as per filtering and sorting. | sort | optional.String| Field by which the results should be sorted as per filtering and sorting. Defaults to `created_on`. | page | optional.Int32| page |

Return type

PaginatedCommitstatuses

Authorization

api_key, basic, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

RepositoriesWorkspaceRepoSlugPullrequestsPullRequestIdTasksGet

PaginatedTasks RepositoriesWorkspaceRepoSlugPullrequestsPullRequestIdTasksGet(ctx, pullRequestId, repoSlug, workspace, optional) List tasks on a pull request

Returns a paginated list of the pull request's tasks. This endpoint supports filtering and sorting of the results by the 'task' field. See filtering and sorting for more details.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
pullRequestId int32 The id of the pull request.
repoSlug string This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.
workspace string This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: `{workspace UUID}`.
optional *PullrequestsApiRepositoriesWorkspaceRepoSlugPullrequestsPullRequestIdTasksGetOpts optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a pointer to a PullrequestsApiRepositoriesWorkspaceRepoSlugPullrequestsPullRequestIdTasksGetOpts struct

Name Type Description Notes

q | optional.String| Query string to narrow down the response. See filtering and sorting for details. | sort | optional.String| Field by which the results should be sorted as per filtering and sorting. Defaults to `created_on`. | pagelen | optional.Int32| 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. |

Return type

PaginatedTasks

Authorization

api_key, basic, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

RepositoriesWorkspaceRepoSlugPullrequestsPullRequestIdTasksPost

APullrequestCommentTask RepositoriesWorkspaceRepoSlugPullrequestsPullRequestIdTasksPost(ctx, body, pullRequestId, repoSlug, workspace) Create a task on a pull request

Creates a new pull request task. Returns the newly created pull request task. Tasks can optionally be created in relation to a comment specified by the comment's ID which will cause the task to appear below the comment on a pull request when viewed in Bitbucket.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
body APullrequestTaskCreate The contents of the task
pullRequestId int32 The id of the pull request.
repoSlug string This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.
workspace string This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: `{workspace UUID}`.

Return type

[APullrequestCommentTask](A pullrequest comment task.md)

Authorization

api_key, basic, oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

RepositoriesWorkspaceRepoSlugPullrequestsPullRequestIdTasksTaskIdDelete

RepositoriesWorkspaceRepoSlugPullrequestsPullRequestIdTasksTaskIdDelete(ctx, pullRequestId, repoSlug, taskId, workspace) Delete a task on a pull request

Deletes a specific pull request task.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
pullRequestId int32 The id of the pull request.
repoSlug string This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.
taskId int32 The ID of the task.
workspace string This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: `{workspace UUID}`.

Return type

(empty response body)

Authorization

api_key, basic, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

RepositoriesWorkspaceRepoSlugPullrequestsPullRequestIdTasksTaskIdGet

APullrequestCommentTask RepositoriesWorkspaceRepoSlugPullrequestsPullRequestIdTasksTaskIdGet(ctx, pullRequestId, repoSlug, taskId, workspace) Get a task on a pull request

Returns a specific pull request task.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
pullRequestId int32 The id of the pull request.
repoSlug string This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.
taskId int32 The ID of the task.
workspace string This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: `{workspace UUID}`.

Return type

[APullrequestCommentTask](A pullrequest comment task.md)

Authorization

api_key, basic, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

RepositoriesWorkspaceRepoSlugPullrequestsPullRequestIdTasksTaskIdPut

APullrequestCommentTask RepositoriesWorkspaceRepoSlugPullrequestsPullRequestIdTasksTaskIdPut(ctx, body, pullRequestId, repoSlug, taskId, workspace) Update a task on a pull request

Updates a specific pull request task.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
body APullrequestTaskUpdate The updated state and content of the task.
pullRequestId int32 The id of the pull request.
repoSlug string This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.
taskId int32 The ID of the task.
workspace string This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: `{workspace UUID}`.

Return type

[APullrequestCommentTask](A pullrequest comment task.md)

Authorization

api_key, basic, oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]