openapi: 3.0.1
info:
  title: Bitbucket API
  description: Code against the Bitbucket API to automate simple tasks, embed Bitbucket
    data into your own site, build mobile or desktop apps, or even add custom UI add-ons
    into Bitbucket itself using the Connect framework.
  version: "2.0"
servers:
- url: https://api.bitbucket.org/2.0
paths:
  /users/{username}/repositories:
    get:
      tags:
      - Repo
      description: |-
        All repositories owned by a user/team. This includes private
        repositories, but filtered down to the ones that the calling user has
        access to.
      parameters:
      - name: username
        in: path
        description: |
          This can either be the username or the UUID of the account,
          surrounded by curly-braces, for example: `{account UUID}`. An account
          is either a team or user.
        required: true
        schema:
          type: string
      responses:
        default:
          description: Unexpected error.
      security:
      - BitBucketsOAuthFlows:
        - repository
        - repository:admin
      - basic: []
      - api_key1: []

  /users/{username}/repositories-2:
    get:
      tags:
      - Repo
      description: |-
        All repositories owned by a user/team. This includes private
        repositories, but filtered down to the ones that the calling user has
        access to.
      parameters:
      - name: username
        in: path
        description: |
          This can either be the username or the UUID of the account,
          surrounded by curly-braces, for example: `{account UUID}`. An account
          is either a team or user.
        required: true
        schema:
          type: string
      responses:
        default:
          description: Unexpected error.
      security:
      - BitBucketsOAuthFlows:
        - repository
        - repository:admin
      - api_key1: []
        api_key2: []

  /users/{username}/repositories-3:
    get:
      tags:
      - Repo
      description: |-
        All repositories owned by a user/team. This includes private
        repositories, but filtered down to the ones that the calling user has
        access to.
      parameters:
      - name: username
        in: path
        description: |
          This can either be the username or the UUID of the account,
          surrounded by curly-braces, for example: `{account UUID}`. An account
          is either a team or user.
        required: true
        schema:
          type: string
      responses:
        default:
          description: Unexpected error.
      security:
      - BitBucketsOAuthFlows:
        - repository
        - repository:admin
        api_key1: []
      - api_key2: []

  /users/{username}/repositories-4:
    get:
      tags:
      - Repo
      description: |-
        All repositories owned by a user/team. This includes private
        repositories, but filtered down to the ones that the calling user has
        access to.
      parameters:
      - name: username
        in: path
        description: |
          This can either be the username or the UUID of the account,
          surrounded by curly-braces, for example: `{account UUID}`. An account
          is either a team or user.
        required: true
        schema:
          type: string
      responses:
        default:
          description: Unexpected error.
      security:
      - BitBucketsOAuthFlows:
        - repository
        - repository:admin
    
components:
  securitySchemes:
    basic:
      type: http
      scheme: basic
    api_key1:
      type: apiKey
      name: Authorization
      in: header
    api_key2:
      type: apiKey
      name: specialKey
      in: header
    BitBucketsOAuthFlows:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://bitbucket.org/site/oauth2/authorize
          tokenUrl: https://bitbucket.org/site/oauth2/access_token
          scopes:
            repository:admin: Administer your repositories
            repository: Read your repositories
            repository:delete: Delete your repositories
            repository:write: Read and modify your repositories
        clientCredentials:
          tokenUrl: https://bitbucket.org/site/oauth2/access_token
        implicit:
          authorizationUrl: https://bitbucket.org/site/oauth2/authorize?audience=abcd
          scopes:        
            repository:admin: Administer your repositories
            repository: Read your repositories
            repository:delete: Delete your repositories
            repository:write: Read and modify your repositories
        password:
          tokenUrl: https://bitbucket.org/site/oauth2/access_token
          scopes:        
            repository:admin: Administer your repositories
            repository: Read your repositories
            repository:delete: Delete your repositories
            repository:write: Read and modify your repositories
    