• Addon
  • Branch restrictions
  • Branching model
  • Commit statuses
  • Commits
  • Deployments
  • Downloads
  • Issue tracker
  • Pipelines
  • Projects
  • Pullrequests
  • Refs
  • Reports
  • Repositories
  • Snippets
  • Source
  • Ssh
  • Users
  • Webhooks
  • Workspaces
  • Other operations
Cloud
Bitbucket Cloud / Reference / REST APIs

Commit statuses

Postman Collection
OpenAPI
GET

List commit statuses for a commit

Returns all statuses (e.g. build results) for a specific commit.

Scopes
repository
read:repository:bitbucket

Request

Path parameters

commit

string

Required
repo_slug

string

Required
workspace

string

Required

Query parameters

q

string

sort

string

Responses

A paginated list of all commit statuses for this commit.

application/json

Paginated Commit Statuses

A paginated list of commit status objects.

GET/repositories/{workspace}/{repo_slug}/commit/{commit}/statuses
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'
200Response
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 28 29 30 31 { "size": 142, "page": 102, "pagelen": 159, "next": "<string>", "previous": "<string>", "values": [ { "type": "<string>", "links": { "self": { "href": "<string>", "name": "<string>" }, "commit": { "href": "<string>", "name": "<string>" } }, "uuid": "<string>", "key": "<string>", "refname": "<string>", "url": "<string>", "state": "INPROGRESS", "name": "<string>", "description": "<string>", "created_on": "<string>", "updated_on": "<string>" } ] }
POST

Create a build status for a commit

Creates a new build status against the specified commit.

If the specified key already exists, the existing status object will be overwritten.

Example:

1 2 3 4 5 6 curl 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.

Scopes
repository
read:repository:bitbucket

Request

Path parameters

commit

string

Required
repo_slug

string

Required
workspace

string

Required

Request bodyapplication/json

The new commit status object.

allOf [object, Commit Status]

object

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.

Commit Status

A commit status object.

Responses

The newly created build status object.

application/json

allOf [object, Commit Status]

object

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.

Commit Status

A commit status object.

POST/repositories/{workspace}/{repo_slug}/commit/{commit}/statuses/build
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": "INPROGRESS", "name": "<string>", "description": "<string>", "created_on": "<string>", "updated_on": "<string>" }'
201Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 { "type": "<string>", "links": { "self": { "href": "<string>", "name": "<string>" }, "commit": { "href": "<string>", "name": "<string>" } }, "uuid": "<string>", "key": "<string>", "refname": "<string>", "url": "<string>", "state": "INPROGRESS", "name": "<string>", "description": "<string>", "created_on": "<string>", "updated_on": "<string>" }
GET

Get a build status for a commit

Returns the specified build status for a commit.

Scopes
repository
read:repository:bitbucket

Request

Path parameters

commit

string

Required
key

string

Required
repo_slug

string

Required
workspace

string

Required

Responses

The build status object with the specified key.

application/json

allOf [object, Commit Status]

object

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.

Commit Status

A commit status object.

GET/repositories/{workspace}/{repo_slug}/commit/{commit}/statuses/build/{key}
1 2 3 4 curl --request GET \ --url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/commit/{commit}/statuses/build/{key}' \ --header 'Authorization: Bearer <access_token>' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 { "type": "<string>", "links": { "self": { "href": "<string>", "name": "<string>" }, "commit": { "href": "<string>", "name": "<string>" } }, "uuid": "<string>", "key": "<string>", "refname": "<string>", "url": "<string>", "state": "INPROGRESS", "name": "<string>", "description": "<string>", "created_on": "<string>", "updated_on": "<string>" }
PUT

Update a build status for a commit

Used to update the current status of a build status object on the specific commit.

This operation can also be used to change other properties of the build status:

  • state
  • name
  • description
  • url
  • refname

The key cannot be changed.

Scopes
repository
read:repository:bitbucket

Request

Path parameters

commit

string

Required
key

string

Required
repo_slug

string

Required
workspace

string

Required

Request bodyapplication/json

The updated build status object

allOf [object, Commit Status]

object

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.

Commit Status

A commit status object.

Responses

The updated build status object.

application/json

allOf [object, Commit Status]

object

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.

Commit Status

A commit status object.

PUT/repositories/{workspace}/{repo_slug}/commit/{commit}/statuses/build/{key}
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 PUT \ --url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/commit/{commit}/statuses/build/{key}' \ --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": "INPROGRESS", "name": "<string>", "description": "<string>", "created_on": "<string>", "updated_on": "<string>" }'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 { "type": "<string>", "links": { "self": { "href": "<string>", "name": "<string>" }, "commit": { "href": "<string>", "name": "<string>" } }, "uuid": "<string>", "key": "<string>", "refname": "<string>", "url": "<string>", "state": "INPROGRESS", "name": "<string>", "description": "<string>", "created_on": "<string>", "updated_on": "<string>" }

Rate this page: