• 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

Projects

Postman Collection
OpenAPI
POST

Create a project in a workspace

Creates a new project.

Note that the avatar has to be embedded as either a data-url or a URL to an external image as shown in the examples below:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 $ body=$(cat << EOF { "name": "Mars Project", "key": "MARS", "description": "Software for colonizing mars.", "links": { "avatar": { "href": "data:image/gif;base64,R0lGODlhEAAQAMQAAORHHOVSKudfOulrSOp3WOyDZu6QdvCchPGolfO0o/..." } }, "is_private": false } EOF ) $ curl -H "Content-Type: application/json" \ -X POST \ -d "$body" \ https://api.bitbucket.org/2.0/workspaces/teams-in-space/projects/ | jq . { // Serialized project document }

or even:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 $ body=$(cat << EOF { "name": "Mars Project", "key": "MARS", "description": "Software for colonizing mars.", "links": { "avatar": { "href": "http://i.imgur.com/72tRx4w.gif" } }, "is_private": false } EOF ) $ curl -H "Content-Type: application/json" \ -X POST \ -d "$body" \ https://api.bitbucket.org/2.0/workspaces/teams-in-space/projects/ | jq . { // Serialized project document }
Scopes
project:admin
admin:project:bitbucket

Request

Path parameters

workspace

string

Required

Request bodyapplication/json

allOf [object, Project]

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.

Project

A Bitbucket project. Projects are used by teams to organize repositories.

Responses

A new project has been created.

Headers

Location

string

application/json

allOf [object, Project]

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.

Project

A Bitbucket project. Projects are used by teams to organize repositories.

POST/workspaces/{workspace}/projects
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 curl --request POST \ --url 'https://api.bitbucket.org/2.0/workspaces/{workspace}/projects' \ --header 'Authorization: Bearer <access_token>' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "type": "<string>", "links": { "html": { "href": "<string>", "name": "<string>" }, "avatar": { "href": "<string>", "name": "<string>" } }, "uuid": "<string>", "key": "<string>", "owner": { "type": "<string>" }, "name": "<string>", "description": "<string>", "is_private": true, "created_on": "<string>", "updated_on": "<string>", "has_publicly_visible_repos": true }'
201Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 { "type": "<string>", "links": { "html": { "href": "<string>", "name": "<string>" }, "avatar": { "href": "<string>", "name": "<string>" } }, "uuid": "<string>", "key": "<string>", "owner": { "type": "<string>" }, "name": "<string>", "description": "<string>", "is_private": true, "created_on": "<string>", "updated_on": "<string>", "has_publicly_visible_repos": true }
GET

Get a project for a workspace

Returns the requested project.

Scopes
project
read:project:bitbucket

Request

Path parameters

project_key

string

Required
workspace

string

Required

Responses

The project that is part of a workspace.

application/json

allOf [object, Project]

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.

Project

A Bitbucket project. Projects are used by teams to organize repositories.

GET/workspaces/{workspace}/projects/{project_key}
1 2 3 4 curl --request GET \ --url 'https://api.bitbucket.org/2.0/workspaces/{workspace}/projects/{project_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 23 24 { "type": "<string>", "links": { "html": { "href": "<string>", "name": "<string>" }, "avatar": { "href": "<string>", "name": "<string>" } }, "uuid": "<string>", "key": "<string>", "owner": { "type": "<string>" }, "name": "<string>", "description": "<string>", "is_private": true, "created_on": "<string>", "updated_on": "<string>", "has_publicly_visible_repos": true }
PUT

Update a project for a workspace

Since this endpoint can be used to both update and to create a project, the request body depends on the intent.

Creation

See the POST documentation for the project collection for an example of the request body.

Note: The key should not be specified in the body of request (since it is already present in the URL). The name is required, everything else is optional.

Update

See the POST documentation for the project collection for an example of the request body.

Note: The key is not required in the body (since it is already in the URL). The key may be specified in the body, if the intent is to change the key itself. In such a scenario, the location of the project is changed and is returned in the Location header of the response.

Scopes
project:admin
admin:project:bitbucket

Request

Path parameters

project_key

string

Required
workspace

string

Required

Request bodyapplication/json

allOf [object, Project]

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.

Project

A Bitbucket project. Projects are used by teams to organize repositories.

Responses

The existing project is has been updated.

Headers

Location

string

application/json

allOf [object, Project]

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.

Project

A Bitbucket project. Projects are used by teams to organize repositories.

PUT/workspaces/{workspace}/projects/{project_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 28 29 curl --request PUT \ --url 'https://api.bitbucket.org/2.0/workspaces/{workspace}/projects/{project_key}' \ --header 'Authorization: Bearer <access_token>' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "type": "<string>", "links": { "html": { "href": "<string>", "name": "<string>" }, "avatar": { "href": "<string>", "name": "<string>" } }, "uuid": "<string>", "key": "<string>", "owner": { "type": "<string>" }, "name": "<string>", "description": "<string>", "is_private": true, "created_on": "<string>", "updated_on": "<string>", "has_publicly_visible_repos": true }'
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 { "type": "<string>", "links": { "html": { "href": "<string>", "name": "<string>" }, "avatar": { "href": "<string>", "name": "<string>" } }, "uuid": "<string>", "key": "<string>", "owner": { "type": "<string>" }, "name": "<string>", "description": "<string>", "is_private": true, "created_on": "<string>", "updated_on": "<string>", "has_publicly_visible_repos": true }
DEL

Delete a project for a workspace

Deletes this project. This is an irreversible operation.

You cannot delete a project that still contains repositories. To delete the project, delete or transfer the repositories first.

Example:

1 $ curl -X DELETE https://api.bitbucket.org/2.0/workspaces/bbworkspace1/projects/PROJ
Scopes
project:admin
admin:project:bitbucket

Request

Path parameters

project_key

string

Required
workspace

string

Required

Responses

Successful deletion.

DEL/workspaces/{workspace}/projects/{project_key}
1 2 3 curl --request DELETE \ --url 'https://api.bitbucket.org/2.0/workspaces/{workspace}/projects/{project_key}' \ --header 'Authorization: Bearer <access_token>'
GET

List the default reviewers in a project

Return a list of all default reviewers for a project. This is a list of users that will be added as default reviewers to pull requests for any repository within the project.

Scopes
project:admin
read:pullrequest:bitbucket

Request

Path parameters

project_key

string

Required
workspace

string

Required

Responses

The list of project default reviewers

application/json

Paginated Default Reviewer and Type

A paginated list of default reviewers with reviewer type.

GET/workspaces/{workspace}/projects/{project_key}/default-reviewers
1 2 3 4 curl --request GET \ --url 'https://api.bitbucket.org/2.0/workspaces/{workspace}/projects/{project_key}/default-reviewers' \ --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 { "pagelen": 10, "values": [ { "user": { "display_name": "Davis Lee", "uuid": "{f0e0e8e9-66c1-4b85-a784-44a9eb9ef1a6}" }, "reviewer_type": "project", "type": "default_reviewer" }, { "user": { "display_name": "Jorge Rodriguez", "uuid": "{1aa43376-260d-4a0b-9660-f62672b9655d}" }, "reviewer_type": "project", "type": "default_reviewer" } ], "page": 1, "size": 2 }
GET

Get a default reviewer

Returns the specified default reviewer.

Scopes
project:admin
read:pullrequest:bitbucket

Request

Path parameters

project_key

string

Required
selected_user

string

Required
workspace

string

Required

Responses

The specified user that is a default reviewer

application/json

allOf [allOf [object, Account], User]

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.

Account

An account object.

User

A user object.

GET/workspaces/{workspace}/projects/{project_key}/default-reviewers/{selected_user}
1 2 3 4 curl --request GET \ --url 'https://api.bitbucket.org/2.0/workspaces/{workspace}/projects/{project_key}/default-reviewers/{selected_user}' \ --header 'Authorization: Bearer <access_token>' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 { "display_name": "Davis Lee", "type": "user", "uuid": "{f0e0e8e9-66c1-4b85-a784-44a9eb9ef1a6}" }
PUT

