Create a repository
Changed onCreates a new repository.
Note: In order to set the project for the newly created repository, pass in either the project key or the project UUID as part of the request body as shown in the examples below:
$ curl -X POST -H "Content-Type: application/json" -d '{
"scm": "git",
"project": {
"key": "MARS"
}
}' https://api.bitbucket.org/2.0/repositories/teamsinspace/hablanding
or
$ curl -X POST -H "Content-Type: application/json" -d '{
"scm": "git",
"project": {
"key": "{ba516952-992a-4c2d-acbd-17d502922f96}"
}
}' https://api.bitbucket.org/2.0/repositories/teamsinspace/hablanding
The project must be assigned for all repositories. If the project is not provided, the repository is automatically assigned to the oldest project in the workspace.
Note: In the examples above, the workspace ID teamsinspace, and/or the repository name hablanding can be replaced by UUIDs.
Request
- Base URLhttps://api.bitbucket.org/2.0
- URLhttps://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}
- Auth
- OAuth 2Authorization code: https://bitbucket.org/site/oauth2/authorizeToken URL: https://bitbucket.org/site/oauth2/access_token scopes: repository:admin
- or HTTP basic
- or API key in header Authorization
Request body
Response
The newly created repository.
Changes
- warning
removed the request property
///////////// - warning
removed the request property
////////// - warning
removed the request property
/// - warning
removed the request property
///////// - warning
removed the optional property
/////////////from the response with the status - warning
removed the optional property
//////////from the response with the status - warning
removed the optional property
///from the response with the status - warning
removed the optional property
/////////from the response with the status - warning
added the new
rebase_fast_forwardenum value to the////response property for the response status - warning
added the new
rebase_mergeenum value to the////response property for the response status - warning
added the new
squash_fast_forwardenum value to the////response property for the response status - info
added the new optional request property
///////// - info
added the new
rebase_fast_forwardenum value to the request property//// - info
added the new
rebase_mergeenum value to the request property//// - info
added the new
squash_fast_forwardenum value to the request property//// - info
added the optional property
/////////to the response with the status
- warning