3

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?

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
kaligne
  • 3,098
  • 9
  • 34
  • 60

1 Answers1

6

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.

Asclepius
  • 57,944
  • 17
  • 167
  • 143
kaligne
  • 3,098
  • 9
  • 34
  • 60