openapi: 3.1.0 info: title: Atlassian Admin Account Merge API description: The Atlassian Admin API provides programmatic access to manage Atlassian organizations, users, domains, policies, and events. It enables administrators to automate organization management tasks, integrate with identity providers, and ensure appropriate access to Atlassian products. version: 1.0.0 contact: name: Atlassian Developer url: https://developer.atlassian.com/cloud/admin/ license: name: Atlassian Developer Terms url: https://developer.atlassian.com/platform/marketplace/atlassian-developer-terms/ x-logo: url: https://wac-cdn.atlassian.com/assets/img/favicons/atlassian/favicon.png servers: - url: https://api.atlassian.com description: Atlassian Cloud API security: - bearerAuth: [] - oauth2: [] tags: - name: Merge paths: /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/merge: parameters: - name: pull_request_id in: path description: The id of the pull request. required: true schema: type: integer - name: repo_slug in: path description: 'This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`. ' required: true schema: type: string - name: workspace in: path description: 'This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: `{workspace UUID}`. ' required: true schema: type: string post: tags: - Merge description: This API endpoint allows you to merge a pull request in a Bitbucket repository by sending a POST request to the specified path with the workspace name, repository slug, and pull request ID. When executed, it attempts to merge the source branch into the destination branch of the pull request, completing the code review process and incorporating the proposed changes into the target branch. The operation requires appropriate permissions and will fail if there are merge conflicts, failing builds, or if required approvals haven't been met according to the repository's merge settings. Additional parameters can be passed in the request body to specify merge strategies, commit messages, and whether to close the source branch after merging. summary: Atlassian Merge Pull Request responses: '200': description: The pull request object. content: application/json: schema: $ref: '#/components/schemas/pullrequest' examples: undefined: $ref: '#/components/examples/undefined' '202': description: In the Location header, the URL to poll for the pull request merge status '555': description: 'If the merge took too long and timed out. In this case the caller should retry the request later' content: application/json: schema: $ref: '#/components/schemas/error' parameters: - name: async in: query description: '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.' required: false schema: type: boolean requestBody: content: application/json: schema: $ref: '#/components/schemas/pullrequest_merge_parameters' examples: pull-request-merge-parameters: $ref: '#/components/examples/pull-request-merge-parameters' security: - oauth2: - pullrequest:write - basic: [] - api_key: [] x-atlassian-oauth2-scopes: - state: Current scheme: oauth2 scopes: - read:pullrequest:bitbucket - write:pullrequest:bitbucket operationId: mergePullRequest x-microcks-operation: delay: 0 dispatcher: FALLBACK /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/merge/task-status/{task_id}: parameters: - name: pull_request_id in: path description: The id of the pull request. required: true schema: type: integer - name: repo_slug in: path description: 'This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`. ' required: true schema: type: string - name: task_id in: path description: ID of the merge task required: true schema: type: string - name: workspace in: path description: 'This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: `{workspace UUID}`. ' required: true schema: type: string get: tags: - Merge description: This GET endpoint retrieves the current status of a merge task for a specific pull request in a Bitbucket repository. By providing the workspace identifier, repository slug, pull request ID, and task ID in the URL path, users can poll this endpoint to monitor the progress of an asynchronous merge operation. The response typically includes information about whether the merge task is pending, in progress, completed successfully, or has failed, along with any relevant error messages or completion details. This is particularly useful for tracking long-running merge operations or implementing automated workflows that need to wait for merge completion before proceeding with subsequent actions. summary: Atlassian Get the Merge Task Status for Pull Request responses: '200': description: Returns a task status if the merge is either pending or successful, and if it is successful, a pull request '400': description: If the provided task ID does not relate to this pull request, or if something went wrong during the merge operation '403': description: The user making the request does not have permission to the repo and is different from the user who queued the task security: - oauth2: - pullrequest - basic: [] - api_key: [] x-atlassian-oauth2-scopes: - state: Current scheme: oauth2 scopes: - read:pullrequest:bitbucket operationId: getTheMergeTaskStatusForPullRequest x-microcks-operation: delay: 0 dispatcher: FALLBACK components: schemas: participant: allOf: - $ref: '#/components/schemas/object' - type: object title: Participant description: Object describing a user's role on resources like commits or pull requests. properties: user: $ref: '#/components/schemas/account' role: type: string enum: - PARTICIPANT - REVIEWER approved: type: boolean state: type: string enum: - approved - changes_requested - null participated_on: type: string description: 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. format: date-time additionalProperties: true account: allOf: - $ref: '#/components/schemas/object' - type: object title: Account description: An account object. properties: links: $ref: '#/components/schemas/account_links' created_on: type: string format: date-time display_name: type: string username: type: string pattern: ^[a-zA-Z0-9_\-]+$ uuid: type: string additionalProperties: true team_links: allOf: - $ref: '#/components/schemas/account_links' - type: object title: Team Links description: Links related to a Team. properties: self: $ref: '#/components/schemas/link' html: $ref: '#/components/schemas/link' members: $ref: '#/components/schemas/link' projects: $ref: '#/components/schemas/link' repositories: $ref: '#/components/schemas/link' additionalProperties: true project: allOf: - $ref: '#/components/schemas/object' - type: object title: Project description: "A Bitbucket project.\n Projects are used by teams to organize repositories." properties: links: type: object properties: html: type: object title: Link description: A link to a resource related to this object. properties: href: type: string format: uri name: type: string additionalProperties: false avatar: type: object title: Link description: A link to a resource related to this object. properties: href: type: string format: uri name: type: string additionalProperties: false additionalProperties: false uuid: type: string description: The project's immutable id. key: type: string description: The project's key. owner: $ref: '#/components/schemas/team' name: type: string description: The name of the project. description: type: string is_private: type: boolean description: ' Indicates whether the project is publicly accessible, or whether it is private to the team and consequently only visible to team members. Note that private projects cannot contain public repositories.' created_on: type: string format: date-time updated_on: type: string format: date-time has_publicly_visible_repos: type: boolean description: ' Indicates whether the project contains publicly visible repositories. Note that private projects cannot contain public repositories.' additionalProperties: true error: type: object title: Error description: 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`. properties: type: type: string example: example_value error: type: object properties: message: type: string detail: type: string data: type: object description: Optional structured data that is endpoint-specific. properties: {} additionalProperties: true required: - message additionalProperties: false example: example_value required: - type additionalProperties: true pullrequest: allOf: - $ref: '#/components/schemas/object' - type: object title: Pull Request description: A pull request object. properties: links: type: object properties: self: type: object title: Link description: A link to a resource related to this object. properties: href: type: string format: uri name: type: string additionalProperties: false html: type: object title: Link description: A link to a resource related to this object. properties: href: type: string format: uri name: type: string additionalProperties: false commits: type: object title: Link description: A link to a resource related to this object. properties: href: type: string format: uri name: type: string additionalProperties: false approve: type: object title: Link description: A link to a resource related to this object. properties: href: type: string format: uri name: type: string additionalProperties: false diff: type: object title: Link description: A link to a resource related to this object. properties: href: type: string format: uri name: type: string additionalProperties: false diffstat: type: object title: Link description: A link to a resource related to this object. properties: href: type: string format: uri name: type: string additionalProperties: false comments: type: object title: Link description: A link to a resource related to this object. properties: href: type: string format: uri name: type: string additionalProperties: false activity: type: object title: Link description: A link to a resource related to this object. properties: href: type: string format: uri name: type: string additionalProperties: false merge: type: object title: Link description: A link to a resource related to this object. properties: href: type: string format: uri name: type: string additionalProperties: false decline: type: object title: Link description: A link to a resource related to this object. properties: href: type: string format: uri name: type: string additionalProperties: false additionalProperties: false id: type: integer description: The pull request's unique ID. Note that pull request IDs are only unique within their associated repository. title: type: string description: Title of the pull request. rendered: type: object title: Rendered Pull Request Markup description: User provided pull request text, interpreted in a markup language and rendered in HTML properties: title: type: object properties: raw: type: string description: The text as it was typed by a user. markup: type: string description: The type of markup language the raw content is to be interpreted in. enum: - markdown - creole - plaintext html: type: string description: The user's content rendered as HTML. additionalProperties: false description: type: object properties: raw: type: string description: The text as it was typed by a user. markup: type: string description: The type of markup language the raw content is to be interpreted in. enum: - markdown - creole - plaintext html: type: string description: The user's content rendered as HTML. additionalProperties: false reason: type: object properties: raw: type: string description: The text as it was typed by a user. markup: type: string description: The type of markup language the raw content is to be interpreted in. enum: - markdown - creole - plaintext html: type: string description: The user's content rendered as HTML. additionalProperties: false additionalProperties: false summary: type: object properties: raw: type: string description: The text as it was typed by a user. markup: type: string description: The type of markup language the raw content is to be interpreted in. enum: - markdown - creole - plaintext html: type: string description: The user's content rendered as HTML. additionalProperties: false state: type: string description: The pull request's current status. enum: - OPEN - MERGED - DECLINED - SUPERSEDED author: $ref: '#/components/schemas/account' source: $ref: '#/components/schemas/pullrequest_endpoint' destination: $ref: '#/components/schemas/pullrequest_endpoint' merge_commit: type: object title: Pull Request Commit properties: hash: type: string pattern: '[0-9a-f]{7,}?' additionalProperties: false comment_count: type: integer description: The number of comments for a specific pull request. minimum: 0 task_count: type: integer description: The number of open tasks for a specific pull request. minimum: 0 close_source_branch: type: boolean description: A boolean flag indicating if merging the pull request closes the source branch. closed_by: $ref: '#/components/schemas/account' reason: type: string description: Explains why a pull request was declined. This field is only applicable to pull requests in rejected state. created_on: type: string description: The ISO8601 timestamp the request was created. format: date-time updated_on: type: string description: The ISO8601 timestamp the request was last updated. format: date-time reviewers: type: array description: 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. items: $ref: '#/components/schemas/account' participants: type: array description: " The list of users that are collaborating on this pull request.\n Collaborators are user that:\n\n * are added to the pull request as a reviewer (part of the reviewers\n list)\n * are not explicit reviewers, but have commented on the pull request\n * are not explicit reviewers, but have approved the pull request\n\n Each user is wrapped in an object that indicates the user's role and\n whether they have approved the pull request. For performance reasons,\n the API only returns this list when an API requests a pull request by\n id.\n " items: $ref: '#/components/schemas/participant' additionalProperties: true author: allOf: - $ref: '#/components/schemas/object' - type: object title: Author description: The author of a change in a repository properties: raw: type: string description: The raw author value from the repository. This may be the only value available if the author does not match a user in Bitbucket. user: $ref: '#/components/schemas/account' additionalProperties: true pullrequest_endpoint: type: object title: Pull Request Endpoint properties: repository: $ref: '#/components/schemas/repository' branch: type: object title: Pull Request Branch properties: name: type: string merge_strategies: type: array description: Available merge strategies, when this endpoint is the destination of the pull request. items: type: string enum: - merge_commit - squash - fast_forward default_merge_strategy: type: string description: The default merge strategy, when this endpoint is the destination of the pull request. additionalProperties: false example: example_value commit: type: object title: Pull Request Commit properties: hash: type: string pattern: '[0-9a-f]{7,}?' additionalProperties: false example: example_value additionalProperties: false team: allOf: - $ref: '#/components/schemas/account' - type: object title: Team description: A team object. properties: links: $ref: '#/components/schemas/team_links' additionalProperties: true object: type: object description: 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`. properties: type: type: string example: example_value required: - type additionalProperties: true discriminator: propertyName: type repository: allOf: - $ref: '#/components/schemas/object' - type: object title: Repository description: A Bitbucket repository. properties: links: type: object properties: self: type: object title: Link description: A link to a resource related to this object. properties: href: type: string format: uri name: type: string additionalProperties: false html: type: object title: Link description: A link to a resource related to this object. properties: href: type: string format: uri name: type: string additionalProperties: false avatar: type: object title: Link description: A link to a resource related to this object. properties: href: type: string format: uri name: type: string additionalProperties: false pullrequests: type: object title: Link description: A link to a resource related to this object. properties: href: type: string format: uri name: type: string additionalProperties: false commits: type: object title: Link description: A link to a resource related to this object. properties: href: type: string format: uri name: type: string additionalProperties: false forks: type: object title: Link description: A link to a resource related to this object. properties: href: type: string format: uri name: type: string additionalProperties: false watchers: type: object title: Link description: A link to a resource related to this object. properties: href: type: string format: uri name: type: string additionalProperties: false downloads: type: object title: Link description: A link to a resource related to this object. properties: href: type: string format: uri name: type: string additionalProperties: false clone: type: array items: type: object title: Link description: A link to a resource related to this object. properties: href: type: string format: uri name: type: string additionalProperties: false hooks: type: object title: Link description: A link to a resource related to this object. properties: href: type: string format: uri name: type: string additionalProperties: false additionalProperties: false uuid: type: string description: The repository's immutable id. This can be used as a substitute for the slug segment in URLs. Doing this guarantees your URLs will survive renaming of the repository by its owner, or even transfer of the repository to a different user. full_name: type: string description: The concatenation of the repository owner's username and the slugified name, e.g. "evzijst/interruptingcow". This is the same string used in Bitbucket URLs. is_private: type: boolean parent: $ref: '#/components/schemas/repository' scm: type: string enum: - git owner: $ref: '#/components/schemas/account' name: type: string description: type: string created_on: type: string format: date-time updated_on: type: string format: date-time size: type: integer language: type: string has_issues: type: boolean description: ' The issue tracker for this repository is enabled. Issue Tracker features are not supported for repositories in workspaces administered through admin.atlassian.com. ' has_wiki: type: boolean description: ' The wiki for this repository is enabled. Wiki features are not supported for repositories in workspaces administered through admin.atlassian.com. ' fork_policy: type: string description: "\nControls the rules for forking this repository.\n\n* **allow_forks**: unrestricted forking\n* **no_public_forks**: restrict forking to private forks (forks cannot\n be made public later)\n* **no_forks**: deny all forking\n" enum: - allow_forks - no_public_forks - no_forks project: $ref: '#/components/schemas/project' mainbranch: $ref: '#/components/schemas/branch' additionalProperties: true account_links: type: object title: Account Links description: Links related to an Account. properties: avatar: $ref: '#/components/schemas/link' additionalProperties: true pullrequest_merge_parameters: type: object title: Pull Request Merge Parameters description: The metadata that describes a pull request merge. properties: type: type: string example: example_value message: type: string description: The commit message that will be used on the resulting commit. example: example_value close_source_branch: type: boolean description: Whether the source branch should be deleted. If this is not provided, we fallback to the value used when the pull request was created, which defaults to False example: true merge_strategy: type: string description: The merge strategy that will be used to merge the pull request. enum: - merge_commit - squash - fast_forward default: merge_commit example: merge_commit required: - type additionalProperties: true link: type: object title: Link description: A link to a resource related to this object. properties: href: type: string format: uri example: https://www.example.com name: type: string example: Example Title additionalProperties: false base_commit: allOf: - $ref: '#/components/schemas/object' - type: object title: Base Commit description: The common base type for both repository and snippet commits. properties: hash: type: string pattern: '[0-9a-f]{7,}?' date: type: string format: date-time author: $ref: '#/components/schemas/author' message: type: string summary: type: object properties: raw: type: string description: The text as it was typed by a user. markup: type: string description: The type of markup language the raw content is to be interpreted in. enum: - markdown - creole - plaintext html: type: string description: The user's content rendered as HTML. additionalProperties: false parents: type: array items: $ref: '#/components/schemas/base_commit' minItems: 0 additionalProperties: true branch: allOf: - $ref: '#/components/schemas/ref' - type: object title: Branch description: A branch object, representing a branch in a repository. properties: merge_strategies: type: array description: Available merge strategies for pull requests targeting this branch. items: type: string enum: - merge_commit - squash - fast_forward default_merge_strategy: type: string description: The default merge strategy for pull requests targeting this branch. additionalProperties: true commit: allOf: - $ref: '#/components/schemas/base_commit' - type: object title: Commit description: A repository commit object. properties: repository: $ref: '#/components/schemas/repository' participants: type: array items: $ref: '#/components/schemas/participant' minItems: 0 additionalProperties: true ref: type: object title: Ref description: A ref object, representing a branch or tag in a repository. properties: type: type: string example: example_value links: type: object properties: self: type: object title: Link description: A link to a resource related to this object. properties: href: type: string format: uri name: type: string additionalProperties: false commits: type: object title: Link description: A link to a resource related to this object. properties: href: type: string format: uri name: type: string additionalProperties: false html: type: object title: Link description: A link to a resource related to this object. properties: href: type: string format: uri name: type: string additionalProperties: false additionalProperties: false example: example_value name: type: string description: The name of the ref. example: Example Title target: $ref: '#/components/schemas/commit' required: - type additionalProperties: true examples: pull-request-merge-parameters: type: pullrequest_merge message: 'Merge pull request #123: Add new feature' close_source_branch: true merge_strategy: squash undefined: id: 12345 created_on: '2023-10-15T14:30:00.000000+00:00' updated_on: '2023-10-15T15:45:00.000000+00:00' content: raw: This looks good to me! markup: markdown html:

This looks good to me!

user: display_name: John Doe uuid: '{a1b2c3d4-e5f6-7g8h-9i0j-k1l2m3n4o5p6}' username: johndoe type: user deleted: false parent: id: 12340 inline: to: 15 from: 10 path: src/main.py type: pullrequest_comment pullrequest: id: 789 title: Add new feature type: pullrequest resolution: status: resolved timestamp: '2023-10-15T16:00:00.000000+00:00' pending: false securitySchemes: bearerAuth: type: http scheme: bearer bearerFormat: API Key description: Use an Atlassian API key as a Bearer token. Create API keys at https://admin.atlassian.com. oauth2: type: oauth2 description: OAuth 2.0 authorization for Atlassian Cloud APIs. flows: authorizationCode: authorizationUrl: https://auth.atlassian.com/authorize tokenUrl: https://auth.atlassian.com/oauth/token scopes: read:org:admin: Read organization information. write:org:admin: Modify organization settings. read:user:admin: Read user information. write:user:admin: Modify user accounts. read:policy:admin: Read organization policies. write:policy:admin: Modify organization policies. read:event:admin: Read organization events. externalDocs: description: Atlassian Admin REST API Documentation url: https://developer.atlassian.com/cloud/admin/organization/rest/intro/