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.

Operations 16

GET /repositories/{workspace}/{repo_slug}/deploy-keys List repository deploy keys
POST /repositories/{workspace}/{repo_slug}/deploy-keys Add a repository deploy key
DELETE /repositories/{workspace}/{repo_slug}/deploy-keys/{key_id} Delete a repository deploy key
GET /repositories/{workspace}/{repo_slug}/deploy-keys/{key_id} Get a repository deploy key
PUT /repositories/{workspace}/{repo_slug}/deploy-keys/{key_id} Update a repository deploy key
GET /repositories/{workspace}/{repo_slug}/deployments List deployments #
GET /repositories/{workspace}/{repo_slug}/deployments/{deployment_uuid} Get a deployment #
GET /repositories/{workspace}/{repo_slug}/environments List environments #
POST /repositories/{workspace}/{repo_slug}/environments Create an environment #
GET /repositories/{workspace}/{repo_slug}/environments/{environment_uuid} Get an environment #
DELETE /repositories/{workspace}/{repo_slug}/environments/{environment_uuid} Delete an environment #
POST /repositories/{workspace}/{repo_slug}/environments/{environment_uuid}/changes Update an environment #
GET /workspaces/{workspace}/projects/{project_key}/deploy-keys List project deploy keys
POST /workspaces/{workspace}/projects/{project_key}/deploy-keys Create a project deploy key
DELETE /workspaces/{workspace}/projects/{project_key}/deploy-keys/{key_id} Delete a deploy key from a project
GET /workspaces/{workspace}/projects/{project_key}/deploy-keys/{key_id} Get a project deploy key

Documentation

Specifications

Schemas & Data

Other Resources

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/bitbucket-deployments-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

bitbucket-deployments-api-openapi.yml Raw ↑
openapi: 3.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
servers:
- url: https://api.bitbucket.org/2.0
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
      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:
      - Deployments
      description: Returns all deploy-keys belonging to a repository.
      summary: List repository deploy keys
      responses:
        '200':
          description: Deploy keys matching the repository
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/paginated_deploy_keys'
              example:
                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
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
      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
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/deploy_key'
              example:
                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
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
      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
      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:
      - 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
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
      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
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/deploy_key'
              example:
                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
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
      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.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/deploy_key'
              example:
                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
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/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
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
      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
        schema:
          type: string
      - name: repo_slug
        description: The repository.
        required: true
        in: path
        schema:
          type: string
      responses:
        '200':
          description: The matching deployments.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/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
        schema:
          type: string
      - name: repo_slug
        description: The repository.
        required: true
        in: path
        schema:
          type: string
      - name: deployment_uuid
        description: The deployment UUID.
        required: true
        in: path
        schema:
          type: string
      responses:
        '200':
          description: The deployment.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/deployment'
        '404':
          description: No account, repository or deployment with the UUID provided exists.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/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
        schema:
          type: string
      - name: repo_slug
        description: The repository.
        required: true
        in: path
        schema:
          type: string
      responses:
        '200':
          description: The matching environments.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/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
        schema:
          type: string
      - name: repo_slug
        description: The repository.
        required: true
        in: path
        schema:
          type: string
      responses:
        '201':
          description: The environment was created.
          headers:
            Location:
              description: The URL of the newly created environment.
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/deployment_environment'
        '404':
          description: The account or repository does not exist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
        '409':
          description: An environment host with the provided name already exists.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/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
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/deployment_environment'
        description: The environment to create.
        required: true
  /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
        schema:
          type: string
      - name: repo_slug
        description: The repository.
        required: true
        in: path
        schema:
          type: string
      - name: environment_uuid
        description: The environment UUID.
        required: true
        in: path
        schema:
          type: string
      responses:
        '200':
          description: The environment.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/deployment_environment'
        '404':
          description: No account, repository or environment with the UUID provided exists.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/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
        schema:
          type: string
      - name: repo_slug
        description: The repository.
        required: true
        in: path
        schema:
          type: string
      - name: environment_uuid
        description: The environment UUID.
        required: true
        in: path
        schema:
          type: string
      responses:
        '204':
          description: The environment was deleted.
        '404':
          description: No account or repository with the UUID provided exists.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/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
        schema:
          type: string
      - name: repo_slug
        description: The repository.
        required: true
        in: path
        schema:
          type: string
      - name: environment_uuid
        description: The environment UUID.
        required: true
        in: path
        schema:
          type: string
      responses:
        '202':
          description: The environment update request was accepted.
        '404':
          description: No account, repository or environment with the UUID provided exists.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/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
      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:
      - Deployments
      description: Returns all deploy keys belonging to a project.
      summary: List project deploy keys
      responses:
        '200':
          description: Deploy keys matching the project
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/paginated_project_deploy_keys'
              example:
                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
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
        '404':
          description: If the specified workspace or project does not exist
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
      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
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/project_deploy_key'
              example:
                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
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
        '403':
          description: If the specified workspace or project is not accessible to the current user
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
        '404':
          description: If the specified workspace or project does not exist
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
      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
      schema:
        type: string
    - name: project_key
      in: path
      description: 'The project in question. This is the actual `key` assigned

        to the project.

        '
      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:
      - 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
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
        '404':
          description: If the specified workspace, project, or project deploy key does not exist
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
      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
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/project_deploy_key'
              example:
                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
          content:
            application/json:
              schema:
                $ref: '#/

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