How to Update Confluence Space Status from "Current" to "Archived" Using API

Ayoub Ben Zaira November 7, 2024

Hello Atlassian Community,

I need to update the status of a Confluence space from "Current" to "Archived" using the Confluence REST API, but I’m having trouble finding the right endpoint . I would appreciate any guidance on how to achieve this.

I tried this one : rest/api/space/${spaceKey}

And this one : rest/api/content/193515306

They both update the spaces but they don't update the "status" attribute.

 

Questions:

  1. Is there an API endpoint or workaround to change the status of a Confluence space to "Archived"?
  2. If no direct API method exists, are there any recommended practices to programmatically mark a space as "Archived"?

 

 

Thank you for your help and guidance!

1 answer

1 accepted

0 votes
Answer accepted
Aron Gombas _Midori_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 7, 2024
Ayoub Ben Zaira November 7, 2024

Hi Aron,

Thank you for your quick reply. Indeed, all the endpoints work perfectly except for the "Update Archive Space" endpoint, which returns a 404 response, as shown in the screenshot.Capture d'écran 2024-11-07 133007.png

Ayoub Ben Zaira November 7, 2024

FYI : here is the version I'm using for confluence : 

Aron Gombas _Midori_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 8, 2024

The REST API doc says that 404 is returned if:

Returned if there is no space with the given key, or if the calling user does not have permission to view it.

 Are you sure that the user account you use for the request has the permission to archive that particular space? (Can you archive the same from the web UI logged in with that account?)

Ayoub Ben Zaira November 8, 2024

Hi, Yes I have admin account and I can both archive and restore any space. I believe it is a version mismatch since I didn't find the endpoint you shared with for my current Confluence version.

Aron Gombas _Midori_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 8, 2024

Ah. I guess you should ask Atlassian, they can give you the reliable answer regarding the versions.

Ayoub Ben Zaira November 8, 2024

Ok I will! Thank you very much for your assistance.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events