Verify Bitbucket Project with name exists API

We are building automation with Bitbucket and finished Bitbucket Project Creation. I can ensure, before attempting to POST with new Project, that the key doesn’t already exist by doing a GET against the API with the KEY but can’t seem to with Project Name?

My initial thoughts were to GET the /rest/api/1.0/projects lists and iterate over them. We did a similar approach with Confluence but you can create multiple spaces with the same name but different keys there so I expected that, but with Bitbucket you can’t create projects with the same name.

Thanks all.

1 Like

I think I figured it out - as it’s a GET, you have to include in the url (e.g. rest/api/1.0/projects?name=PROJECTNAMEHERE)

And you have to replace spaces with + characters (e.g. New Project , New+Project)
Still learning :slight_smile:

3 Likes