Bitbucket Commits API

These are the repository's commits. They are paginated and returned in reverse chronological order, similar to the output of git log.

Operations 25

GET /repositories/{workspace}/{repo_slug}/commit/{commit} Get a commit
DELETE /repositories/{workspace}/{repo_slug}/commit/{commit}/approve Unapprove a commit
POST /repositories/{workspace}/{repo_slug}/commit/{commit}/approve Approve a commit
GET /repositories/{workspace}/{repo_slug}/commit/{commit}/comments List a commit's comments
POST /repositories/{workspace}/{repo_slug}/commit/{commit}/comments Create comment for a commit
DELETE /repositories/{workspace}/{repo_slug}/commit/{commit}/comments/{comment_id} Delete a commit comment
GET /repositories/{workspace}/{repo_slug}/commit/{commit}/comments/{comment_id} Get a commit comment
PUT /repositories/{workspace}/{repo_slug}/commit/{commit}/comments/{comment_id} Update a commit comment
GET /repositories/{workspace}/{repo_slug}/commit/{commit}/reports List reports #
PUT /repositories/{workspace}/{repo_slug}/commit/{commit}/reports/{reportId} Create or update a report #
GET /repositories/{workspace}/{repo_slug}/commit/{commit}/reports/{reportId} Get a report #
DELETE /repositories/{workspace}/{repo_slug}/commit/{commit}/reports/{reportId} Delete a report #
GET /repositories/{workspace}/{repo_slug}/commit/{commit}/reports/{reportId}/annotations List annotations #
POST /repositories/{workspace}/{repo_slug}/commit/{commit}/reports/{reportId}/annotations Bulk create or update annotations #
GET /repositories/{workspace}/{repo_slug}/commit/{commit}/reports/{reportId}/annotations/{annotationId} Get an annotation #
PUT /repositories/{workspace}/{repo_slug}/commit/{commit}/reports/{reportId}/annotations/{annotationId} Create or update an annotation #
DELETE /repositories/{workspace}/{repo_slug}/commit/{commit}/reports/{reportId}/annotations/{annotationId} Delete an annotation #
GET /repositories/{workspace}/{repo_slug}/commits List commits
POST /repositories/{workspace}/{repo_slug}/commits List commits with include/exclude
GET /repositories/{workspace}/{repo_slug}/commits/{revision} List commits for revision
POST /repositories/{workspace}/{repo_slug}/commits/{revision} List commits for revision using include/exclude
GET /repositories/{workspace}/{repo_slug}/diff/{spec} Compare two commits
GET /repositories/{workspace}/{repo_slug}/diffstat/{spec} Compare two commit diff stats
GET /repositories/{workspace}/{repo_slug}/merge-base/{revspec} Get the common ancestor between two commits
GET /repositories/{workspace}/{repo_slug}/patch/{spec} Get a patch for two commits

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-commits-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-commits-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Bitbucket Addon Commits 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: Commits
  description: 'These are the repository''s commits. They are paginated and returned in

    reverse chronological order, similar to the output of git log.

    '
paths:
  /repositories/{workspace}/{repo_slug}/commit/{commit}:
    parameters:
    - name: commit
      in: path
      description: The commit's SHA1.
      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
    get:
      tags:
      - Commits
      description: Returns the specified commit.
      summary: Get a commit
      responses:
        '200':
          description: The commit object
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/commit'
              example:
                rendered:
                  message:
                    raw: Add a GEORDI_OUTPUT_DIR setting
                    markup: markdown
                    html: <p>Add a GEORDI_OUTPUT_DIR setting</p>
                    type: rendered
                hash: f7591a13eda445d9a9167f98eb870319f4b6c2d8
                repository:
                  name: geordi
                  type: repository
                  full_name: bitbucket/geordi
                  links:
                    self:
                      href: https://api.bitbucket.org/2.0/repositories/bitbucket/geordi
                    html:
                      href: https://bitbucket.org/bitbucket/geordi
                    avatar:
                      href: https://bytebucket.org/ravatar/%7B85d08b4e-571d-44e9-a507-fa476535aa98%7D?ts=1730260
                  uuid: '{85d08b4e-571d-44e9-a507-fa476535aa98}'
                links:
                  self:
                    href: https://api.bitbucket.org/2.0/repositories/bitbucket/geordi/commit/f7591a13eda445d9a9167f98eb870319f4b6c2d8
                  comments:
                    href: https://api.bitbucket.org/2.0/repositories/bitbucket/geordi/commit/f7591a13eda445d9a9167f98eb870319f4b6c2d8/comments
                  patch:
                    href: https://api.bitbucket.org/2.0/repositories/bitbucket/geordi/patch/f7591a13eda445d9a9167f98eb870319f4b6c2d8
                  html:
                    href: https://bitbucket.org/bitbucket/geordi/commits/f7591a13eda445d9a9167f98eb870319f4b6c2d8
                  diff:
                    href: https://api.bitbucket.org/2.0/repositories/bitbucket/geordi/diff/f7591a13eda445d9a9167f98eb870319f4b6c2d8
                  approve:
                    href: https://api.bitbucket.org/2.0/repositories/bitbucket/geordi/commit/f7591a13eda445d9a9167f98eb870319f4b6c2d8/approve
                  statuses:
                    href: https://api.bitbucket.org/2.0/repositories/bitbucket/geordi/commit/f7591a13eda445d9a9167f98eb870319f4b6c2d8/statuses
                author:
                  raw: Brodie Rao <a@b.c>
                  type: author
                  user:
                    display_name: Brodie Rao
                    uuid: '{9484702e-c663-4afd-aefb-c93a8cd31c28}'
                    links:
                      self:
                        href: https://api.bitbucket.org/2.0/users/%7B9484702e-c663-4afd-aefb-c93a8cd31c28%7D
                      html:
                        href: https://bitbucket.org/%7B9484702e-c663-4afd-aefb-c93a8cd31c28%7D/
                      avatar:
                        href: https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/557058:3aae1e05-702a-41e5-81c8-f36f29afb6ca/613070db-28b0-421f-8dba-ae8a87e2a5c7/128
                    type: user
                    nickname: brodie
                    account_id: 557058:3aae1e05-702a-41e5-81c8-f36f29afb6ca
                summary:
                  raw: Add a GEORDI_OUTPUT_DIR setting
                  markup: markdown
                  html: <p>Add a GEORDI_OUTPUT_DIR setting</p>
                  type: rendered
                participants: []
                parents:
                - type: commit
                  hash: f06941fec4ef6bcb0c2456927a0cf258fa4f899b
                  links:
                    self:
                      href: https://api.bitbucket.org/2.0/repositories/bitbucket/geordi/commit/f06941fec4ef6bcb0c2456927a0cf258fa4f899b
                    html:
                      href: https://bitbucket.org/bitbucket/geordi/commits/f06941fec4ef6bcb0c2456927a0cf258fa4f899b
                date: '2012-07-16T19:37:54+00:00'
                message: Add a GEORDI_OUTPUT_DIR setting
                type: commit
        '404':
          description: If the specified commit or repository does not exist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
      security:
      - oauth2:
        - repository
      - basic: []
      - api_key: []
      x-atlassian-oauth2-scopes:
      - state: Current
        scheme: oauth2
        scopes:
        - read:repository:bitbucket
      x-atlassian-auth-types:
      - forge-oauth2
      - api-token
  /repositories/{workspace}/{repo_slug}/commit/{commit}/approve:
    parameters:
    - name: commit
      in: path
      description: The commit's SHA1.
      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:
      - Commits
      description: 'Redact the authenticated user''s approval of the specified commit.


        This operation is only available to users that have explicit access to

        the repository. In contrast, just the fact that a repository is

        publicly accessible to users does not give them the ability to approve

        commits.'
      summary: Unapprove a commit
      responses:
        '204':
          description: An empty response indicating the authenticated user's approval has been withdrawn.
        '404':
          description: If the specified commit, or the repository does not exist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
      security:
      - oauth2:
        - repository:write
      - basic: []
      - api_key: []
      x-atlassian-oauth2-scopes:
      - state: Current
        scheme: oauth2
        scopes:
        - write:repository:bitbucket
      x-atlassian-auth-types:
      - forge-oauth2
      - api-token
    post:
      tags:
      - Commits
      description: 'Approve the specified commit as the authenticated user.


        This operation is only available to users that have explicit access to

        the repository. In contrast, just the fact that a repository is

        publicly accessible to users does not give them the ability to approve

        commits.'
      summary: Approve a commit
      responses:
        '200':
          description: The `participant` object recording that the authenticated user approved the commit.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/participant'
        '404':
          description: If the specified commit, or the repository does not exist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
      security:
      - oauth2:
        - repository:write
      - basic: []
      - api_key: []
      x-atlassian-oauth2-scopes:
      - state: Current
        scheme: oauth2
        scopes:
        - read:repository:bitbucket
        - write:repository:bitbucket
      x-atlassian-auth-types:
      - forge-oauth2
      - api-token
  /repositories/{workspace}/{repo_slug}/commit/{commit}/comments:
    parameters:
    - name: commit
      in: path
      description: The commit's SHA1.
      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
    get:
      tags:
      - Commits
      description: 'Returns the commit''s comments.


        This includes both global and inline comments.


        The default sorting is oldest to newest and can be overridden with

        the `sort` query parameter.'
      summary: List a commit's comments
      responses:
        '200':
          description: A paginated list of commit comments.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/paginated_commit_comments'
      parameters:
      - name: q
        in: query
        description: 'Query string to narrow down the response as per

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

          '
        required: false
        schema:
          type: string
      - name: sort
        in: query
        description: 'Field by which the results should be sorted as per

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

          '
        required: false
        schema:
          type: string
      security:
      - oauth2:
        - repository
      - basic: []
      - api_key: []
      x-atlassian-oauth2-scopes:
      - state: Current
        scheme: oauth2
        scopes:
        - read:repository:bitbucket
      x-atlassian-auth-types:
      - forge-oauth2
      - api-token
    post:
      tags:
      - Commits
      description: "Creates new comment on the specified commit.\n\nTo post a reply to an existing comment, include the `parent.id` field:\n\n```\n$ curl https://api.bitbucket.org/2.0/repositories/atlassian/prlinks/commit/db9ba1e031d07a02603eae0e559a7adc010257fc/comments/ \\\n  -X POST -u evzijst \\\n  -H 'Content-Type: application/json' \\\n  -d '{\"content\": {\"raw\": \"One more thing!\"},\n       \"parent\": {\"id\": 5728901}}'\n```"
      summary: Create comment for a commit
      responses:
        '201':
          description: The newly created comment.
          headers:
            Location:
              description: The location of the newly created comment.
              schema:
                type: string
        '400':
          description: If the comment was detected as spam, or if the parent comment is not attached to the same node as the new comment
        '404':
          description: If a parent ID was passed in that cannot be found
      security:
      - oauth2:
        - repository
      - basic: []
      - api_key: []
      x-atlassian-oauth2-scopes:
      - state: Current
        scheme: oauth2
        scopes:
        - read:repository:bitbucket
      x-atlassian-auth-types:
      - forge-oauth2
      - api-token
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/commit_comment'
        description: The specified comment.
        required: true
  /repositories/{workspace}/{repo_slug}/commit/{commit}/comments/{comment_id}:
    parameters:
    - name: comment_id
      in: path
      description: The id of the comment.
      required: true
      schema:
        type: integer
        format: int64
    - name: commit
      in: path
      description: The commit's SHA1.
      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:
      - Commits
      description: 'Deletes the specified commit comment.


        Note that deleting comments that have visible replies that point to

        them will not really delete the resource. This is to retain the integrity

        of the original comment tree. Instead, the `deleted` element is set to

        `true` and the content is blanked out. The comment will continue to be

        returned by the collections and self endpoints.'
      summary: Delete a commit comment
      responses:
        '204':
          description: Indicates the comment was deleted by this action or a previous delete.
        '404':
          description: If the comment doesn't exist
      security:
      - oauth2:
        - repository
      - basic: []
      - api_key: []
      x-atlassian-oauth2-scopes:
      - state: Current
        scheme: oauth2
        scopes:
        - read:repository:bitbucket
      x-atlassian-auth-types:
      - forge-oauth2
      - api-token
    get:
      tags:
      - Commits
      description: Returns the specified commit comment.
      summary: Get a commit comment
      responses:
        '200':
          description: The commit comment.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/commit_comment'
      security:
      - oauth2:
        - repository
      - basic: []
      - api_key: []
      x-atlassian-oauth2-scopes:
      - state: Current
        scheme: oauth2
        scopes:
        - read:repository:bitbucket
      x-atlassian-auth-types:
      - forge-oauth2
      - api-token
    put:
      tags:
      - Commits
      description: "Used to update the contents of a comment. Only the content of the comment can be updated.\n\n```\n$ curl https://api.bitbucket.org/2.0/repositories/atlassian/prlinks/commit/7f71b5/comments/5728901 \\\n  -X PUT -u evzijst \\\n  -H 'Content-Type: application/json' \\\n  -d '{\"content\": {\"raw\": \"One more thing!\"}'\n```"
      summary: Update a commit comment
      responses:
        '201':
          description: The newly updated comment.
          headers:
            Location:
              description: The location of the newly updated comment.
              schema:
                type: string
        '400':
          description: If the comment update was detected as spam
      security:
      - oauth2:
        - repository
      - basic: []
      - api_key: []
      x-atlassian-oauth2-scopes:
      - state: Current
        scheme: oauth2
        scopes:
        - read:repository:bitbucket
      x-atlassian-auth-types:
      - forge-oauth2
      - api-token
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/commit_comment'
        description: The updated comment.
        required: true
  /repositories/{workspace}/{repo_slug}/commit/{commit}/reports:
    get:
      tags:
      - Commits
      description: Returns a paginated list of Reports linked to this commit.
      summary: List reports
      operationId: getReportsForCommit
      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: commit
        description: The commit for which to retrieve reports.
        required: true
        in: path
        schema:
          type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/paginated_reports'
      security:
      - oauth2:
        - repository
      - basic: []
      - api_key: []
      x-atlassian-oauth2-scopes:
      - state: Current
        scheme: oauth2
        scopes:
        - read:repository:bitbucket
      x-atlassian-auth-types:
      - forge-oauth2
      - api-token
  /repositories/{workspace}/{repo_slug}/commit/{commit}/reports/{reportId}:
    put:
      tags:
      - Commits
      description: "Creates or updates a report for the specified commit.\nTo upload a report, make sure to generate an ID that is unique across all reports for that commit. If you want to use an existing id from your own system, we recommend prefixing it with your system's name to avoid collisions, for example, mySystem-001.\n\n### Sample cURL request:\n```\ncurl --request PUT 'https://api.bitbucket.org/2.0/repositories/<username>/<reposity-name>/commit/<commit-hash>/reports/mysystem-001' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n    \"title\": \"Security scan report\",\n    \"details\": \"This pull request introduces 10 new dependency vulnerabilities.\",\n    \"report_type\": \"SECURITY\",\n    \"reporter\": \"mySystem\",\n    \"link\": \"http://www.mysystem.com/reports/001\",\n    \"result\": \"FAILED\",\n    \"data\": [\n        {\n            \"title\": \"Duration (seconds)\",\n            \"type\": \"DURATION\",\n            \"value\": 14\n        },\n        {\n            \"title\": \"Safe to merge?\",\n            \"type\": \"BOOLEAN\",\n            \"value\": false\n        }\n    ]\n}'\n```\n\n### Possible field values:\nreport_type: SECURITY, COVERAGE, TEST, BUG\nresult: PASSED, FAILED, PENDING\ndata.type: BOOLEAN, DATE, DURATION, LINK, NUMBER, PERCENTAGE, TEXT\n\n#### Data field formats\n| Type  Field   | Value Field Type  | Value Field Display |\n|:--------------|:------------------|:--------------------|\n| None/ Omitted | Number, String or Boolean (not an array or object) | Plain text |\n| BOOLEAN\t| Boolean | The value will be read as a JSON boolean and displayed as 'Yes' or 'No'. |\n| DATE  | Number | The value will be read as a JSON number in the form of a Unix timestamp (milliseconds) and will be displayed as a relative date if the date is less than one week ago, otherwise  it will be displayed as an absolute date. |\n| DURATION | Number | The value will be read as a JSON number in milliseconds and will be displayed in a human readable duration format. |\n| LINK | Object: `{\"text\": \"Link text here\", \"href\": \"https://link.to.annotation/in/external/tool\"}` | The value will be read as a JSON object containing the fields \"text\" and \"href\" and will be displayed as a clickable link on the report. |\n| NUMBER | Number | The value will be read as a JSON number and large numbers will be  displayed in a human readable format (e.g. 14.3k). |\n| PERCENTAGE | Number (between 0 and 100) | The value will be read as a JSON number between 0 and 100 and will be displayed with a percentage sign. |\n| TEXT | String | The value will be read as a JSON string and will be displayed as-is |\n\nPlease refer to the [Code Insights documentation](https://confluence.atlassian.com/bitbucket/code-insights-994316785.html) for more information.\n"
      operationId: createOrUpdateReport
      summary: Create or update a report
      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: commit
        description: The commit the report belongs to.
        required: true
        in: path
        schema:
          type: string
      - name: reportId
        description: Either the uuid or external-id of the report.
        required: true
        in: path
        schema:
          type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/report'
        '400':
          description: The provided Report object is malformed or incomplete.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
      security:
      - oauth2:
        - repository
      - basic: []
      - api_key: []
      x-atlassian-oauth2-scopes:
      - state: Current
        scheme: oauth2
        scopes:
        - read:repository:bitbucket
      x-atlassian-auth-types:
      - forge-oauth2
      - api-token
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/report'
        description: The report to create or update
        required: true
    get:
      tags:
      - Commits
      description: Returns a single Report matching the provided ID.
      summary: Get a report
      operationId: getReport
      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: commit
        description: The commit the report belongs to.
        required: true
        in: path
        schema:
          type: string
      - name: reportId
        description: Either the uuid or external-id of the report.
        required: true
        in: path
        schema:
          type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/report'
        '404':
          description: The report with the given ID was not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
      security:
      - oauth2:
        - repository
      - basic: []
      - api_key: []
      x-atlassian-oauth2-scopes:
      - state: Current
        scheme: oauth2
        scopes:
        - read:repository:bitbucket
      x-atlassian-auth-types:
      - forge-oauth2
      - api-token
    delete:
      tags:
      - Commits
      description: Deletes a single Report matching the provided ID.
      summary: Delete a report
      operationId: deleteReport
      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: commit
        description: The commit the report belongs to.
        required: true
        in: path
        schema:
          type: string
      - name: reportId
        description: Either the uuid or external-id of the report.
        required: true
        in: path
        schema:
          type: string
      responses:
        '204':
          description: No content
      security:
      - oauth2:
        - repository
      - basic: []
      - api_key: []
      x-atlassian-oauth2-scopes:
      - state: Current
        scheme: oauth2
        scopes:
        - read:repository:bitbucket
      x-atlassian-auth-types:
      - forge-oauth2
      - api-token
  /repositories/{workspace}/{repo_slug}/commit/{commit}/reports/{reportId}/annotations:
    get:
      tags:
      - Commits
      description: Returns a paginated list of Annotations for a specified report.
      summary: List annotations
      operationId: getAnnotationsForReport
      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: commit
        description: The commit for which to retrieve reports.
        required: true
        in: path
        schema:
          type: string
      - name: reportId
        description: Uuid or external-if of the report for which to get annotations for.
        required: true
        in: path
        schema:
          type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/paginated_annotations'
      security:
      - oauth2:
        - repository
      - basic: []
      - api_key: []
      x-atlassian-oauth2-scopes:
      - state: Current
        scheme: oauth2
        scopes:
        - read:repository:bitbucket
      x-atlassian-auth-types:
      - forge-oauth2
      - api-token
    post:
      tags:
      - Commits
      description: "Bulk upload of annotations.\nAnnotations are individual findings that have been identified as part of a report, for example, a line of code that represents a vulnerability. These annotations can be attached to a specific file and even a specific line in that file, however, that is optional. Annotations are not mandatory and a report can contain up to 1000 annotations.\n\nAdd the annotations you want to upload as objects in a JSON array and make sure each annotation has the external_id field set to a unique value. If you want to use an existing id from your own system, we recommend prefixing it with your system's name to avoid collisions, for example, mySystem-annotation001. The external id can later be used to identify the report as an alternative to the generated [UUID](https://developer.atlassian.com/bitbucket/api/2/reference/meta/uri-uuid#uuid). You can upload up to 100 annotations per POST request.\n\n### Sample cURL request:\n```\ncurl --location 'https://api.bitbucket.org/2.0/repositories/<username>/<reposity-name>/commit/<commit-hash>/reports/mysystem-001/annotations' \\\n--header 'Content-Type: application/json' \\\n--data-raw '[\n  {\n        \"external_id\": \"mysystem-annotation001\",\n        \"title\": \"Security scan report\",\n        \"annotation_type\": \"VULNERABILITY\",\n        \"summary\": \"This line represents a security threat.\",\n        \"severity\": \"HIGH\",\n      \"path\": \"my-service/src/main/java/com/myCompany/mysystem/logic/Main.java\",\n        \"line\": 42\n  },\n  {\n        \"external_id\": \"mySystem-annotation002\",\n        \"title\": \"Bug report\",\n        \"annotation_type\": \"BUG\",\n        \"result\": \"FAILED\",\n        \"summary\": \"This line might introduce a bug.\",\n        \"severity\": \"MEDIUM\",\n      \"path\": \"my-service/src/main/java/com/myCompany/mysystem/logic/Helper.java\",\n        \"line\": 13\n  }\n]'\n```\n\n### Possible field values:\nannotation_type: VULNERABILITY, CODE_SMELL, BUG\nresult: PASSED, FAILED, IGNORED, SKIPPED\nseverity: HIGH, MEDIUM, LOW, CRITICAL\n\nPlease refer to the [Code Insights documentation](https://confluence.atlassian.com/bitbucket/code-insights-994316785.html) for more information.\n"
      operationId: bulkCreateOrUpdateAnnotations
      summary: Bulk create or update annotations
      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: commit
        description: The commit for which to retrieve reports.
        required: true
        in: path
        schema:
          type: string
      - name: reportId
        description: Uuid or external-if of the report for which to get annotations for.
        required: true
        in: path
        schema:
          type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/report_annotation'
      security:
      - oauth2:
        - repository
      - basic: []
      - api_key: []
      x-atlassian-oauth2-scopes:
      - state: Current
        scheme: oauth2
        scopes:
        - read:repository:bitbucket
      x-atlassian-auth-types:
      - forge-oauth2
      - api-token
      requestBody:
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/report_annotation'
              minItems: 1
              maxItems: 100
        description: The annotations to create or update
        required: true
  /repositories/{workspace}/{repo_slug}/commit/{commit}/reports/{reportId}/annotations/{annotationId}:
    get:
      tags:
      - Commits
      description: Returns a single Annotation matching the provided ID.
      summary: Get an annotation
      operationId: getAnnotation
      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: commit
        description: The commit the report belongs to.
        required: true
        in: path
        schema:
          type: string
      - name: reportId
        description: Either the uuid or external-id of the report.
        required: true
        in: path
        schema:
          type: string
      - name: annotationId
        description: Either the uuid or external-id of the annotation.
        required: true
        in: path
        schema:
          type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/report_annotation'
        '404':
          description: The annotation with the given ID was not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
      security:
      - oauth2:
        - repository
      - basic: []
      - api_key: []
      x-atlassian-oauth2-scopes:
      - state: Current
        scheme: oauth2
        scopes:
        - read:repository:bitbucket
      x-atlassian-auth-types:
      - forge-oauth2
      - api-token
    put:
      tags:
      - Commits
      description: "Creates or updates an individual annotation for the specified report.\nAnnotations are ind

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