Stores a build status for this commit via the modern builds API.
POST /rest/api/latest/projects/{key}/repos/{slug}/commits/{id}/builds
This is the modern replacement for CommitResource.addBuildStatus.
Build state, key, url and optional metadata
Posts a build status for this commit.
POST /rest/build-status/latest/commits/{id}
Build state, key, url and optional metadata
The created build status
Posts a comment on this commit.
POST /rest/api/latest/projects/{key}/repos/{slug}/commits/{id}/comments
Comment text and optional anchor/parent
The created comment
Creates or updates a deployment for this commit.
POST /rest/api/latest/projects/{key}/repos/{slug}/commits/{id}/deployments
Deployment details: key, environment, state, url, displayName,
description, deploymentSequenceNumber
The created or updated deployment
Adds annotations to a Code Insights report in bulk.
POST /rest/insights/latest/projects/{key}/repos/{slug}/commits/{id}/reports/{key}/annotations
The report's key
The annotations to add (at least one)
Fetches the build statuses associated with this commit.
GET /rest/build-status/latest/commits/{id}
Optionalparams: BuildStatusesParamsOptional filters: limit, start, key
A paged response of build statuses
Fetches the file changes introduced by this commit.
GET /rest/api/latest/projects/{key}/repos/{slug}/commits/{id}/changes
Optionalparams: CommitChangesParamsOptional filters: limit, start, since
A paged response of file changes
Fetches the comments on this commit.
GET /rest/api/latest/projects/{key}/repos/{slug}/commits/{id}/comments
Optionalparams: PaginationParamsOptional pagination: limit, start
A paged response of comments
Deletes a build status from this commit, identified by its build key.
DELETE /rest/api/latest/projects/{key}/repos/{slug}/commits/{id}/builds?key={key}
The build key to delete
Deletes a comment from this commit.
DELETE /rest/api/latest/projects/{key}/repos/{slug}/commits/{id}/comments/{commentId}
The comment id
Must match the comment's current version
Deletes a deployment from this commit, identified by key, environment, and sequence number.
DELETE /rest/api/latest/projects/{key}/repos/{slug}/commits/{id}/deployments
deploymentSequenceNumber, key, and environmentKey — together identify one deployment
Deletes annotations from a Code Insights report: a single one when
externalId is given, or all of the report's annotations when omitted.
DELETE /rest/insights/latest/projects/{key}/repos/{slug}/commits/{id}/reports/{key}/annotations[?externalId={externalId}]
The report's key
OptionalexternalId: stringExternal id of the annotation to delete; omit to delete all
Deletes a Code Insights report (and its annotations) from this commit.
DELETE /rest/insights/latest/projects/{key}/repos/{slug}/commits/{id}/reports/{key}
The report's key
Fetches the full diff for this commit.
GET /rest/api/latest/projects/{key}/repos/{slug}/commits/{id}/diff/{path}
The path param (the file to diff) is optional: when omitted, the diff for
the whole commit is returned. srcPath is sent as a query parameter and
identifies the previous path of a copied, moved or renamed file.
Optionalparams: DiffParamsOptional: path, contextLines, srcPath, since, whitespace
The diff object
Fetches a summary of added/removed/modified line counts for a file changed by this commit.
GET /rest/api/latest/projects/{key}/repos/{slug}/commits/{id}/diff-stats-summary/{path}
Path to the file
The diff stats summary
Fetches the commit details.
GET /rest/api/latest/projects/{key}/repos/{slug}/commits/{id}
The commit object
Fetches a single build status for this commit, identified by its build key.
GET /rest/api/latest/projects/{key}/repos/{slug}/commits/{id}/builds?key={key}
This is the modern replacement for CommitResource.buildStatuses; unlike it, this endpoint returns a single build rather than a paged list.
The build key to look up
The build status matching the given key
Fetches a single deployment for this commit, identified by key, environment, and sequence number.
GET /rest/api/latest/projects/{key}/repos/{slug}/commits/{id}/deployments
deploymentSequenceNumber, key, and environmentKey — together identify one deployment
The matching deployment
Fetches Code Insights annotations across all of this commit's reports.
GET /rest/insights/latest/projects/{key}/repos/{slug}/commits/{id}/annotations
Optionalparams: CommitAnnotationsParamsOptional filters: key, externalId, path, severity, type
The matching annotations (not paged)
Fetches a single Code Insights report by key.
GET /rest/insights/latest/projects/{key}/repos/{slug}/commits/{id}/reports/{key}
The report's key
The report
Fetches the annotations belonging to one Code Insights report.
GET /rest/insights/latest/projects/{key}/repos/{slug}/commits/{id}/reports/{key}/annotations
The report's key
The report's annotations (not paged)
Fetches the Code Insights reports attached to this commit.
GET /rest/insights/latest/projects/{key}/repos/{slug}/commits/{id}/reports
Optionalparams: PaginationParamsOptional pagination: limit, start
A paged response of reports
Fetches the best common ancestor between this commit and another.
GET /rest/api/latest/projects/{key}/repos/{slug}/commits/{id}/merge-base/{otherCommitId}
SHA of the commit to compare against
The merge-base commit
Fetches the pull requests that contain this commit.
GET /rest/api/latest/projects/{key}/repos/{slug}/commits/{id}/pull-requests
Optionalparams: CommitPullRequestsParamsOptional filters: limit, start, withAttributes, withProperties
A paged response of pull requests
Creates or replaces a single Code Insights annotation, identified by its external id.
PUT /rest/insights/latest/projects/{key}/repos/{slug}/commits/{id}/reports/{key}/annotations/{externalId}
The report's key
The annotation's external id (assigned by the caller)
The annotation's message, severity, and optional fields
Creates or replaces a Code Insights report on this commit.
PUT /rest/insights/latest/projects/{key}/repos/{slug}/commits/{id}/reports/{key}
The report's key (assigned by the caller; replaces any existing report with the same key)
title and data (at most 6 items), plus optional details,
result, reporter, link, logoUrl, createdDate, coverageProviderKey
The stored report
Allows the resource to be awaited directly, resolving with the commit info. Delegates to CommitResource.get.
Optionalonfulfilled: ((value: BitbucketCommit) => TResult1 | PromiseLike<TResult1>) | nullOptionalonrejected: ((reason: unknown) => TResult2 | PromiseLike<TResult2>) | nullRemoves the authenticated user as a watcher of this commit.
DELETE /rest/api/latest/projects/{key}/repos/{slug}/commits/{id}/watch
Updates a comment on this commit.
PUT /rest/api/latest/projects/{key}/repos/{slug}/commits/{id}/comments/{commentId}
The comment id
version (must match the comment's current version) and the new text
The updated comment
Adds the authenticated user as a watcher of this commit.
POST /rest/api/latest/projects/{key}/repos/{slug}/commits/{id}/watch
Represents a Bitbucket commit resource with chainable async methods.
Implements
PromiseLike<BitbucketCommit>so it can be awaited directly to fetch the commit info, while also exposing sub-resource methods.Example