Bitbucket SSH API

The SSH resource allows you to manage SSH keys.

Documentation

Specifications

Schemas & Data

Other Resources

OpenAPI Specification

bitbucket-ssh-api-openapi.yml Raw ↑
swagger: '2.0'
info:
  title: Bitbucket Addon SSH 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: SSH
  description: 'The SSH resource allows you to manage SSH keys.

    '
paths:
  /users/{selected_user}/ssh-keys:
    parameters:
    - name: selected_user
      in: path
      description: 'This can either be an Atlassian Account ID OR the UUID of the account,

        surrounded by curly-braces, for example: `{account UUID}`.

        '
      required: true
      type: string
    get:
      tags:
      - SSH
      description: Returns a paginated list of the user's SSH public keys.
      summary: List SSH keys
      responses:
        '200':
          description: A list of the SSH keys associated with the account.
          schema:
            $ref: '#/definitions/paginated_ssh_user_keys'
          examples:
            application/json:
              page: 1
              pagelen: 10
              size: 1
              values:
              - comment: user@myhost
                created_on: '2018-03-14T13:17:05.196003+00:00'
                expires_on: null
                fingerprint: w9tZSiFoZ8oXwS4ZSWrJopGxwvnPIewA6Mo4owAHPrI
                key: ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKqP3Cr632C2dNhhgKVcon4ldUSAeKiku2yP9O9/bDtY
                label: ''
                last_used: '2018-03-20T13:18:05.196003+00:00'
                links:
                  self:
                    href: https://api.bitbucket.org/2.0/users/{ed08f5e1-605b-4f4a-aee4-6c97628a673e}/ssh-keys/b15b6026-9c02-4626-b4ad-b905f99f763a
                owner:
                  display_name: Mark Adams
                  links:
                    avatar:
                      href: https://bitbucket.org/account/markadams-atl/avatar/32/
                    html:
                      href: https://bitbucket.org/markadams-atl/
                    self:
                      href: https://api.bitbucket.org/2.0/users/{ed08f5e1-605b-4f4a-aee4-6c97628a673e}
                  type: user
                  username: markadams-atl
                  nickname: markadams-atl
                  uuid: '{d7dd0e2d-3994-4a50-a9ee-d260b6cefdab}'
                type: ssh_key
                uuid: '{b15b6026-9c02-4626-b4ad-b905f99f763a}'
        '403':
          description: If the specified user's keys are not accessible to the current user
        '404':
          description: If the specified user does not exist
          schema:
            $ref: '#/definitions/error'
      parameters: []
      security:
      - oauth2:
        - account
      - basic: []
      - api_key: []
      x-atlassian-oauth2-scopes:
      - state: Current
        scheme: oauth2
        scopes:
        - read:ssh-key:bitbucket
      x-atlassian-auth-types:
      - api-token
    post:
      tags:
      - SSH
      description: 'Adds a new SSH public key to the specified user account and returns the resulting key.


        Example:


        ```

        $ curl -X POST -H "Content-Type: application/json" -d ''{"key": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKqP3Cr632C2dNhhgKVcon4ldUSAeKiku2yP9O9/bDtY user@myhost"}'' https://api.bitbucket.org/2.0/users/{ed08f5e1-605b-4f4a-aee4-6c97628a673e}/ssh-keys

        ```'
      summary: Add a new SSH key
      responses:
        '201':
          description: The newly created SSH key.
          schema:
            $ref: '#/definitions/ssh_account_key'
          examples:
            application/json:
              comment: user@myhost
              created_on: '2018-03-14T13:17:05.196003+00:00'
              expires_on: null
              fingerprint: w9tZSiFoZ8oXwS4ZSWrJopGxwvnPIewA6Mo4owAHPrI
              key: ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKqP3Cr632C2dNhhgKVcon4ldUSAeKiku2yP9O9/bDtY
              label: ''
              last_used: '2018-03-20T13:18:05.196003+00:00'
              links:
                self:
                  href: https://api.bitbucket.org/2.0/users/{ed08f5e1-605b-4f4a-aee4-6c97628a673e}/ssh-keys/b15b6026-9c02-4626-b4ad-b905f99f763a
              owner:
                display_name: Mark Adams
                links:
                  avatar:
                    href: https://bitbucket.org/account/markadams-atl/avatar/32/
                  html:
                    href: https://bitbucket.org/markadams-atl/
                  self:
                    href: https://api.bitbucket.org/2.0/users/{ed08f5e1-605b-4f4a-aee4-6c97628a673e}
                type: user
                username: markadams-atl
                nickname: markadams-atl
                uuid: '{d7dd0e2d-3994-4a50-a9ee-d260b6cefdab}'
              type: ssh_key
              uuid: '{b15b6026-9c02-4626-b4ad-b905f99f763a}'
        '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 does not exist
          schema:
            $ref: '#/definitions/error'
      parameters:
      - name: _body
        in: body
        description: The new SSH key object. Note that the username property has been deprecated due to [privacy changes](https://developer.atlassian.com/cloud/bitbucket/bitbucket-api-changes-gdpr/#removal-of-usernames-from-user-referencing-apis).
        required: false
        schema:
          $ref: '#/definitions/ssh_account_key'
      - name: expires_on
        in: query
        description: 'The date or date-time of when the key will expire,

          in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format.

          Example: `YYYY-MM-DDTHH:mm:ss.sssZ`'
        required: false
        type: string
      security:
      - oauth2:
        - account:write
      - basic: []
      - api_key: []
      x-atlassian-oauth2-scopes:
      - state: Current
        scheme: oauth2
        scopes:
        - read:ssh-key:bitbucket
        - write:ssh-key:bitbucket
      x-atlassian-auth-types:
      - api-token
  /users/{selected_user}/ssh-keys/{key_id}:
    parameters:
    - name: key_id
      in: path
      description: The SSH key's UUID value.
      required: true
      type: string
    - name: selected_user
      in: path
      description: 'This can either be an Atlassian Account ID OR the UUID of the account,

        surrounded by curly-braces, for example: `{account UUID}`.

        '
      required: true
      type: string
    delete:
      tags:
      - SSH
      description: Deletes a specific SSH public key from a user's account.
      summary: Delete a SSH key
      responses:
        '204':
          description: The key has been deleted
        '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 does not exist
          schema:
            $ref: '#/definitions/error'
      parameters: []
      security:
      - oauth2:
        - account:write
      - basic: []
      - api_key: []
      x-atlassian-oauth2-scopes:
      - state: Current
        scheme: oauth2
        scopes:
        - delete:ssh-key:bitbucket
      x-atlassian-auth-types:
      - api-token
    get:
      tags:
      - SSH
      description: Returns a specific SSH public key belonging to a user.
      summary: Get a SSH key
      responses:
        '200':
          description: The specific SSH key matching the user and UUID
          schema:
            $ref: '#/definitions/ssh_account_key'
          examples:
            application/json:
              comment: user@myhost
              created_on: '2018-03-14T13:17:05.196003+00:00'
              expires_on: null
              fingerprint: w9tZSiFoZ8oXwS4ZSWrJopGxwvnPIewA6Mo4owAHPrI
              key: ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKqP3Cr632C2dNhhgKVcon4ldUSAeKiku2yP9O9/bDtY
              label: ''
              last_used: '2018-03-20T13:18:05.196003+00:00'
              links:
                self:
                  href: https://api.bitbucket.org/2.0/users/{ed08f5e1-605b-4f4a-aee4-6c97628a673e}/ssh-keys/b15b6026-9c02-4626-b4ad-b905f99f763a
              owner:
                display_name: Mark Adams
                links:
                  avatar:
                    href: https://bitbucket.org/account/markadams-atl/avatar/32/
                  html:
                    href: https://bitbucket.org/markadams-atl/
                  self:
                    href: https://api.bitbucket.org/2.0/users/{ed08f5e1-605b-4f4a-aee4-6c97628a673e}
                type: user
                username: markadams-atl
                nickname: markadams-atl
                uuid: '{d7dd0e2d-3994-4a50-a9ee-d260b6cefdab}'
              type: ssh_key
              uuid: '{b15b6026-9c02-4626-b4ad-b905f99f763a}'
        '403':
          description: If the specified user or key is not accessible to the current user
        '404':
          description: If the specified user or key does not exist
          schema:
            $ref: '#/definitions/error'
      parameters: []
      security:
      - oauth2:
        - account
      - basic: []
      - api_key: []
      x-atlassian-oauth2-scopes:
      - state: Current
        scheme: oauth2
        scopes:
        - read:ssh-key:bitbucket
      x-atlassian-auth-types:
      - api-token
    put:
      tags:
      - SSH
      description: 'Updates a specific SSH public key on a user''s account


        Note: Only the ''comment'' field can be updated using this API. To modify the key or comment values, you must delete and add the key again.


        Example:


        ```

        $ curl -X PUT -H "Content-Type: application/json" -d ''{"label": "Work key"}'' https://api.bitbucket.org/2.0/users/{ed08f5e1-605b-4f4a-aee4-6c97628a673e}/ssh-keys/{b15b6026-9c02-4626-b4ad-b905f99f763a}

        ```'
      summary: Update a SSH key
      responses:
        '200':
          description: The newly updated SSH key.
          schema:
            $ref: '#/definitions/ssh_account_key'
          examples:
            application/json:
              comment: ''
              created_on: '2018-03-14T13:17:05.196003+00:00'
              expires_on: null
              fingerprint: w9tZSiFoZ8oXwS4ZSWrJopGxwvnPIewA6Mo4owAHPrI
              key: ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKqP3Cr632C2dNhhgKVcon4ldUSAeKiku2yP9O9/bDtY
              label: Work key
              last_used: '2018-03-20T13:18:05.196003+00:00'
              links:
                self:
                  href: https://api.bitbucket.org/2.0/users/{ed08f5e1-605b-4f4a-aee4-6c97628a673e}/ssh-keys/b15b6026-9c02-4626-b4ad-b905f99f763a
              owner:
                display_name: Mark Adams
                links:
                  avatar:
                    href: https://bitbucket.org/account/markadams-atl/avatar/32/
                  html:
                    href: https://bitbucket.org/markadams-atl/
                  self:
                    href: https://api.bitbucket.org/2.0/users/{ed08f5e1-605b-4f4a-aee4-6c97628a673e}
                type: user
                username: markadams-atl
                nickname: markadams-atl
                uuid: '{d7dd0e2d-3994-4a50-a9ee-d260b6cefdab}'
              type: ssh_key
              uuid: '{b15b6026-9c02-4626-b4ad-b905f99f763a}'
        '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 does not exist
          schema:
            $ref: '#/definitions/error'
      parameters:
      - name: _body
        in: body
        description: The updated SSH key object
        required: false
        schema:
          $ref: '#/definitions/ssh_account_key'
      security:
      - oauth2:
        - account:write
      - basic: []
      - api_key: []
      x-atlassian-oauth2-scopes:
      - state: Current
        scheme: oauth2
        scopes:
        - read:ssh-key:bitbucket
        - write:ssh-key:bitbucket
      x-atlassian-auth-types:
      - api-token
definitions:
  error:
    type: object
    title: Error
    description: Base type for most resource objects. It defines the common `type` element that identifies an object's type. It also identifies the element as Swagger's `discriminator`.
    properties:
      type:
        type: string
      error:
        type: object
        properties:
          message:
            type: string
          detail:
            type: string
          data:
            type: object
            description: Optional structured data that is endpoint-specific.
            properties: {}
            additionalProperties: true
        required:
        - message
        additionalProperties: false
    required:
    - type
    additionalProperties: true
  ssh_account_key:
    allOf:
    - $ref: '#/definitions/ssh_key'
    - type: object
      title: SSH Account Key
      description: Represents an SSH public key for a user.
      properties:
        owner:
          $ref: '#/definitions/account'
        expires_on:
          type: string
          format: date-time
        fingerprint:
          type: string
          description: The SSH key fingerprint in SHA-256 format.
      additionalProperties: true
  link:
    type: object
    title: Link
    description: A link to a resource related to this object.
    properties:
      href:
        type: string
        format: uri
      name:
        type: string
    additionalProperties: false
  object:
    type: object
    description: Base type for most resource objects. It defines the common `type` element that identifies an object's type. It also identifies the element as Swagger's `discriminator`.
    properties:
      type:
        type: string
    required:
    - type
    additionalProperties: true
    discriminator: type
  paginated_ssh_user_keys:
    type: object
    title: Paginated SSH User Keys
    description: A paginated list of SSH 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/ssh_account_key'
        minItems: 0
        uniqueItems: true
    additionalProperties: false
  account:
    allOf:
    - $ref: '#/definitions/object'
    - type: object
      title: Account
      description: An account object.
      properties:
        links:
          $ref: '#/definitions/account_links'
        created_on:
          type: string
          format: date-time
        display_name:
          type: string
        uuid:
          type: string
      additionalProperties: true
  ssh_key:
    allOf:
    - $ref: '#/definitions/object'
    - type: object
      title: SSH Key
      description: Base type for representing SSH public keys.
      properties:
        uuid:
          type: string
          description: The SSH key's immutable ID.
        key:
          type: string
          description: The SSH public key value in OpenSSH format.
        comment:
          type: string
          description: The comment parsed from the SSH key (if present)
        label:
          type: string
          description: The user-defined label for the SSH key
        created_on:
          type: string
          format: date-time
        last_used:
          type: string
          format: date-time
        links:
          type: object
          properties:
            self:
              type: object
              title: Link
              description: A link to a resource related to this object.
              properties:
                href:
                  type: string
                  format: uri
                name:
                  type: string
              additionalProperties: false
          additionalProperties: false
      additionalProperties: true
  account_links:
    type: object
    title: Account Links
    description: Links related to an Account.
    properties:
      avatar:
        $ref: '#/definitions/link'
    additionalProperties: true
securityDefinitions:
  basic:
    type: basic
    description: Basic HTTP Authentication as per [RFC-2617](https://tools.ietf.org/html/rfc2617) (Digest not supported). Note that Basic Auth is available only with username and app password as credentials.
  oauth2:
    type: oauth2
    description: OAuth 2 as per [RFC-6749](https://tools.ietf.org/html/rfc6749).
    flow: accessCode
    authorizationUrl: https://bitbucket.org/site/oauth2/authorize
    tokenUrl: https://bitbucket.org/site/oauth2/access_token
    scopes:
      repository: Read your repositories
      repository:write: Read and modify your repositories
      repository:admin: Administer your repositories
      repository:delete: Delete your repositories
      project: Read your workspace's project settings and read repositories contained within your workspace's projects
      project:admin: Read and modify settings for projects in your workspace
      email: Read your account's primary email address
      account: Read your account information
      account:write: Read and modify your account information
      team: Read your team membership information
      team:write: Read and modify your team membership information
      pipeline: Access your repositories' build pipelines
      pipeline:write: Access and rerun your repositories' build pipelines
      pipeline:variable: Access your repositories' build pipelines and configure their variables
      runner: Access your workspaces/repositories' runners
      runner:write: Access and edit your workspaces/repositories' runners
      test: Access your workspaces/repositories' test
      test:write: Access and edit your workspaces/repositories' test
      pullrequest: Read your repositories and their pull requests
      pullrequest:write: Read and modify your repositories and their pull requests
      webhook: Read and modify your repositories' webhooks
      issue: Read your repositories' issues
      issue:write: Read and modify your repositories' issues
      snippet: Read your snippets
      snippet:write: Read and modify your snippets
      wiki: Read and modify your repositories' wikis
  api_key:
    name: Authorization
    type: apiKey
    description: API Keys can be used as Basic HTTP Authentication credentials and provide a substitute for the account's actual username and password. API Keys are only available to team accounts and there is only 1 key per account. API Keys do not support scopes and have therefore access to all contents of the account.
    in: header
x-revision: 84a5dd73aa83
x-atlassian-narrative:
  documents:
  - anchor: authentication
    title: Authentication methods
    description: How to authenticate API actions
    icon: data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxOTcuNjQ3MyAxODYuODEzOCI+CiAgPGRlZnM+CiAgICA8c3R5bGU+CiAgICAgIC5jbHMtMSB7CiAgICAgICAgaXNvbGF0aW9uOiBpc29sYXRlOwogICAgICB9CgogICAgICAuY2xzLTIgewogICAgICAgIGZpbGw6ICNkZTM1MGI7CiAgICAgIH0KCiAgICAgIC5jbHMtMyB7CiAgICAgICAgZmlsbDogI2ZmNTYzMDsKICAgICAgfQoKICAgICAgLmNscy00IHsKICAgICAgICBmaWxsOiAjZGZlMWU1OwogICAgICAgIG1peC1ibGVuZC1tb2RlOiBtdWx0aXBseTsKICAgICAgfQoKICAgICAgLmNscy01IHsKICAgICAgICBmaWxsOiAjZmFmYmZjOwogICAgICB9CgogICAgICAuY2xzLTYgewogICAgICAgIGZpbGw6ICNlYmVjZjA7CiAgICAgIH0KCiAgICAgIC5jbHMtNyB7CiAgICAgICAgZmlsbDogbm9uZTsKICAgICAgICBzdHJva2U6ICMwMDY1ZmY7CiAgICAgICAgc3Ryb2tlLW1pdGVybGltaXQ6IDEwOwogICAgICAgIHN0cm9rZS13aWR0aDogM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Ny44ODg3SDQxLjA0MTZhMy45NDQzLDMuOTQ0MywwLDAsMCwwLDcuODg4N1oiLz4KICAgICAgICA8cGF0aCBjbGFzcz0iY2xzLTEwIiBkPSJNODEuNzk3NSwxMDAuMzFhMy45NDM5LDMuOTQzOSwwLDAsMC0zLjk0NDMtMy45NDQzSDQxLjA0MTdhMy45NDQzLDMuOTQ0MywwLDAsMCwwLDcuODg4N0g3Ny44NTMyQTMuOTQzOSwzLjk0MzksMCwwLDAsODEuNzk3NSwxMDAuMzFaIi8+CiAgICAgICAgPHBhdGggY2xhc3M9ImNscy0xMCIgZD0iTTIyLjQ5MzIsMTIyLjgwMjlBMjIuNDkyOSwyMi40OTI5LDAsMSwxLDQ0Ljk4NTgsMTAwLjMxLDIyLjUxODUsMjIuNTE4NSwwLDAsMSwyMi40OTMyLDEyMi44MDI5Wm0wLTM3LjA5NzJBMTQuNjA0MiwxNC42MDQyLDAsMSwwLDM3LjA5NzIsMTAwLjMxLDE0LjYyMDcsMTQuNjIwNywwLDAsMCwyMi40OTMyLDg1LjcwNTdaIi8+CiAgICAgIDwvZz4KICAgIDwvZz4KICA8L2c+Cjwvc3ZnPgo=
    body: "\nThe purpose of this section is to describe how to authenticate when making API calls using the Bitbucket REST API.\n\n-----\n\n* [Access tokens](#access-tokens)\n  * [Repository access tokens](#repository-access-tokens)\n  * [Project access tokens](#project-access-tokens)\n  * [Workspace access tokens](#workspace-access-tokens)\n* [App passwords](#app-passwords)\n* [API tokens](#api-tokens)\n* [OAuth 2.0](#oauth-2-0)\n  * [Making requests](#making-requests)\n  * [Repository cloning](#repository-cloning)\n  * [Refresh tokens](#refresh-tokens)\n* [Bitbucket OAuth 2.0 Scopes](#bitbucket-oauth-2-0-scopes)\n* [Forge app and API token scopes](#forge-app-and-api-token-scopes)\n\n---\n\n### Access tokens\n\nAccess tokens are passwords (or tokens) that provide access to a _single_ repository, project or workspace.\nThese tokens can authenticate with Bitbucket APIs for scripting, CI/CD tools, Bitbucket Cloud-connected apps,\nand Bitbucket Cloud integrations.\n\nAccess tokens are linked to a repository, project, or workspace, not a user account.\nThe level of access provided by the token is set when a repository, or workspace admin creates it,\nby setting privilege scopes.\n\nThere are three types of access token:\n\n* **Repository access tokens** can connect to a single repository, preventing them from accessing any other repositories or workspaces.\n* **Project access tokens** can connect to a single project, providing access to any repositories within the project.\n* **Workspace access tokens** can connect to a single workspace and have access to any projects and repositories within that workspace.\n\nWhen using Bitbucket APIs with an access token, the token will be treated as the \"user\" in the\nBitbucket UI and Bitbucket logs. This includes when using the access token to leave a comment on a pull request,\npush a commit, or merge a pull request. The Bitbucket UI and API responses will show the\nrepository/project/workspace access token as a user. The username shown in the Bitbucket UI is the Access\nToken _name_, and a custom icon is used to differentiate it from a regular user in the UI.\n\n#### Considerations for using access tokens\n\n* After creation, an access token can't be viewed or modified. The token's name, created date,\nlast accessed date, and scopes are visible on the repository, project, or workspace **access tokens** page.\n* Access tokens can access a limited set of Bitbucket's privilege scopes.\n* Provided you set the correct privilege scopes, you can use an access token to clone (`repository`)\nand push (`repository:write`) code to the token's repository or the repositories the token can access.\n* You can't use an access token to log into the Bitbucket website.\n* Access tokens don't require two-step verification.\n* You can set privilege scopes (specific access rights) for each access token.\n* You can't use an access token to manipulate or query repository, project, or workspace permissions.\n* Access tokens are not listed in any repository or workspace permission API response.\n* Access tokens are deactivated when deleting the resource tied to it (a repository, project, or workspace).\n* Repository access tokens are also revoked when transferring the repository to another workspace.\n* Any content created by the access token will persist after the access token has been revoked.\n* Access tokens can interact with branch restriction APIs, but the token can't be configured as a user with merge access when using branch restrictions.\n\nThere are some APIs which are inaccessible for Access tokens, these are:\n\n* [Add a repository deploy key](/cloud/bitbucket/rest/api-group-deployments/#api-repositories-workspace-repo-slug-deploy-keys-post)\n* [Update a repository deploy key](/cloud/bitbucket/rest/api-group-deployments/#api-repositories-workspace-repo-slug-deploy-keys-key-id-put)\n* [Delete a repository deploy key](/cloud/bitbucket/rest/api-group-deployments/#api-repositories-workspace-repo-slug-deploy-keys-key-id-delete)\n\n#### Repository access tokens\n\nFor details on creating, managing, and using repository access tokens, visit\n[Repository access tokens](https://support.atlassian.com/bitbucket-cloud/docs/reposit

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