I am trying to change visibility of a project in Bit Bucket from 'Public' to 'Private'. I can't see how to do this using the Bit Bucket REST API.
Hi @John Lawlor,
To change the visibility of a project in Bitbucket Server, you can use the PUT method of the /rest/api/1.0/projects/{projectKey} end point.
Here is an example using a curl command:
curl --user <username>:<password> -k -H "Content-Type: application/json" --data '{"public":false}' -X PUT <Bitbucket URL>/rest/api/1.0/projects/<project key>
The data is what is changing the visibility of the repository from the current setting to false.
curl --user <username>:<password> -k -H "Content-Type: application/json" --data '{"public":true}' -X PUT <Bitbucket URL>/rest/api/1.0/projects/<project key>
By replacing false with true, you can set the visibility to public.
In both examples, you will need to provide a valid username and password and the URL for Bitbucket Server.
Cheers,
Caterina - Atlassian
Thanks Caterina!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.