Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,362,008
Community Members
 
Community Events
168
Community Groups

trying to set the repository generate by api as private is_private : true with no success

Edited

Hi Guys

trying to set the repository generate by api as private

is_private : true  with no success ... im using OAUTH .... 

tried to create repo and update (post and put) with no success 

with POST

curl --request POST \
--header 'Authorization: Bearer ${token}' \
--header 'Accept: application/json' \
--data '{ "scm": "git", "is_private": "true" }'

with PUT

curl --request PUT \
--header 'Authorization: Bearer ${token}' \
--header 'Accept: application/json' \
--data '{ "scm": "git", "is_private": "true" }'

 

I see that there is already question on this with no answer ...

https://community.atlassian.com/t5/Bitbucket-questions/How-to-create-private-repository-via-API-2-0/qaq-p/1202924

 

Thanks Eyal

 

1 answer

1 accepted

0 votes
Answer accepted
Norbert C Atlassian Team Jan 10, 2022

Hi @Eyal David ,

It's Norbert here from the other Community question :)

I would like to inform you the reason why the repository creation is failing is because the "-H "Content-Type: application/json" flag is missing from your call. This flag is needed as we need to specify the content type. 

Can I ask you to do an API call like this and let me know if it creates you a private repository?

curl -X POST -H "Authorization: Bearer token" https://api.bitbucket.org/2.0/repositories/workspace/reposlug -H "Content-Type: application/json" -d '{"scm": "git", "is_private": true, "fork_policy": "no_public_forks"}'

 Please let me know how it goes, Eyal.

Best Regards,
Norbert
Atlassian Bitbucket Cloud Support

@Norbert C Thank you very much worked like a charm !!!

Norbert C Atlassian Team Jan 13, 2022

You're welcome, I'm glad to hear I was able to help :)

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket

Git push size limits are coming to Bitbucket Cloud starting April 4th, 2022

Beginning on April 4th, we will be implementing push limits. This means that your push cannot be completed if it is over 3.5 GB. If you do attempt to complete a push that is over 3.5 GB, it will fail...

3,503 views 3 10
Read article

Atlassian Community Events