Add the specific user as a default reviewer for the project

Adds the specified user to the project's list of default reviewers. The method is idempotent. Accepts an optional body containing the uuid of the user to be added.

Scopes
project:admin
admin:project:bitbucket

Request

Path parameters

project_key

string

Required
selected_user

string

Required
workspace

string

Required

Responses

The specified user was added as a project default reviewer

application/json

allOf [allOf [object, Account], User]

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.

Account

An account object.

User

A user object.

PUT/workspaces/{workspace}/projects/{project_key}/default-reviewers/{selected_user}
1 2 3 4 curl --request PUT \ --url 'https://api.bitbucket.org/2.0/workspaces/{workspace}/projects/{project_key}/default-reviewers/{selected_user}' \ --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 { "display_name": "Yaniv Sagy", "links": { "self": { "href": "https://api.bitbucket.org/2.0/users/%7Bdd5db7f2-6389-458d-a62a-716773910b7a%7D" }, "avatar": { "href": "https://secure.gravatar.com/avatar/YS-2.png" }, "html": { "href": "https://api.bitbucket.org/%7Bdd5db7f2-6389-458d-a62a-716773910b7a%7D/" } }, "type": "user", "uuid": "{dd5db7f2-6389-458d-a62a-716773910b7a}", "account_id": "712020:4efe52fa-b4b4-475b-9eb0-c0a23b7eb194", "nickname": "Yaniv Sagy" }
DEL

Remove the specific user from the project's default reviewers

Removes a default reviewer from the project.

Example:

1 2 3 $ curl https://api.bitbucket.org/2.0/.../default-reviewers/%7Bf0e0e8e9-66c1-4b85-a784-44a9eb9ef1a6%7D HTTP/1.1 204
Scopes
project:admin
admin:project:bitbucket

Request

Path parameters

project_key

string

Required
selected_user

string

Required
workspace

string

Required

Responses

The specified user was removed from the list of project default reviewers

DEL/workspaces/{workspace}/projects/{project_key}/default-reviewers/{selected_user}
1 2 3 curl --request DELETE \ --url 'https://api.bitbucket.org/2.0/workspaces/{workspace}/projects/{project_key}/default-reviewers/{selected_user}' \ --header 'Authorization: Bearer <access_token>'
GET

List explicit group permissions for a project

Returns a paginated list of explicit group permissions for the given project. This endpoint does not support BBQL features.

Scopes
project:admin
read:project:bitbucket, read:user:bitbucket

Request

Path parameters

project_key

string

Required
workspace

string

Required

Responses

Paginated list of project group permissions

application/json

Paginated Project Group Permissions

A paginated list of project group permissions.

GET/workspaces/{workspace}/projects/{project_key}/permissions-config/groups
1 2 3 4 curl --request GET \ --url 'https://api.bitbucket.org/2.0/workspaces/{workspace}/projects/{project_key}/permissions-config/groups' \ --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 32 33 34 35 { "pagelen": 10, "values": [ { "type": "project_group_permission", "group": { "type": "group", "name": "Administrators", "slug": "administrators" }, "permission": "admin", "links": { "self": { "href": "https://api.bitbucket.org/2.0/workspaces/atlassian_tutorial/projects/PRJ/permissions-config/groups/557058:ba8948b2-49da-43a9-9e8b-e7249b8e324a" } } }, { "type": "project_group_permission", "group": { "type": "group", "name": "Developers", "slug": "developers" }, "permission": "write", "links": { "self": { "href": "https://api.bitbucket.org/2.0/workspaces/atlassian_tutorial/projects/PRJ/permissions-config/groups/557058:ba8948b2-49da-43a9-9e8b-e7249b8e324c" } } } ], "page": 1, "size": 2 }
GET

Get an explicit group permission for a project

Returns the group permission for a given group and project.

Only users with admin permission for the project may access this resource.

Permissions can be:

  • admin
  • create-repo
  • write
  • read
  • none
Scopes
project:admin
read:project:bitbucket, read:user:bitbucket

Request

Path parameters

group_slug

string

Required
project_key

string

Required
workspace

string

Required

