Confluence Space Type 'global', 'collaboration', 'knowledge-base' - how to change the type?

Hi,

I can get all spaces of type ‘global’ from the API /wiki/rest/api/space?limit=500&status=current&type=global

But some spaces do have the category ‘collaboration’ or ‘knowledge-base’.

We can successfully change those types into ‘global’ via the API in the Dev Console:

fetch('https://{yourInstance}.atlassian.net/wiki/rest/api/space/{spaceKey}', {
  method: 'PUT',
  credentials: 'include', // This is important to include cookies with the request
  headers: {
    'Content-Type': 'application/json',
      'Accept': 'application/json',
  },
  body: JSON.stringify({
    "type": 'collaboration'
  })
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
  1. How can we change a space category from ‘global’ to ‘collaboration’ in the User Interface?

  2. How can we change a space category back from ‘global’ into something else? (We get BAD REQUEST from the API call if we try)