Atlassian Branches API

The Branches API from Atlassian — 6 operation(s) for branches.

Documentation

📖
Documentation
https://developer.atlassian.com/cloud/bitbucket/rest/api-group-addon/
📖
Documentation
https://developer.atlassian.com/cloud/bitbucket/rest/api-group-webhooks/
📖
Documentation
https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/
📖
Documentation
https://developer.atlassian.com/cloud/bitbucket/rest/api-group-repositories/
📖
Documentation
https://developer.atlassian.com/cloud/bitbucket/rest/api-group-snippets/
📖
Documentation
https://developer.atlassian.com/cloud/bitbucket/rest/api-group-workspaces/
📖
Documentation
https://developer.atlassian.com/cloud/bitbucket/rest/api-group-users/
📖
Documentation
https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-analytics/
📖
Documentation
https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-audit/
📖
Documentation
https://developer.atlassian.com/cloud/confluence/connect-modules/
📖
Documentation
https://developer.atlassian.com/cloud/confluence/rest/v2/intro/
📖
Documentation
https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-body/
📖
Documentation
https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-states/
📖
Documentation
https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-group/
📖
Documentation
https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-inline-tasks
📖
Documentation
https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-labels/
📖
Documentation
https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-long-running-task/
📖
Documentation
https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-relation/
📖
Documentation
https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-search/
📖
Documentation
https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-settings/
📖
Documentation
https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-space/
📖
Documentation
https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-template/
📖
Documentation
https://developer.atlassian.com/cloud/confluence/rest/v2/api-group-user/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-announcement-banner/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-custom-field-values--apps-/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-app-openapi
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-application-roles/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-attachments/
📖
Documentation
https://developer.atlassian.com/server/framework/atlassian-sdk/audit/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-avatars/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-classification-levels/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-comments/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-project-components/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-jira-settings/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/getting-started-with-connect/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/connect-api-migration/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-service-registry/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-custom-field-options/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-dashboards/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/data-security-policy-developer-guide/
📖
Documentation
https://developer.atlassian.com/platform/forge/events-reference/jira/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-jira-expressions/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-fields/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-field-configurations/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-filters/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/forge/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-groups/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-group-and-user-picker/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-groups/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-issues/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-links/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-security-schemes/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-issue-types/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-type-schemes/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-type-screen-schemes/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-search/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-labels/
📖
Documentation
https://developer.atlassian.com/platform/marketplace/license-api-for-cloud-apps/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-license-metrics/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-permissions/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-myself/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-notification-schemes/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-project-permission-schemes/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-issue-priorities/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-projects/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-project-categories/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-project-key-and-name-validation/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-resolutions/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-project-roles/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-screens/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-screen-schemes/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-security-level/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-server-info/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-workflow-statuses/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-workflow-status-categories/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-tasks/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-ui-modifications--apps-/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-avatars/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-users/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-project-versions/
📖
Documentation
https://developer.atlassian.com/server/jira/platform/webhooks/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-workflows/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-workflow-schemes/
📖
Documentation
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-worklogs/
📖
Documentation
https://developer.atlassian.com/cloud/admin/organization/rest/
📖
Documentation
https://developer.atlassian.com/cloud/admin/user-management/rest/
📖
Documentation
https://developer.atlassian.com/cloud/admin/user-provisioning/rest/

Specifications

Schemas & Data

📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/atlassian/refs/heads/main/json-schema/atlassian-bitbucket-hook-events-paginated_hook_events-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/atlassian/refs/heads/main/json-schema/atlassian-bitbucket-pull-requests-a_pullrequest_comment_task-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/atlassian/refs/heads/main/json-schema/atlassian-bitbucket-repositories-account-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/atlassian/refs/heads/main/json-schema/atlassian-bitbucket-snippets-account-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/atlassian/refs/heads/main/json-schema/atlassian-bitbucket-teams-account-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/atlassian/refs/heads/main/json-schema/atlassian-bitbucket-user-account-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/atlassian/refs/heads/main/json-schema/atlassian-bitbucket-workspaces-account-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/atlassian/refs/heads/main/json-schema/atlassian-confluence-audit-audit-record-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/atlassian/refs/heads/main/json-schema/atlassian-confluence-content-async-content-body-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/atlassian/refs/heads/main/json-schema/atlassian-confluence-content-body-async-content-body-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/atlassian/refs/heads/main/json-schema/atlassian-confluence-content-states-async-id-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/atlassian/refs/heads/main/json-schema/atlassian-confluence-group-group-array-with-links-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/atlassian/refs/heads/main/json-schema/atlassian-confluence-inline-tasks-task-page-response-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/atlassian/refs/heads/main/json-schema/atlassian-confluence-longtask-long-task-status-with-links-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/atlassian/refs/heads/main/json-schema/atlassian-confluence-relation-relation-data-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/atlassian/refs/heads/main/json-schema/atlassian-confluence-search-search-page-response-search-result-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/atlassian/refs/heads/main/json-schema/atlassian-confluence-settings-look-and-feel-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/atlassian/refs/heads/main/json-schema/atlassian-confluence-space-content-state-settings-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/atlassian/refs/heads/main/json-schema/atlassian-confluence-template-blueprint-template-array-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/atlassian/refs/heads/main/json-schema/atlassian-confluence-user-account-id-email-record-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/atlassian/refs/heads/main/json-schema/atlassian-admin-domain-page-schema.json

Other Resources

🔗
GraphQL
https://raw.githubusercontent.com/api-evangelist/atlassian/refs/heads/main/graphql/atlassian-graphql.md
🔗
JSONLD
https://raw.githubusercontent.com/api-evangelist/atlassian/refs/heads/main/json-ld/atlassian-bitbucket-hook-events-context.jsonld
🔗
JSONLD
https://raw.githubusercontent.com/api-evangelist/atlassian/refs/heads/main/json-ld/atlassian-bitbucket-pull-requests-context.jsonld
🔗
JSONLD
https://raw.githubusercontent.com/api-evangelist/atlassian/refs/heads/main/json-ld/atlassian-bitbucket-repositories-context.jsonld
🔗
JSONLD
https://raw.githubusercontent.com/api-evangelist/atlassian/refs/heads/main/json-ld/atlassian-bitbucket-snippets-context.jsonld
🔗
JSONLD
https://raw.githubusercontent.com/api-evangelist/atlassian/refs/heads/main/json-ld/atlassian-bitbucket-teams-context.jsonld
🔗
JSONLD
https://raw.githubusercontent.com/api-evangelist/atlassian/refs/heads/main/json-ld/atlassian-bitbucket-user-context.jsonld
🔗
JSONLD
https://raw.githubusercontent.com/api-evangelist/atlassian/refs/heads/main/json-ld/atlassian-bitbucket-workspaces-context.jsonld
🔗
JSONLD
https://raw.githubusercontent.com/api-evangelist/atlassian/refs/heads/main/json-ld/atlassian-confluence-audit-context.jsonld
🔗
JSONLD
https://raw.githubusercontent.com/api-evangelist/atlassian/refs/heads/main/json-ld/atlassian-confluence-content-context.jsonld
🔗
JSONLD
https://raw.githubusercontent.com/api-evangelist/atlassian/refs/heads/main/json-ld/atlassian-confluence-content-body-context.jsonld
🔗
JSONLD
https://raw.githubusercontent.com/api-evangelist/atlassian/refs/heads/main/json-ld/atlassian-confluence-content-states-context.jsonld
🔗
JSONLD
https://raw.githubusercontent.com/api-evangelist/atlassian/refs/heads/main/json-ld/atlassian-confluence-group-context.jsonld
🔗
JSONLD
https://raw.githubusercontent.com/api-evangelist/atlassian/refs/heads/main/json-ld/atlassian-confluence-inline-tasks-context.jsonld
🔗
JSONLD
https://raw.githubusercontent.com/api-evangelist/atlassian/refs/heads/main/json-ld/atlassian-confluence-longtask-context.jsonld
🔗
JSONLD
https://raw.githubusercontent.com/api-evangelist/atlassian/refs/heads/main/json-ld/atlassian-confluence-relation-context.jsonld
🔗
JSONLD
https://raw.githubusercontent.com/api-evangelist/atlassian/refs/heads/main/json-ld/atlassian-confluence-search-context.jsonld
🔗
JSONLD
https://raw.githubusercontent.com/api-evangelist/atlassian/refs/heads/main/json-ld/atlassian-confluence-settings-context.jsonld
🔗
JSONLD
https://raw.githubusercontent.com/api-evangelist/atlassian/refs/heads/main/json-ld/atlassian-confluence-space-context.jsonld
🔗
JSONLD
https://raw.githubusercontent.com/api-evangelist/atlassian/refs/heads/main/json-ld/atlassian-confluence-template-context.jsonld
🔗
JSONLD
https://raw.githubusercontent.com/api-evangelist/atlassian/refs/heads/main/json-ld/atlassian-confluence-user-context.jsonld
🔗
JSONLD
https://raw.githubusercontent.com/api-evangelist/atlassian/refs/heads/main/json-ld/atlassian-admin-context.jsonld

