RESTfully Creating a Repository in BitBucket.org
How to create BitBucket repositories via REST API using curl command.
Creating aGit repository is simple, using the excellentBitBucket.orgservice. It can be a chore to go to the bitbucket website and manually creating new repositories every time, though. Since it is bitbucket, and Atlassian, they have exposed a very nice RESTful API on top their service offering. Below is an example of how to create a new repository from ‘curl’ command-line …
curl --user login:pass https://api.bitbucket.org/1.0/repositories/ --data name=REPO_NAME
The above creates a ‘public’ repository. If you want a ‘private’ repository, then just add—data is_private=‘true’. Like this …
curl --user login:pass https://api.bitbucket.org/1.0/repositories/ --data name=REPO_NAME --data is_private=true
(source:http://stackoverflow.com/questions/13788485/create-new-repo-on-bitbucket-from-git)