You can use /rest/api/1.0/projects/{projectKey}/repos post to create a new repository. The authenticated user must have project admin permissions in the project you want to create the repository.
Thanks Mikael for the response. Would the entire command be something like this (tried couple options and didnt work yet)
curl -s -u username:password -k --header "Content-Type: application/json" -X PUT"Content-Type: application/json" -X PUT "https://bitbucket.xxx.xxx/rest/api/1.0/projects/CR/repos/testtest"
CR is the project key and testtest is the name of the repos
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
From what I can see from the documentation you also have to include scmId which should be set to git. Here is the example in the guide:
{
"name": "My repo",
"scmId": "git",
"forkable": true,
"defaultBranch": "main"
}
Default branch and workable are optional.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry to hijack this thread, but this is not working for me as I expect it to.
curl - u username:password http://bitbucket.domains/rest/api/1.0/projects/PROJECT/repos/toplevel -H 'Content-Type: application/json' -d '{"name": "newrepo", "scmID": "git"}'
Instead creates a repo here:
/rest/api/1.0/projects/~USERNAME/repos/newrepo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.