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

Rate this page:

Projects

Bitbucket Cloud projects make it easier for teams to focus on a goal, product, or process by organizing their repositories.

Create a project in a workspace

POST /2.0/workspaces/{workspace}/projects

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
$ 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/teams/teams-in-space/projects/ | jq .
{
  // Serialized project document
}

or even:

1
2
$ 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/teams/teams-in-space/projects/ | jq .
{
  // Serialized project document
}
project:admin

Request

Path parameters
workspace Required

string

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

Body parameters
Content typeValue
application/json

allOf [object, Project]

Example

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
}'

Responses

A new project has been created.

Content typeValue
application/json

allOf [object, Project]

Header Parameters
Location

string

The location of the newly created project

Get a project for a workspace

GET /2.0/workspaces/{workspace}/projects/{project_key}

Returns the requested project.

project

Request

Path parameters
project_key Required

string

The project in question. This is the actual key assigned to the project.

workspace Required

string

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

Example

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'

Responses

The project that is part of a workspace.

Content typeValue
application/json

allOf [object, Project]

Update a project for a workspace

PUT /2.0/workspaces/{workspace}/projects/{project_key}

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

Creation