Rate this page:
Commit statuses provide a way to tag commits with meta data, like automated build results.
GET /2.0/repositories/{workspace}/{repo_slug}/commit/{commit}/statuses
Returns all statuses (e.g. build results) for a specific commit.
repository
string
The commit's SHA1.
string
This can either be the repository slug or the UUID of the repository,
surrounded by curly-braces, for example: {repository UUID}
.
string
This can either be the workspace ID (slug) or the workspace UUID
surrounded by curly-braces, for example: {workspace UUID}
.
string
Query string to narrow down the response as per filtering and sorting.
string
Field by which the results should be sorted as per
filtering and sorting.
Defaults to created_on
.
1 2 3 4
curl --request GET \
--url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/commit/{commit}/statuses' \
--header 'Authorization: Bearer <access_token>' \
--header 'Accept: application/json'
A paginated list of all commit statuses for this commit.
Content type | Value |
---|---|
application/json |
POST /2.0/repositories/{workspace}/{repo_slug}/commit/{commit}/statuses/build
Creates a new build status against the specified commit.
If the specified key already exists, the existing status object will be overwritten.
Example:
1 2curl https://api.bitbucket.org/2.0/repositories/my-workspace/my-repo/commit/e10dae226959c2194f2b07b077c07762d93821cf/statuses/build/ -X POST -u jdoe -H 'Content-Type: application/json' -d '{ "key": "MY-BUILD", "state": "SUCCESSFUL", "description": "42 tests passed", "url": "https://www.example.org/my-build-result" }'
When creating a new commit status, you can use a URI template for the URL.
Templates are URLs that contain variable names that Bitbucket will
evaluate at runtime whenever the URL is displayed anywhere similar to
parameter substitution in
Bitbucket Connect.
For example, one could use https://foo.com/builds/{repository.full_name}
which Bitbucket will turn into https://foo.com/builds/foo/bar
at render time.
The context variables available are repository
and commit
.
repository
string
The commit's SHA1.
string
This can either be the repository slug or the UUID of the repository,
surrounded by curly-braces, for example: {repository UUID}
.
string
This can either be the workspace ID (slug) or the workspace UUID
surrounded by curly-braces, for example: {workspace UUID}
.
Content type | Value |
---|---|
application/json | allOf [object, Commit Status] |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
curl --request POST \
--url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/commit/{commit}/statuses/build' \
--header 'Authorization: Bearer <access_token>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"type": "<string>",
"links": {
"self": {
"href": "<string>",
"name": "<string>"
},
"commit": {
"href": "<string>",
"name": "<string>"
}
},
"uuid": "<string>",
"key": "<string>",
"refname": "<string>",
"url": "<string>",
"state": "FAILED",
"name": "<string>",
"description": "<string>",
"created_on": "<string>",
"updated_on": "<string>"
}'