OpenAPI Specification

atlassian-branches-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Atlassian Admin Account Branches 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: Branches
paths:
  /repositories/{workspace}/{repo_slug}/branch-restrictions:
    parameters:
    - 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
    get:
      tags:
      - Branches
      description: This operation retrieves all branch restrictions configured for a specific repository within a Bitbucket workspace. Branch restrictions are rules that control who can push to branches, require pull requests, enforce merge checks, or limit branch deletions. By sending a GET request to this endpoint with the workspace ID and repository slug, you receive a paginated list of all active restrictions including their types, patterns (which branches they apply to), and associated users or groups. This is useful for auditing repository security policies, understanding workflow requirements, or programmatically managing branch protection rules across multiple repositories.
      summary: Atlassian List Branch Restrictions
      responses:
        '200':
          description: A paginated list of branch restrictions
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/paginated_branchrestrictions'
        '401':
          description: If the request was not authenticated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
        '403':
          description: If the authenticated user does not have admin access to the repository
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
        '404':
          description: If the repository does not exist
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
      parameters:
      - name: kind
        in: query
        description: Branch restrictions of this type
        required: false
        schema:
          type: string
      - name: pattern
        in: query
        description: Branch restrictions applied to branches of this pattern
        required: false
        schema:
          type: string
      security:
      - oauth2:
        - repository:admin
      - basic: []
      - api_key: []
      x-atlassian-oauth2-scopes:
      - state: Current
        scheme: oauth2
        scopes:
        - admin:repository:bitbucket
      operationId: listBranchRestrictions
      x-api-evangelist-processing:
        WriteDescription: true
        ChooseTags: true
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    post:
      tags:
      - Branches
      description: This API operation creates a new branch restriction rule for a specific repository in Bitbucket Cloud, allowing workspace administrators to enforce policies on branches within a given repository. By sending a POST request to the endpoint with the workspace ID and repository slug as path parameters, users can define restrictions such as preventing force pushes, requiring pull request approvals, limiting who can merge or push to specific branches, or enforcing other branch protection policies. The request body typically includes details like the restriction type, the branch pattern to which the rule applies (using glob patterns or specific branch names), and the users or groups affected by the restriction. This functionality is essential for maintaining code quality and implementing workflow controls in collaborative development environments, ensuring that critical branches like main or production are protected from unauthorized or potentially harmful changes.
      summary: Atlassian Create Branch Restriction Rule
      responses:
        '201':
          description: A paginated list of branch restrictions
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/branchrestriction'
              examples:
                branch-restriction_2:
                  $ref: '#/components/examples/branch-restriction_2'
        '401':
          description: If the request was not authenticated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
        '403':
          description: If the authenticated user does not have admin access to the repository
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
        '404':
          description: If the repository does not exist
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/branchrestriction'
            examples:
              branch-restriction:
                $ref: '#/components/examples/branch-restriction'
        description: The new rule
        required: true
      security:
      - oauth2:
        - repository:admin
      - basic: []
      - api_key: []
      x-atlassian-oauth2-scopes:
      - state: Current
        scheme: oauth2
        scopes:
        - admin:repository:bitbucket
      operationId: createBranchRestrictionRule
      x-api-evangelist-processing:
        WriteDescription: true
        ChooseTags: true
        GenerateExampleFromOperationRequestSchema: true
        GenerateExampleFromOperationResponseSchema: true
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /repositories/{workspace}/{repo_slug}/branch-restrictions/{id}:
    parameters:
    - name: id
      in: path
      description: The restriction rule's id
      required: true
      schema:
        type: string
    - 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
    delete:
      tags:
      - Branches
      description: The Delete Branch Restriction Rule operation in the Atlassian Bitbucket Repositories API allows you to remove a specific branch restriction rule from a repository by making a DELETE request to the endpoint /repositories/{workspace}/{repo_slug}/branch-restrictions/{id}. This operation requires you to specify the workspace name, repository slug, and the unique identifier of the branch restriction rule you want to delete. Branch restrictions are used to enforce policies on branches, such as preventing direct pushes, requiring pull requests, or limiting who can merge changes. By deleting a branch restriction rule, you effectively remove those constraints from the specified branches in your repository. This operation is useful when you need to modify your repository's branch protection strategy, remove outdated restrictions, or adjust team workflows. Authentication and appropriate permissions are required to execute this operation successfully, as it affects repository security and collaboration policies.
      summary: Atlassian Delete Branch Restriction Rule
      responses:
        '204':
          description: ''
        '401':
          description: If the request was not authenticated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
        '403':
          description: If the authenticated user does not have admin access to the repository
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
        '404':
          description: If the repository or branch restriction id does not exist
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
      security:
      - oauth2:
        - repository:admin
      - basic: []
      - api_key: []
      x-atlassian-oauth2-scopes:
      - state: Current
        scheme: oauth2
        scopes:
        - admin:repository:bitbucket
      operationId: deleteBranchRestrictionRule
      x-api-evangelist-processing:
        WriteDescription: true
        ChooseTags: true
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    get:
      tags:
      - Branches
      description: The GET operation on the /repositories/{workspace}/{repo_slug}/branch-restrictions/{id} endpoint in the Atlassian Bitbucket Repositories API retrieves detailed information about a specific branch restriction rule within a repository. By providing the workspace identifier, repository slug, and the unique ID of the branch restriction, this operation returns the complete configuration of that particular rule, including its type (such as requiring pull request approvals, restricting pushes, or enforcing merge checks), the branch pattern it applies to, the users or groups it affects, and any associated permissions or conditions. This endpoint is useful for administrators and developers who need to audit existing branch protection settings, verify security policies, or programmatically inspect repository governance rules before making modifications.
      summary: Atlassian Get Branch Restriction Rule
      responses:
        '200':
          description: The branch restriction rule
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/branchrestriction'
              examples:
                branch-restriction_2:
                  $ref: '#/components/examples/branch-restriction_2'
        '401':
          description: If the request was not authenticated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
        '403':
          description: If the authenticated user does not have admin access to the repository
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
        '404':
          description: If the repository or branch restriction id does not exist
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
      security:
      - oauth2:
        - repository:admin
      - basic: []
      - api_key: []
      x-atlassian-oauth2-scopes:
      - state: Current
        scheme: oauth2
        scopes:
        - admin:repository:bitbucket
      operationId: getBranchRestrictionRule
      x-api-evangelist-processing:
        WriteDescription: true
        ChooseTags: true
        GenerateExampleFromOperationResponseSchema: true
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    put:
      tags:
      - Branches
      description: This API operation allows you to modify an existing branch restriction rule in a Bitbucket repository by specifying the workspace, repository slug, and the unique identifier of the restriction rule you want to update. The PUT request enables you to change the configuration of access controls and permissions that govern who can push, merge, or perform other operations on specific branches within the repository. You can adjust parameters such as the branch pattern the rule applies to, the type of restriction (like requiring pull requests or limiting direct pushes), and which users or groups are affected by or exempt from the rule. This is particularly useful for maintaining code quality and enforcing workflow policies as your team's requirements evolve, allowing administrators to refine branch protection rules without having to delete and recreate them from scratch.
      summary: Atlassian Update Branch Restriction Rule
      responses:
        '200':
          description: The updated branch restriction rule
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/branchrestriction'
              examples:
                branch-restriction_2:
                  $ref: '#/components/examples/branch-restriction_2'
        '401':
          description: If the request was not authenticated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
        '403':
          description: If the authenticated user does not have admin access to the repository
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
        '404':
          description: If the repository or branch restriction id does not exist
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/branchrestriction'
            examples:
              branch-restriction:
                $ref: '#/components/examples/branch-restriction'
        description: The new version of the existing rule
        required: true
      security:
      - oauth2:
        - repository:admin
      - basic: []
      - api_key: []
      x-atlassian-oauth2-scopes:
      - state: Current
        scheme: oauth2
        scopes:
        - admin:repository:bitbucket
      operationId: updateBranchRestrictionRule
      x-api-evangelist-processing:
        WriteDescription: true
        ChooseTags: true
        GenerateExampleFromOperationRequestSchema: true
        GenerateExampleFromOperationResponseSchema: true
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /repositories/{workspace}/{repo_slug}/refs:
    parameters:
    - 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
    get:
      tags:
      - Branches
      description: This API endpoint retrieves a paginated list of references (branches and tags) for a specific repository within a Bitbucket workspace. By making a GET request to /repositories/{workspace}/{repo_slug}/refs, you can access all branch and tag references associated with the repository, where {workspace} represents the workspace ID or username and {repo_slug} identifies the specific repository. The response typically includes reference names, target commit hashes, and reference types, allowing developers to programmatically discover and work with the various branches and tags that exist in the repository for operations like branch comparison, deployment workflows, or repository analysis.
      summary: Atlassian List Branches and Tags
      responses:
        '200':
          description: A paginated list of refs matching any filter criteria that were provided.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/paginated_refs'
              examples:
                paginated-refs:
                  $ref: '#/components/examples/paginated-refs'
        '403':
          description: 'If the repository is private and the authenticated user does not have

            access to it.

            '
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
        '404':
          description: The specified repository does not exist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
      parameters:
      - name: q
        in: query
        description: '

          Query string to narrow down the response as per

          [filtering and sorting](/cloud/bitbucket/rest/intro/#filtering).'
        schema:
          type: string
      - name: sort
        in: query
        description: '

          Field by which the results should be sorted as per

          [filtering and sorting](/cloud/bitbucket/rest/intro/#filtering). The `name`

          field is handled specially for refs in that, if specified as the sort field, it

          uses a natural sort order instead of the default lexicographical sort order. For example,

          it will return [''1.1'', ''1.2'', ''1.10''] instead of [''1.1'', ''1.10'', ''1.2''].'
        schema:
          type: string
      security:
      - oauth2:
        - repository
      - basic: []
      - api_key: []
      x-atlassian-oauth2-scopes:
      - state: Current
        scheme: oauth2
        scopes:
        - read:repository:bitbucket
      operationId: listBranchesAndTags
      x-api-evangelist-processing:
        WriteDescription: true
        ChooseTags: true
        GenerateExampleFromOperationResponseSchema: true
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /repositories/{workspace}/{repo_slug}/refs/branches:
    parameters:
    - 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
    get:
      tags:
      - Branches
      description: This API operation retrieves a paginated list of all branches in a specified Bitbucket repository by providing the workspace identifier and repository slug in the path parameters. It returns comprehensive branch information including branch names, associated commit details, target information, and metadata about each branch's state. The response follows Bitbucket's standard pagination format, making it suitable for repositories with numerous branches, and is commonly used for displaying available branches, implementing branch selection interfaces, or auditing repository branch structure.
      summary: Atlassian List Open Branches
      responses:
        '200':
          description: A paginated list of branches matching any filter criteria that were provided.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/paginated_branches'
              examples:
                paginated-branches:
                  $ref: '#/components/examples/paginated-branches'
        '403':
          description: 'If the repository is private and the authenticated user does not have

            access to it.

            '
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
        '404':
          description: The specified repository does not exist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
      parameters:
      - name: q
        in: query
        description: '

          Query string to narrow down the response as per

          [filtering and sorting](/cloud/bitbucket/rest/intro/#filtering).'
        schema:
          type: string
      - name: sort
        in: query
        description: '

          Field by which the results should be sorted as per

          [filtering and sorting](/cloud/bitbucket/rest/intro/#filtering). The `name`

          field is handled specially for branches in that, if specified as the sort field, it

          uses a natural sort order instead of the default lexicographical sort order. For example,

          it will return [''branch1'', ''branch2'', ''branch10''] instead of [''branch1'', ''branch10'', ''branch2''].'
        schema:
          type: string
      security:
      - oauth2:
        - repository
      - basic: []
      - api_key: []
      x-atlassian-oauth2-scopes:
      - state: Current
        scheme: oauth2
        scopes:
        - read:repository:bitbucket
      operationId: listOpenBranches
      x-api-evangelist-processing:
        WriteDescription: true
        ChooseTags: true
        GenerateExampleFromOperationResponseSchema: true
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    post:
      tags:
      - Branches
      description: The Create Branch operation in the Atlassian Bitbucket Repositories API allows developers to programmatically create a new branch within a specified repository by sending a POST request to the /repositories/{workspace}/{repo_slug}/refs/branches endpoint. This operation requires authentication and takes the workspace identifier and repository slug as path parameters, along with a request body that typically includes the new branch name and the source commit or existing branch from which to create it. Upon successful execution, the API returns details about the newly created branch including its name, target commit hash, and associated metadata, enabling automated branch management workflows for version control and continuous integration processes.
      summary: Atlassian Create Branch
      responses:
        '201':
          description: The newly created branch object.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/branch'
        '403':
          description: 'If the repository is private and the authenticated user does not have

            access to it.

            '
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
        '404':
          description: The specified repository or branch does not exist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
      security:
      - oauth2:
        - repository:write
      - basic: []
      - api_key: []
      x-atlassian-oauth2-scopes:
      - state: Current
        scheme: oauth2
        scopes:
        - write:repository:bitbucket
        - read:repository:bitbucket
      operationId: createBranch
      x-api-evangelist-processing:
        WriteDescription: true
        ChooseTags: true
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /repositories/{workspace}/{repo_slug}/refs/branches/{name}:
    parameters:
    - name: name
      in: path
      description: The name of the branch.
      required: true
      schema:
        type: string
    - 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
    delete:
      tags:
      - Branches
      description: This API operation allows you to delete a specific branch from a repository in Bitbucket Cloud. By sending a DELETE request to the endpoint with the workspace ID, repository slug, and branch name, you can permanently remove the specified branch from the repository. This is useful for cleaning up merged feature branches, removing obsolete code branches, or managing your repository's branch structure. The operation requires appropriate permissions on the repository, and once executed, the branch and its reference will be removed, though the commits themselves may still be accessible through the repository's history if they were previously merged or referenced elsewhere.
      summary: Atlassian Delete Branch
      responses:
        '204':
          description: Indicates that the specified branch was successfully deleted.
        '403':
          description: 'If the repository is private and the authenticated user does not have

            access to it.

            '
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
        '404':
          description: The specified repository or branch does not exist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
      security:
      - oauth2:
        - repository:write
      - basic: []
      - api_key: []
      x-atlassian-oauth2-scopes:
      - state: Current
        scheme: oauth2
        scopes:
        - write:repository:bitbucket
      operationId: deleteBranch
      x-api-evangelist-processing:
        WriteDescription: true
        ChooseTags: true
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    get:
      tags:
      - Branches
      description: This API operation retrieves detailed information about a specific branch within a Bitbucket repository. By providing the workspace identifier, repository slug, and branch name in the endpoint path, users can fetch comprehensive data about the target branch including its latest commit details, author information, commit hash, and other branch-specific metadata. This is particularly useful for applications that need to programmatically access branch information for CI/CD pipelines, deployment workflows, or repository management tasks without having to clone the entire repository or traverse the full commit history.
      summary: Atlassian Get Branch
      responses:
        '200':
          description: The branch object.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/branch'
              examples:
                response:
                  value:
                    name: master
                    links:
                      commits:
                        href: https://api.bitbucket.org/2.0/repositories/atlassian/aui/commits/master
                      self:
                        href: https://api.bitbucket.org/2.0/repositories/atlassian/aui/refs/branches/master
                      html:
                        href: https://bitbucket.org/atlassian/aui/branch/master
                    default_merge_strategy: squash
                    merge_strategies:
                    - merge_commit
                    - squash
                    - fast_forward
                    type: branch
                    target:
                      hash: e7d158ff7ed5538c28f94cd97a9ad569680fc94e
                      repository:
                        links:
                          self:
                            href: https://api.bitbucket.org/2.0/repositories/atlassian/aui
                          html:
                            href: https://bitbucket.org/atlassian/aui
                          avatar:
                            href: https://bytebucket.org/ravatar/%7B585074de-7b60-4fd1-81ed-e0bc7fafbda5%7D?ts=86317
                        type: repository
                        name: aui
                        full_name: atlassian/aui
                        uuid: '{585074de-7b60-4fd1-81ed-e0bc7fafbda5}'
                      links:
                        self:
                          href: https://api.bitbucket.org/2.0/repositories/atlassian/aui/commit/e7d158ff7ed5538c28f94cd97a9ad569680fc94e
                        comments:
                          href: https://api.bitbucket.org/2.0/repositories/atlassian/aui/commit/e7d158ff7ed5538c28f94cd97a9ad569680fc94e/comments
                        patch:
                          href: https://api.bitbucket.org/2.0/repositories/atlassian/aui/patch/e7d158ff7ed5538c28f94cd97a9ad569680fc94e
                        html:
                          href: https://bitbucket.org/atlassian/aui/commits/e7d158ff7ed5538c28f94cd97a9ad569680fc94e
                        diff:
                          href: https://api.bitbucket.org/2.0/repositories/atlassian/aui/diff/e7d158ff7ed5538c28f94cd97a9ad569680fc94e
                        approve:
                          href: https://api.bitbucket.org/2.0/repositories/atlassian/aui/commit/e7d158ff7ed5538c28f94cd97a9ad569680fc94e/approve
                        statuses:
                          href: https://api.bitbucket.org/2.0/repositories/atlassian/aui/commit/e7d158ff7ed5538c28f94cd97a9ad569680fc94e/statuses
                      author:
                        raw: psre-renovate-bot <psre-renovate-bot@atlassian.com>
                        type: author
                        user:
                          display_name: psre-renovate-bot
                          uuid: '{250a442a-3ab3-4fcb-87c3-3c8f3df65ec7}'
                          links:
                            self:
                              href: https://api.bitbucket.org/2.0/users/%7B250a442a-3ab3-4fcb-87c3-3c8f3df65ec7%7D
                            html:
                              href: https://bitbucket.org/%7B250a442a-3ab3-4fcb-87c3-3c8f3df65ec7%7D/
                            avatar:
                              href: https://secure.gravatar.com/avatar/6972ee037c9f36360170a86f544071a2?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FP-3.png
                          nickname: Renovate Bot
                          type: user
                          account_id: 5d5355e8c6b9320d9ea5b28d
                      parents:
                      - hash: eab868a309e75733de80969a7bed1ec6d4651e06
                        type: commit
                        links:
                          self:
                            href: https://api.bitbucket.org/2.0/repositories/atlassian/aui/commit/eab868a309e75733de80969a7bed1ec6d4651e06
                          html:
                            href: https://bitbucket.org/atlassian/aui/commits/eab868a309e75733de80969a7bed1ec6d4651e06
                      date: '2021-04-12T06:44:38+00:00'
                      message: 'Merged in issue/NONE-renovate-master-babel-monorepo (pull request #2883)


                        chore(deps): update babel monorepo to v7.13.15 (master)


                        Approved-by: Chris "Daz" Darroch

                        '
                      type: commit
        '403':
          description: 'If the repository is private and the authenticated user does not have

            access to it.

            '
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
        '404':
          description: The specified repository or branch does not exist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
      security:
      - oauth2:
        - repository
      - basic: []
      - api_key: []
      x-atlassian-oauth2-scopes:
   

# --- truncated at 32 KB (70 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/atlassian/refs/heads/main/openapi/atlassian-branches-api-openapi.yml