How can I archive a confluence space using REST api

I have found documentation on how to archive confluence spaces using user interface here:

Is there a way to do the same, i.e. archive an existing space, using confluence REST api?
I couldn’t find anything to achieve that here:
https://docs.atlassian.com/confluence/REST/latest

Currently only the space name, description and homepage can be updated.

It doesn’t appear possible at this time. The status field (set to ‘current’) is what you’d like to set.

1 Like

Hello. Is anything changed for this item? CC: @dom, @sfbehnke.

Not to my knowledge… but to be fair, I have not tried in 2+ years :wink:

I found this old user community post which answers that it is possible Archive space for inactive users through REST API

curl --request PUT
–url ‘https://your-domain.atlassian.net/wiki/rest/api/space/{spaceKey}
–user ‘email@example.com:’
–header ‘Accept: application/json’
–header ‘Content-Type: application/json’
–data ‘{“status”: “archived”}’

If it’s a personal space you’ll need an extra property "type": "personal":

curl -v --request PUT
–url 'https://instancename.atlassian.net/wiki/rest/api/space/~12345
–user 'username@domain.com:APITOKEN
–header ‘Accept: application/json’
–header ‘Content-Type: application/json’
–data ‘{“type”: “personal”, “status": “archived”}’

FYI I just tried this now using Confluence Cloud. I successfully archived 150 personal spaces using the information above to build my curl:

curl --location --request PUT ‘https://instancename.atlassian.net/wiki/rest/api/space/~12345
–header ‘Content-Type: application/json’
–header ‘Authorization: Basic API Token’
–data ‘{“type”:“personal”, “status”:“archived”}’

Confluence Cloud.

  • Christa
1 Like