kaligne
kaligne

Reputation: 3278

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?

Upvotes: 3

Views: 2088

Answers (1)

kaligne
kaligne

Reputation: 3278

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.

Upvotes: 6

Related Questions