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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.