Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create a BitBucket Team repository using the api

I need to create a Team repository usign Bitbucket's API.

To create a user repository I use to do so:

$ curl -k -X POST -u username:passwd "https://api.bitbucket.org/1.0/repositories" -d "name=myrep"

How would I do the same but for a team?

like image 262
kaligne Avatar asked Nov 17 '25 07:11

kaligne


1 Answers

This explains how it works with the repositories endpoint of API 2:

$ team=myteam
$ repo=repository
$ curl -X POST -v -u username:password -H "Content-Type: application/json" \
  https://api.bitbucket.org/2.0/repositories/${team}/${repo} \
  -d '{"scm": "git", "is_private": "true", "fork_policy": "no_public_forks" }'

The difference from API 1 regarding how the data (-d) is handled is that API2 uses JSON format.

like image 104
kaligne Avatar answered Nov 21 '25 09:11

kaligne



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!