Bitbucket Cloud projects make it easier for teams to focus on a goal, product, or process by organizing their repositories.
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 }
project:admin
admin:project:bitbucket
string
RequiredallOf [object, Project]
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
.
A Bitbucket project. Projects are used by teams to organize repositories.
A new project has been created.
string
allOf [object, Project]
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
.
A Bitbucket project. Projects are used by teams to organize repositories.
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
}'
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
}
Returns the requested project.
project
read:project:bitbucket
string
Requiredstring
RequiredThe project that is part of a workspace.
allOf [object, Project]
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
.
A Bitbucket project. Projects are used by teams to organize repositories.
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'
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
}
Since this endpoint can be used to both update and to create a project, the request body depends on the intent.
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.
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.
project:admin
admin:project:bitbucket
string
Requiredstring
RequiredallOf [object, Project]
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
.
A Bitbucket project. Projects are used by teams to organize repositories.
The existing project is has been updated.
string
allOf [object, Project]
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
.
A Bitbucket project. Projects are used by teams to organize repositories.
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
}'
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
}
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
project:admin
admin:project:bitbucket
string
Requiredstring
RequiredSuccessful deletion.
1
2
3
curl --request DELETE \
--url 'https://api.bitbucket.org/2.0/workspaces/{workspace}/projects/{project_key}' \
--header 'Authorization: Bearer <access_token>'
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.
project:admin
read:pullrequest:bitbucket
string
Requiredstring
RequiredThe list of project default reviewers
A paginated list of default reviewers with reviewer type.
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'
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
}
Returns the specified default reviewer.
project:admin
read:pullrequest:bitbucket
string
Requiredstring
Requiredstring
RequiredThe specified user that is a default reviewer
allOf [allOf [object, Account], User]
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
.
An account object.
A user object.
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'
1
2
3
4
5
{
"display_name": "Davis Lee",
"type": "user",
"uuid": "{f0e0e8e9-66c1-4b85-a784-44a9eb9ef1a6}"
}
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.
project:admin
admin:project:bitbucket
string
Requiredstring
Requiredstring
RequiredThe specified user was added as a project default reviewer
allOf [allOf [object, Account], User]
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
.
An account object.
A user object.
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'
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"
}
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
project:admin
admin:project:bitbucket
string
Requiredstring
Requiredstring
RequiredThe specified user was removed from the list of project default reviewers
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>'
Returns a paginated list of explicit group permissions for the given project. This endpoint does not support BBQL features.
project:admin
read:project:bitbucket
, read:user:bitbucket
string
Requiredstring
RequiredPaginated list of project group permissions
A paginated list of project group permissions.
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'
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
}
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
project:admin
read:project:bitbucket
, read:user:bitbucket
string
Requiredstring
Requiredstring
RequiredProject group permission
A group's permission for a given project.
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'
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"
}
}
}
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
string
Requiredstring
Requiredstring
RequiredThe permission to grant
string
RequiredProject group permission updated.
A group's permission for a given project.
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"
}'
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"
}
}
}
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
string
Requiredstring
Requiredstring
RequiredThe project group permission was deleted and no content returned.
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>'
Returns a paginated list of explicit user permissions for the given project. This endpoint does not support BBQL features.
project:admin
read:project:bitbucket
, read:user:bitbucket
string
Requiredstring
RequiredPaginated list of explicit user permissions.
A paginated list of project user permissions.
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'
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
}
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
project:admin
read:project:bitbucket
, read:user:bitbucket
string
Requiredstring
Requiredstring
RequiredExplicit user permission for user and project
A user's direct permission for a given project.
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'
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"
}
}
}
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
string
Requiredstring
Requiredstring
RequiredThe permission to grant
string
RequiredExplicit user permission updated
A user's direct permission for a given project.
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"
}'
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"
}
}
}
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
string
Requiredstring
Requiredstring
RequiredThe project user permission was deleted and no content returned.
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: