Bitbucket Deployments API

Teams are deploying code faster than ever, thanks to continuous delivery practices and tools like Bitbucket Pipelines. Bitbucket Deployments gives teams visibility into their deployment environments and helps teams to track how far changes have progressed in their deployment pipeline.

Documentation

Specifications

Schemas & Data

Other Resources

OpenAPI Specification

bitbucket-deployments-api-openapi.yml Raw ↑
swagger: '2.0'
info:
  title: Bitbucket Addon Deployments 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'
  termsOfService: https://www.atlassian.com/legal/customer-agreement
  contact:
    name: Bitbucket Support
    url: https://support.atlassian.com/bitbucket-cloud/
    email: support@bitbucket.org
host: api.bitbucket.org
basePath: /2.0
schemes:
- https
consumes:
- application/json
produces:
- application/json
tags:
- name: Deployments
  description: 'Teams are deploying code faster than ever, thanks to continuous

    delivery practices and tools like Bitbucket Pipelines. Bitbucket

    Deployments gives teams visibility into their deployment

    environments and helps teams to track how far changes have

    progressed in their deployment pipeline.

    '
paths:
  /repositories/{workspace}/{repo_slug}/deploy-keys:
    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
      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
      type: string
    get:
      tags:
      - Deployments
      description: Returns all deploy-keys belonging to a repository.
      summary: List repository deploy keys
      responses:
        '200':
          description: Deploy keys matching the repository
          schema:
            $ref: '#/definitions/paginated_deploy_keys'
          examples:
            application/json:
              pagelen: 10
              values:
              - id: 123
                key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDAK/b1cHHDr/TEV1JGQl+WjCwStKG6Bhrv0rFpEsYlyTBm1fzN0VOJJYn4ZOPCPJwqse6fGbXntEs+BbXiptR+++HycVgl65TMR0b5ul5AgwrVdZdT7qjCOCgaSV74/9xlHDK8oqgGnfA7ZoBBU+qpVyaloSjBdJfLtPY/xqj4yHnXKYzrtn/uFc4Kp9Tb7PUg9Io3qohSTGJGVHnsVblq/rToJG7L5xIo0OxK0SJSQ5vuId93ZuFZrCNMXj8JDHZeSEtjJzpRCBEXHxpOPhAcbm4MzULgkFHhAVgp4JbkrT99/wpvZ7r9AdkTg7HGqL3rlaDrEcWfL7Lu6TnhBdq5
                label: mykey
                type: deploy_key
                created_on: '2018-08-15T23:50:59.993890+00:00'
                repository:
                  full_name: mleu/test
                  name: test
                  type: repository
                  uuid: '{85d08b4e-571d-44e9-a507-fa476535aa98}'
                links:
                  self:
                    href: https://api.bitbucket.org/2.0/repositories/mleu/test/deploy-keys/123
                last_used: null
                comment: mleu@C02W454JHTD8
              page: 1
              size: 1
        '403':
          description: If the specified user or repository is not accessible to the current user
        '404':
          description: If the specified user or repository does not exist
          schema:
            $ref: '#/definitions/error'
      parameters: []
      security:
      - oauth2:
        - repository
        - repository:admin
      - basic: []
      - api_key: []
      x-atlassian-oauth2-scopes:
      - state: Current
        scheme: oauth2
        scopes:
        - admin:repository:bitbucket
      x-atlassian-auth-types:
      - api-token
    post:
      tags:
      - Deployments
      description: "Create a new deploy key in a repository. Note: If authenticating a deploy key\nwith an OAuth consumer, any changes to the OAuth consumer will subsequently\ninvalidate the deploy key.\n\n\nExample:\n```\n$ curl -X POST \\\n-H \"Authorization <auth header>\" \\\n-H \"Content-type: application/json\" \\\nhttps://api.bitbucket.org/2.0/repositories/mleu/test/deploy-keys -d \\\n'{\n    \"key\": \"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDAK/b1cHHDr/TEV1JGQl+WjCwStKG6Bhrv0rFpEsYlyTBm1fzN0VOJJYn4ZOPCPJwqse6fGbXntEs+BbXiptR+++HycVgl65TMR0b5ul5AgwrVdZdT7qjCOCgaSV74/9xlHDK8oqgGnfA7ZoBBU+qpVyaloSjBdJfLtPY/xqj4yHnXKYzrtn/uFc4Kp9Tb7PUg9Io3qohSTGJGVHnsVblq/rToJG7L5xIo0OxK0SJSQ5vuId93ZuFZrCNMXj8JDHZeSEtjJzpRCBEXHxpOPhAcbm4MzULgkFHhAVgp4JbkrT99/wpvZ7r9AdkTg7HGqL3rlaDrEcWfL7Lu6TnhBdq5 mleu@C02W454JHTD8\",\n    \"label\": \"mydeploykey\"\n}'\n```"
      summary: Add a repository deploy key
      responses:
        '200':
          description: The deploy key that was created
          schema:
            $ref: '#/definitions/deploy_key'
          examples:
            application/json:
              id: 123
              key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDAK/b1cHHDr/TEV1JGQl+WjCwStKG6Bhrv0rFpEsYlyTBm1fzN0VOJJYn4ZOPCPJwqse6fGbXntEs+BbXiptR+++HycVgl65TMR0b5ul5AgwrVdZdT7qjCOCgaSV74/9xlHDK8oqgGnfA7ZoBBU+qpVyaloSjBdJfLtPY/xqj4yHnXKYzrtn/uFc4Kp9Tb7PUg9Io3qohSTGJGVHnsVblq/rToJG7L5xIo0OxK0SJSQ5vuId93ZuFZrCNMXj8JDHZeSEtjJzpRCBEXHxpOPhAcbm4MzULgkFHhAVgp4JbkrT99/wpvZ7r9AdkTg7HGqL3rlaDrEcWfL7Lu6TnhBdq5
              label: mydeploykey
              type: deploy_key
              created_on: '2018-08-15T23:50:59.993890+00:00'
              repository:
                full_name: mleu/test
                name: test
                type: repository
                uuid: '{85d08b4e-571d-44e9-a507-fa476535aa98}'
              links:
                self:
                  href: https://api.bitbucket.org/2.0/repositories/mleu/test/deploy-keys/123
              last_used: null
              comment: mleu@C02W454JHTD8
        '400':
          description: Invalid deploy key inputs
        '403':
          description: If the specified user or repository is not accessible to the current user
        '404':
          description: If the specified user or repository does not exist
          schema:
            $ref: '#/definitions/error'
      parameters: []
      security:
      - oauth2:
        - repository
        - repository:admin
      - basic: []
      - api_key: []
      x-atlassian-oauth2-scopes:
      - state: Current
        scheme: oauth2
        scopes:
        - admin:repository:bitbucket
        - write:ssh-key:bitbucket
      x-atlassian-auth-types:
      - api-token
  /repositories/{workspace}/{repo_slug}/deploy-keys/{key_id}:
    parameters:
    - name: key_id
      in: path
      description: The key ID matching the deploy key.
      required: true
      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
      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
      type: string
    delete:
      tags:
      - Deployments
      description: This deletes a deploy key from a repository.
      summary: Delete a repository deploy key
      responses:
        '204':
          description: The key has been deleted
        '403':
          description: If the current user does not have permission to delete a key for the specified user
        '404':
          description: If the specified user, repository, or deploy key does not exist
          schema:
            $ref: '#/definitions/error'
      parameters: []
      security:
      - oauth2:
        - repository
        - repository:admin
      - basic: []
      - api_key: []
      x-atlassian-oauth2-scopes:
      - state: Current
        scheme: oauth2
        scopes:
        - admin:repository:bitbucket
        - delete:ssh-key:bitbucket
      x-atlassian-auth-types:
      - api-token
    get:
      tags:
      - Deployments
      description: Returns the deploy key belonging to a specific key.
      summary: Get a repository deploy key
      responses:
        '200':
          description: Deploy key matching the key ID
          schema:
            $ref: '#/definitions/deploy_key'
          examples:
            application/json:
              comment: mleu@C02W454JHTD8
              last_used: null
              links:
                self:
                  href: https://api.bitbucket.org/2.0/repositories/mleu/test/deploy-key/1234
              repository:
                full_name: mleu/test
                name: test
                type: repository
                uuid: '{85d08b4e-571d-44e9-a507-fa476535aa98}'
              label: mykey
              created_on: '2018-08-15T23:50:59.993890+00:00'
              key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDAK/b1cHHDr/TEV1JGQl+WjCwStKG6Bhrv0rFpEsYlyTBm1fzN0VOJJYn4ZOPCPJwqse6fGbXntEs+BbXiptR+++HycVgl65TMR0b5ul5AgwrVdZdT7qjCOCgaSV74/9xlHDK8oqgGnfA7ZoBBU+qpVyaloSjBdJfLtPY/xqj4yHnXKYzrtn/uFc4Kp9Tb7PUg9Io3qohSTGJGVHnsVblq/rToJG7L5xIo0OxK0SJSQ5vuId93ZuFZrCNMXj8JDHZeSEtjJzpRCBEXHxpOPhAcbm4MzULgkFHhAVgp4JbkrT99/wpvZ7r9AdkTg7HGqL3rlaDrEcWfL7Lu6TnhBdq5
              id: 1234
              type: deploy_key
        '403':
          description: If the specified user or repository is not accessible to the current user
        '404':
          description: If the specified user or repository does not exist
          schema:
            $ref: '#/definitions/error'
      parameters: []
      security:
      - oauth2:
        - repository
        - repository:admin
      - basic: []
      - api_key: []
      x-atlassian-oauth2-scopes:
      - state: Current
        scheme: oauth2
        scopes:
        - admin:repository:bitbucket
      x-atlassian-auth-types:
      - api-token
    put:
      tags:
      - Deployments
      description: "Create a new deploy key in a repository.\n\nThe same key needs to be passed in but the comment and label can change.\n\nExample:\n```\n$ curl -X PUT \\\n-H \"Authorization <auth header>\" \\\n-H \"Content-type: application/json\" \\\nhttps://api.bitbucket.org/2.0/repositories/mleu/test/deploy-keys/1234 -d \\\n'{\n    \"label\": \"newlabel\",\n    \"key\": \"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDAK/b1cHHDr/TEV1JGQl+WjCwStKG6Bhrv0rFpEsYlyTBm1fzN0VOJJYn4ZOPCPJwqse6fGbXntEs+BbXiptR+++HycVgl65TMR0b5ul5AgwrVdZdT7qjCOCgaSV74/9xlHDK8oqgGnfA7ZoBBU+qpVyaloSjBdJfLtPY/xqj4yHnXKYzrtn/uFc4Kp9Tb7PUg9Io3qohSTGJGVHnsVblq/rToJG7L5xIo0OxK0SJSQ5vuId93ZuFZrCNMXj8JDHZeSEtjJzpRCBEXHxpOPhAcbm4MzULgkFHhAVgp4JbkrT99/wpvZ7r9AdkTg7HGqL3rlaDrEcWfL7Lu6TnhBdq5 newcomment\",\n}'\n```"
      summary: Update a repository deploy key
      responses:
        '200':
          description: The newly updated deploy key.
          schema:
            $ref: '#/definitions/deploy_key'
          examples:
            application/json:
              comment: newcomment
              last_used: null
              links:
                self:
                  href: https://api.bitbucket.org/2.0/repositories/mleu/test/deploy-keys/1234
              repository:
                full_name: mleu/test
                name: test
                type: repository
                uuid: '{85d08b4e-571d-44e9-a507-fa476535aa98}'
              label: newlabel
              created_on: '2018-08-15T23:50:59.993890+00:00'
              key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDAK/b1cHHDr/TEV1JGQl+WjCwStKG6Bhrv0rFpEsYlyTBm1fzN0VOJJYn4ZOPCPJwqse6fGbXntEs+BbXiptR+++HycVgl65TMR0b5ul5AgwrVdZdT7qjCOCgaSV74/9xlHDK8oqgGnfA7ZoBBU+qpVyaloSjBdJfLtPY/xqj4yHnXKYzrtn/uFc4Kp9Tb7PUg9Io3qohSTGJGVHnsVblq/rToJG7L5xIo0OxK0SJSQ5vuId93ZuFZrCNMXj8JDHZeSEtjJzpRCBEXHxpOPhAcbm4MzULgkFHhAVgp4JbkrT99/wpvZ7r9AdkTg7HGqL3rlaDrEcWfL7Lu6TnhBdq5
              id: 1234
              type: deploy_key
        '400':
          description: If the submitted key or related value is invalid
          schema:
            $ref: '#/definitions/error'
        '403':
          description: If the current user does not have permission to add a key for the specified user
        '404':
          description: If the specified user, repository, or deploy key does not exist
          schema:
            $ref: '#/definitions/error'
      parameters: []
      security:
      - oauth2:
        - repository
        - repository:admin
      - basic: []
      - api_key: []
      x-atlassian-oauth2-scopes:
      - state: Current
        scheme: oauth2
        scopes:
        - admin:repository:bitbucket
        - write:ssh-key:bitbucket
      x-atlassian-auth-types:
      - api-token
  /repositories/{workspace}/{repo_slug}/deployments:
    get:
      tags:
      - Deployments
      description: Find deployments
      summary: List deployments
      operationId: getDeploymentsForRepository
      parameters:
      - name: workspace
        description: This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example `{workspace UUID}`.
        required: true
        in: path
        type: string
      - name: repo_slug
        description: The repository.
        required: true
        in: path
        type: string
      responses:
        '200':
          description: The matching deployments.
          schema:
            $ref: '#/definitions/paginated_deployments'
      security:
      - oauth2:
        - pipeline
      - basic: []
      - api_key: []
      x-atlassian-oauth2-scopes:
      - state: Current
        scheme: oauth2
        scopes:
        - read:pipeline:bitbucket
      x-atlassian-auth-types:
      - forge-oauth2
      - api-token
  /repositories/{workspace}/{repo_slug}/deployments/{deployment_uuid}:
    get:
      tags:
      - Deployments
      description: Retrieve a deployment
      summary: Get a deployment
      operationId: getDeploymentForRepository
      parameters:
      - name: workspace
        description: This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example `{workspace UUID}`.
        required: true
        in: path
        type: string
      - name: repo_slug
        description: The repository.
        required: true
        in: path
        type: string
      - name: deployment_uuid
        description: The deployment UUID.
        required: true
        in: path
        type: string
      responses:
        '200':
          description: The deployment.
          schema:
            $ref: '#/definitions/deployment'
        '404':
          description: No account, repository or deployment with the UUID provided exists.
          schema:
            $ref: '#/definitions/error'
      security:
      - oauth2:
        - pipeline
      - basic: []
      - api_key: []
      x-atlassian-oauth2-scopes:
      - state: Current
        scheme: oauth2
        scopes:
        - read:pipeline:bitbucket
      x-atlassian-auth-types:
      - forge-oauth2
      - api-token
  /repositories/{workspace}/{repo_slug}/environments:
    get:
      tags:
      - Deployments
      description: Find environments
      summary: List environments
      operationId: getEnvironmentsForRepository
      parameters:
      - name: workspace
        description: This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example `{workspace UUID}`.
        required: true
        in: path
        type: string
      - name: repo_slug
        description: The repository.
        required: true
        in: path
        type: string
      responses:
        '200':
          description: The matching environments.
          schema:
            $ref: '#/definitions/paginated_environments'
      security:
      - oauth2:
        - pipeline
      - basic: []
      - api_key: []
      x-atlassian-oauth2-scopes:
      - state: Current
        scheme: oauth2
        scopes:
        - read:pipeline:bitbucket
      x-atlassian-auth-types:
      - forge-oauth2
      - api-token
    post:
      tags:
      - Deployments
      description: Create an environment.
      summary: Create an environment
      operationId: createEnvironment
      parameters:
      - name: workspace
        description: This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example `{workspace UUID}`.
        required: true
        in: path
        type: string
      - name: repo_slug
        description: The repository.
        required: true
        in: path
        type: string
      - name: _body
        in: body
        description: The environment to create.
        required: true
        schema:
          $ref: '#/definitions/deployment_environment'
      responses:
        '201':
          description: The environment was created.
          schema:
            $ref: '#/definitions/deployment_environment'
          headers:
            Location:
              type: string
              description: The URL of the newly created environment.
        '404':
          description: The account or repository does not exist.
          schema:
            $ref: '#/definitions/error'
        '409':
          description: An environment host with the provided name already exists.
          schema:
            $ref: '#/definitions/error'
      security:
      - oauth2:
        - pipeline
      - basic: []
      - api_key: []
      x-atlassian-oauth2-scopes:
      - state: Current
        scheme: oauth2
        scopes:
        - admin:pipeline:bitbucket
      x-atlassian-auth-types:
      - forge-oauth2
      - api-token
  /repositories/{workspace}/{repo_slug}/environments/{environment_uuid}:
    get:
      tags:
      - Deployments
      summary: Get an environment
      description: Retrieve an environment
      operationId: getEnvironmentForRepository
      parameters:
      - name: workspace
        description: This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example `{workspace UUID}`.
        required: true
        in: path
        type: string
      - name: repo_slug
        description: The repository.
        required: true
        in: path
        type: string
      - name: environment_uuid
        description: The environment UUID.
        required: true
        in: path
        type: string
      responses:
        '200':
          description: The environment.
          schema:
            $ref: '#/definitions/deployment_environment'
        '404':
          description: No account, repository or environment with the UUID provided exists.
          schema:
            $ref: '#/definitions/error'
      security:
      - oauth2:
        - pipeline
      - basic: []
      - api_key: []
      x-atlassian-oauth2-scopes:
      - state: Current
        scheme: oauth2
        scopes:
        - read:pipeline:bitbucket
      x-atlassian-auth-types:
      - forge-oauth2
      - api-token
    delete:
      tags:
      - Deployments
      description: Delete an environment
      summary: Delete an environment
      operationId: deleteEnvironmentForRepository
      parameters:
      - name: workspace
        description: This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example `{workspace UUID}`.
        required: true
        in: path
        type: string
      - name: repo_slug
        description: The repository.
        required: true
        in: path
        type: string
      - name: environment_uuid
        description: The environment UUID.
        required: true
        in: path
        type: string
      responses:
        '204':
          description: The environment was deleted.
        '404':
          description: No account or repository with the UUID provided exists.
          schema:
            $ref: '#/definitions/error'
      security:
      - oauth2:
        - pipeline
      - basic: []
      - api_key: []
      x-atlassian-oauth2-scopes:
      - state: Current
        scheme: oauth2
        scopes:
        - admin:pipeline:bitbucket
      x-atlassian-auth-types:
      - forge-oauth2
      - api-token
  /repositories/{workspace}/{repo_slug}/environments/{environment_uuid}/changes:
    post:
      tags:
      - Deployments
      description: Update an environment
      summary: Update an environment
      operationId: updateEnvironmentForRepository
      parameters:
      - name: workspace
        description: This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example `{workspace UUID}`.
        required: true
        in: path
        type: string
      - name: repo_slug
        description: The repository.
        required: true
        in: path
        type: string
      - name: environment_uuid
        description: The environment UUID.
        required: true
        in: path
        type: string
      responses:
        '202':
          description: The environment update request was accepted.
        '404':
          description: No account, repository or environment with the UUID provided exists.
          schema:
            $ref: '#/definitions/error'
      security:
      - oauth2:
        - pipeline
      - basic: []
      - api_key: []
      x-atlassian-oauth2-scopes:
      - state: Current
        scheme: oauth2
        scopes:
        - admin:pipeline:bitbucket
      x-atlassian-auth-types:
      - forge-oauth2
      - api-token
  /workspaces/{workspace}/projects/{project_key}/deploy-keys:
    parameters:
    - name: project_key
      in: path
      description: 'The project in question. This is the actual `key` assigned

        to the project.

        '
      required: true
      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
      type: string
    get:
      tags:
      - Deployments
      description: Returns all deploy keys belonging to a project.
      summary: List project deploy keys
      responses:
        '200':
          description: Deploy keys matching the project
          schema:
            $ref: '#/definitions/paginated_project_deploy_keys'
          examples:
            application/json:
              pagelen: 10
              values:
              - comment: thakseth@C02W454JHTD8
                last_used: null
                links:
                  self:
                    href: https://api.bitbucket.org/2.0/workspaces/standard/projects/TEST_PROJECT/deploy-keys/1234
                label: test
                project:
                  links:
                    self:
                      href: https://api.bitbucket.org/2.0/workspaces/standard/projects/TEST_PROJECT
                  type: project
                  name: cooperative standard
                  key: TEST_PROJECT
                  uuid: '{3b3e510b-7f2b-414d-a2b7-76c4e405c1c0}'
                created_on: '2021-07-28T21:20:19.491721+00:00'
                key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDX5yfMOEw6HG9jKTYTisbmDTJ4MCUTSVGr5e4OWvY3UuI2A6F8SdzQqa2f5BABA/4g5Sk5awJrYHlNu3EzV1V2I44tR3A4fnZAG71ZKyDPi1wvdO7UYmFgxV/Vd18H9QZFFjICGDM7W0PT2mI0kON/jN3qNWi+GiB/xgaeQKSqynysdysDp8lnnI/8Sh3ikURP9UP83ShRCpAXszOUNaa+UUlcYQYBDLIGowsg51c4PCkC3DNhAMxppkNRKoSOWwyl+oRVXHSDylkiJSBHW3HH4Q6WHieD54kGrjbhWBKdnnxKX7QAAZBDseY+t01N36m6/ljvXSUEcBWtHxBYye0r
                type: project_deploy_key
                id: 1234
              page: 1
              size: 1
        '403':
          description: If the specified workspace or project is not accessible to the current user
          schema:
            $ref: '#/definitions/error'
        '404':
          description: If the specified workspace or project does not exist
          schema:
            $ref: '#/definitions/error'
      parameters: []
      security:
      - oauth2:
        - project
        - project:admin
      - basic: []
      - api_key: []
      x-atlassian-oauth2-scopes:
      - state: Current
        scheme: oauth2
        scopes:
        - admin:project:bitbucket
      x-atlassian-auth-types:
      - api-token
    post:
      tags:
      - Deployments
      description: "Create a new deploy key in a project.\n\nExample:\n```\n$ curl -X POST \\\n-H \"Authorization <auth header>\" \\\n-H \"Content-type: application/json\" \\\nhttps://api.bitbucket.org/2.0/workspaces/standard/projects/TEST_PROJECT/deploy-keys/ -d \\\n'{\n    \"key\": \"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDAK/b1cHHDr/TEV1JGQl+WjCwStKG6Bhrv0rFpEsYlyTBm1fzN0VOJJYn4ZOPCPJwqse6fGbXntEs+BbXiptR+++HycVgl65TMR0b5ul5AgwrVdZdT7qjCOCgaSV74/9xlHDK8oqgGnfA7ZoBBU+qpVyaloSjBdJfLtPY/xqj4yHnXKYzrtn/uFc4Kp9Tb7PUg9Io3qohSTGJGVHnsVblq/rToJG7L5xIo0OxK0SJSQ5vuId93ZuFZrCNMXj8JDHZeSEtjJzpRCBEXHxpOPhAcbm4MzULgkFHhAVgp4JbkrT99/wpvZ7r9AdkTg7HGqL3rlaDrEcWfL7Lu6TnhBdq5 mleu@C02W454JHTD8\",\n    \"label\": \"mydeploykey\"\n}'\n```"
      summary: Create a project deploy key
      responses:
        '200':
          description: The project deploy key that was created
          schema:
            $ref: '#/definitions/project_deploy_key'
          examples:
            application/json:
              comment: mleu@C02W454JHTD8
              last_used: null
              links:
                self:
                  href: https://api.bitbucket.org/2.0/workspaces/standard/projects/TEST_PROJECT/deploy-keys/5/
              label: myprojectkey
              project:
                links:
                  self:
                    href: https://api.bitbucket.org/2.0/workspaces/standard/projects/TEST_PROJECT
                type: project
                name: cooperative standard
                key: TEST_PROJECT
                uuid: '{3b3e510b-7f2b-414d-a2b7-76c4e405c1c0}'
              created_on: '2021-08-10T05:28:00.570859+00:00'
              key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDAK/b1cHHDr/TEV1JGQl+WjCwStKG6Bhrv0rFpEsYlyTBm1fzN0VOJJYn4ZOPCPJwqse6fGbXntEs+BbXiptR+++HycVgl65TMR0b5ul5AgwrVdZdT7qjCOCgaSV74/9xlHDK8oqgGnfA7ZoBBU+qpVyaloSjBdJfLtPY/xqj4yHnXKYzrtn/uFc4Kp9Tb7PUg9Io3qohSTGJGVHnsVblq/rToJG7L5xIo0OxK0SJSQ5vuId93ZuFZrCNMXj8JDHZeSEtjJzpRCBEXHxpOPhAcbm4MzULgkFHhAVgp4JbkrT99/wpvZ7r9AdkTg7HGqL3rlaDrEcWfL7Lu6TnhBdq5
              type: project_deploy_key
              id: 5
        '400':
          description: Invalid deploy key inputs
          schema:
            $ref: '#/definitions/error'
        '403':
          description: If the specified workspace or project is not accessible to the current user
          schema:
            $ref: '#/definitions/error'
        '404':
          description: If the specified workspace or project does not exist
          schema:
            $ref: '#/definitions/error'
      parameters: []
      security:
      - oauth2:
        - project
        - project:admin
      - basic: []
      - api_key: []
      x-atlassian-oauth2-scopes:
      - state: Current
        scheme: oauth2
        scopes:
        - admin:project:bitbucket
        - write:ssh-key:bitbucket
      x-atlassian-auth-types:
      - api-token
  /workspaces/{workspace}/projects/{project_key}/deploy-keys/{key_id}:
    parameters:
    - name: key_id
      in: path
      description: The key ID matching the project deploy key.
      required: true
      type: string
    - name: project_key
      in: path
      description: 'The project in question. This is the actual `key` assigned

        to the project.

        '
      required: true
      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
      type: string
    delete:
      tags:
      - Deployments
      description: This deletes a deploy key from a project.
      summary: Delete a deploy key from a project
      responses:
        '204':
          description: The project deploy key has been deleted
        '403':
          description: If the current user does not have permission to delete a key for the specified project
          schema:
            $ref: '#/definitions/error'
        '404':
          description: If the specified workspace, project, or project deploy key does not exist
          schema:
            $ref: '#/definitions/error'
      parameters: []
      security:
      - oauth2:
        - project
        - project:admin
      - basic: []
      - api_key: []
      x-atlassian-oauth2-scopes:
      - state: Current
        scheme: oauth2
        scopes:
        - admin:project:bitbucket
        - delete:ssh-key:bitbucket
      x-atlassian-auth-types:
      - api-token
    get:
      tags:
      - Deployments
      description: Returns the deploy key belonging to a specific key ID.
      summary: Get a project deploy key
      responses:
        '200':
          description: Project deploy key matching the key ID
          schema:
            $ref: '#/definitions/project_deploy_key'
          examples:
            application/json:
              pagelen: 10
              values:
              - comment: thakseth@C02W454JHTD8
                last_used: null
                links:
                  self:
                    href: https://api.bitbucket.org/2.0/workspaces/standard/projects/TEST_PROJECT/deploy-keys/1234
                label: test
                project:
                  links:
                    self:
                      href: https://api.bitbucket.org/2.0/workspaces/standard/projects/TEST_PROJECT
                  type: project
                  name: cooperative standard
                  key: TEST_PROJECT
                  uuid: '{3b3e510b-7f2b-414d-a2b7-76c4e405c1c0}'
                created_on: '2021-07-28T21:20:19.491721+00:00'
                key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDX5yfMOEw6HG9jKTYTisbmDTJ4MCUTSVGr5e4OWvY3UuI2A6F8SdzQqa2f5BABA/4g5Sk5awJrYHlNu3EzV1V2I44tR3A4fnZAG71ZKyDPi1wvdO7UYmFgxV/Vd18H9QZFFjICGDM7W0PT2mI0kON/jN3qNWi+GiB/xgaeQKSqynysdysDp8lnnI/8Sh3ikURP9UP83ShRCpAXszOUNaa+UUlcYQYBDLIGowsg51c4PCkC3DNhAMxppkNRKoSOWwyl+oRVXHSDylkiJSBHW3HH4Q6WHieD54kGrjbhWBKdnnxKX7QAAZBDseY+t01N36m6/ljvXSUEcBWtHxBYye0r
                type: project_deploy_key
                id: 1234
        '403':
          description: If the specified workspace or project is not accessible to the current user
          schema:
            $ref: '#/definitions/error'
        '404':
          description: If the specified workspace or project does not exist
          schema:
            $ref: '#/definitions/error'
      parameters: []
      security:
      - oauth2:
        - project
        - project:admin
      - basic: []
      - api_key: []
      x-atlassian-oauth2-scopes:
      - state: Current
        scheme: oauth2
        scopes:
        - admin:project:bitbucket
      x-atlassian-auth-types:
      - api-token
definitions:
  paginated_deploy_keys:
    type: object
    title: Paginated Deploy Keys
    description: A paginated list of deploy keys.
    properties:
      size:
        type: integer
        description: Total number of objects in the response. This is an optional element that is not provided in all responses, as it can be expensive to compute.
        minimum: 0
      page:
        type: integer
        description: Page number of the current results. This is an optional element that is not provided in all responses.
        minimum: 1
      pagelen:
        type: integer
        description: 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.
        minimum: 1
      next:
        type: string
        description: Link to the next page if it exists. The last page of a collection does not have this value. Use this link to navigate the result set and refrain from constructing your own URLs.
        format: uri
      previous:
        type: string
        description: Link to previous page if it exists. A collections first page does not have this value. This is an optional element that is not provided in all responses. Some result sets strictly support forward navigation and never provide previous links. Clients must anticipate that backwards navigation is not always available. Use this link to navigate the result set and refrain from constructing your own URLs.
        format: uri
      values:
        type: array
        items:
          $ref: '#/definitions/deploy_key'
        minItems: 0
        uniqueItems: true
    additionalProperties: false
  base_commit:
    allOf:
    - $ref: '#/definitions/object'
    - type: object
      title: Base Commit
      description: The common base type for both repository and snippet commits.
      properties:
        hash:
          type: string
        

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