Responses

Project group permission

application/json

Project Group Permission

A group's permission for a given project.

GET/workspaces/{workspace}/projects/{project_key}/permissions-config/groups/{group_slug}
1 2 3 4 curl --request GET \ --url 'https://api.bitbucket.org/2.0/workspaces/{workspace}/projects/{project_key}/permissions-config/groups/{group_slug}' \ --header 'Authorization: Bearer <access_token>' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 { "type": "project_group_permission", "group": { "type": "group", "name": "Administrators", "slug": "administrators" }, "permission": "admin", "links": { "self": { "href": "https://api.bitbucket.org/2.0/workspaces/atlassian_tutorial/projects/PRJ/permissions-config/groups/administrators" } } }
PUT

Update an explicit group permission for a project

Updates the group permission, or grants a new permission if one does not already exist.

Only users with admin permission for the project may access this resource.

Due to security concerns, the JWT and OAuth authentication methods are unsupported. This is to ensure integrations and add-ons are not allowed to change permissions.

Permissions can be:

  • admin
  • create-repo
  • write
  • read
project:admin

Request

Path parameters

group_slug

string

Required
project_key

string

Required
workspace

string

Required

Request bodyapplication/json

The permission to grant

permission

string

Required

Responses

Project group permission updated.

application/json

Project Group Permission

A group's permission for a given project.

PUT/workspaces/{workspace}/projects/{project_key}/permissions-config/groups/{group_slug}
1 2 3 4 5 6 7 8 curl --request PUT \ --url 'https://api.bitbucket.org/2.0/workspaces/{workspace}/projects/{project_key}/permissions-config/groups/{group_slug}' \ --header 'Authorization: Bearer <access_token>' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "permission": "read" }'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 { "type": "project_group_permission", "group": { "type": "group", "name": "Administrators", "slug": "administrators" }, "permission": "write", "links": { "self": { "href": "https://api.bitbucket.org/2.0/workspaces/atlassian_tutorial/projects/PRJ/permissions-config/groups/administrators" } } }
DEL

Delete an explicit group permission for a project

Deletes the project group permission between the requested project and group, if one exists. Only users with admin permission for the project may access this resource.

project:admin

Request

Path parameters

group_slug

string

Required
project_key

string

Required
workspace

string

Required

Responses

The project group permission was deleted and no content returned.

DEL/workspaces/{workspace}/projects/{project_key}/permissions-config/groups/{group_slug}
1 2 3 curl --request DELETE \ --url 'https://api.bitbucket.org/2.0/workspaces/{workspace}/projects/{project_key}/permissions-config/groups/{group_slug}' \ --header 'Authorization: Bearer <access_token>'
GET

List explicit user permissions for a project

Returns a paginated list of explicit user permissions for the given project. This endpoint does not support BBQL features.

Scopes
project:admin
read:project:bitbucket, read:user:bitbucket

Request

Path parameters

project_key

string

Required
workspace

string

Required

Responses

Paginated list of explicit user permissions.

application/json

Paginated Project User Permissions

A paginated list of project user permissions.

GET/workspaces/{workspace}/projects/{project_key}/permissions-config/users
1 2 3 4 curl --request GET \ --url 'https://api.bitbucket.org/2.0/workspaces/{workspace}/projects/{project_key}/permissions-config/users' \ --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 32 33 34 35 36 37 { "pagelen": 10, "values": [ { "type": "project_user_permission", "user": { "type": "user", "display_name": "Colin Cameron", "uuid": "{d301aafa-d676-4ee0-88be-962be7417567}", "account_id": "557058:ba8948b2-49da-43a9-9e8b-e7249b8e324a" }, "permission": "admin", "links": { "self": { "href": "https://api.bitbucket.org/2.0/workspaces/atlassian_tutorial/projects/PRJ/permissions-config/users/557058:ba8948b2-49da-43a9-9e8b-e7249b8e324a" } } }, { "type": "project_user_permission", "user": { "type": "user", "display_name": "Sean Conaty", "uuid": "{504c3b62-8120-4f0c-a7bc-87800b9d6f70}", "account_id": "557058:ba8948b2-49da-43a9-9e8b-e7249b8e324c" }, "permission": "write", "links": { "self": { "href": "https://api.bitbucket.org/2.0/workspaces/atlassian_tutorial/projects/PRJ/permissions-config/users/557058:ba8948b2-49da-43a9-9e8b-e7249b8e324c" } } } ], "page": 1, "size": 2 }
GET

Get an explicit user permission for a project

Returns the explicit user permission for a given user and project.

Only users with admin permission for the project may access this resource.

Permissions can be:

  • admin
  • create-repo
  • write
  • read
  • none
Scopes
project:admin
read:project:bitbucket, read:user:bitbucket

Request

Path parameters

project_key

string

Required
selected_user_id

string

Required
workspace

string

Required

Responses

Explicit user permission for user and project

application/json

Project User Permission

A user's direct permission for a given project.

GET/workspaces/{workspace}/projects/{project_key}/permissions-config/users/{selected_user_id}
1 2 3 4 curl --request GET \ --url 'https://api.bitbucket.org/2.0/workspaces/{workspace}/projects/{project_key}/permissions-config/users/{selected_user_id}' \ --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 { "type": "project_user_permission", "user": { "type": "user", "display_name": "Colin Cameron", "uuid": "{d301aafa-d676-4ee0-88be-962be7417567}", "account_id": "557058:ba8948b2-49da-43a9-9e8b-e7249b8e324a" }, "permission": "admin", "links": { "self": { "href": "https://api.bitbucket.org/2.0/workspaces/atlassian_tutorial/projects/PRJ/permissions-config/users/557058:ba8948b2-49da-43a9-9e8b-e7249b8e324a" } } }
PUT

Update an explicit user permission for a project

Updates the explicit user permission for a given user and project. The selected user must be a member of the workspace, and cannot be the workspace owner.

Only users with admin permission for the project may access this resource.

Due to security concerns, the JWT and OAuth authentication methods are unsupported. This is to ensure integrations and add-ons are not allowed to change permissions.

Permissions can be:

  • admin
  • create-repo
  • write
  • read
project:admin

Request

Path parameters

project_key

string

Required
selected_user_id

string

Required
workspace

string

Required

Request bodyapplication/json

The permission to grant

permission

string

Required

Responses

Explicit user permission updated

application/json

Project User Permission

A user's direct permission for a given project.

PUT/workspaces/{workspace}/projects/{project_key}/permissions-config/users/{selected_user_id}
1 2 3 4 5 6 7 8 curl --request PUT \ --url 'https://api.bitbucket.org/2.0/workspaces/{workspace}/projects/{project_key}/permissions-config/users/{selected_user_id}' \ --header 'Authorization: Bearer <access_token>' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "permission": "read" }'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 { "type": "project_user_permission", "user": { "type": "user", "display_name": "Colin Cameron", "uuid": "{d301aafa-d676-4ee0-88be-962be7417567}", "account_id": "557058:ba8948b2-49da-43a9-9e8b-e7249b8e324a" }, "permission": "write", "links": { "self": { "href": "https://api.bitbucket.org/2.0/workspaces/atlassian_tutorial/projects/PRJ/permissions-config/users/557058:ba8948b2-49da-43a9-9e8b-e7249b8e324a" } } }
DEL

Delete an explicit user permission for a project

Deletes the project user permission between the requested project and user, if one exists.

Only users with admin permission for the project may access this resource.

Due to security concerns, the JWT and OAuth authentication methods are unsupported. This is to ensure integrations and add-ons are not allowed to change permissions.

project:admin

Request

Path parameters

project_key

string

Required
selected_user_id

string

Required
workspace

string

Required

Responses

The project user permission was deleted and no content returned.

DEL/workspaces/{workspace}/projects/{project_key}/permissions-config/users/{selected_user_id}
1 2 3 curl --request DELETE \ --url 'https://api.bitbucket.org/2.0/workspaces/{workspace}/projects/{project_key}/permissions-config/users/{selected_user_id}' \ --header 'Authorization: Bearer <access_token>'

Rate this page: