v2

latestSwagger 2.02026-08-01331211921.0 KB
Projects

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:

$ 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:

$ 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
}
post/workspaces/{workspace}/projects

Request body

typestring required
uuidstring

The project's immutable id.

keystring

The project's key.

namestring

The name of the project.

descriptionstring
is_privateboolean

Indicates whether the project is publicly accessible, or whether it is private to the team and consequently only visible to team members. Note that private projects cannot contain public repositories.

created_onstring date-time
updated_onstring date-time
has_publicly_visible_reposboolean

Indicates whether the project contains publicly visible repositories. Note that private projects cannot contain public repositories.

Response

A new project has been created.

typestring required
uuidstring

The project's immutable id.

keystring

The project's key.

namestring

The name of the project.

descriptionstring
is_privateboolean

Indicates whether the project is publicly accessible, or whether it is private to the team and consequently only visible to team members. Note that private projects cannot contain public repositories.

created_onstring date-time
updated_onstring date-time
has_publicly_visible_reposboolean

Indicates whether the project contains publicly visible repositories. Note that private projects cannot contain public repositories.