Skip to content

List annotations

GET
/repositories/{workspace}/{repo_slug}/commit/{commit}/reports/{reportId}/annotations

Returns a paginated list of Annotations for a specified report.

workspace
required
string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example {workspace UUID}.

repo_slug
required
string

The repository.

commit
required
string

The commit for which to retrieve reports.

reportId
required
string

Uuid or external-if of the report for which to get annotations for.

OK

Media type application/json
Paginated Annotations

A paginated list of annotations.

object
page

Page number of the current results. This is an optional element that is not provided in all responses.

integer
values

The values of the current page.

Array
0
object
type
required
string
external_id

ID of the annotation provided by the annotation creator. It can be used to identify the annotation as an alternative to it’s generated uuid. It is not used by Bitbucket, but only by the annotation creator for updating or deleting this specific annotation. Needs to be unique.

string
uuid

The UUID that can be used to identify the annotation.

string
annotation_type

The type of the report.

string
Allowed values: VULNERABILITY CODE_SMELL BUG
path

The path of the file on which this annotation should be placed. This is the path of the file relative to the git repository. If no path is provided, then it will appear in the overview modal on all pull requests where the tip of the branch is the given commit, regardless of which files were modified.

string
line

The line number that the annotation should belong to. If no line number is provided, then it will default to 0 and in a pull request it will appear at the top of the file specified by the path field.

integer
>= 1
summary

The message to display to users.

string
details

The details to show to users when clicking on the annotation.

string
result

The state of the report. May be set to PENDING and later updated.

string
Allowed values: PASSED FAILED SKIPPED IGNORED
severity

The severity of the annotation.

string
Allowed values: CRITICAL HIGH MEDIUM LOW
link

A URL linking to the annotation in an external tool.

string format: uri
created_on

The timestamp when the report was created.

string format: date-time
updated_on

The timestamp when the report was updated.

string format: date-time
size

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.

integer
pagelen

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.

integer
next

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.

string format: uri
previous

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.

string format: uri
Example
{
"values": [
{
"annotation_type": "VULNERABILITY",
"result": "PASSED",
"severity": "CRITICAL"
}
]
}