Projects

Create a project in a workspace

Changed on

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

  • Base URL
    https://api.bitbucket.org/2.0
  • URL
    https://api.bitbucket.org/2.0/workspaces/{workspace}/projects
  • Auth
    • OAuth 2
      Authorization code: https://bitbucket.org/site/oauth2/authorize
      Token URL: https://bitbucket.org/site/oauth2/access_token scopes: project:admin
    • or HTTP basic
    • or API key in header Authorization

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.

Changes

    • warning

      removed the request property ///////

    • warning

      removed the optional property /////// from the response with the status