Is it possible to archive a page through the Confluence Cloud API?

Connor
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 29, 2021

Does anyone know whether it's possible to archive a page using the Confluence Cloud API? I've looked through this documentation but haven't found anything. So I don't think it's possible, but I'd like to get confirmation of that before I give up completely. If it's relevant my company is on Standard licensing.

1 answer

1 accepted

1 vote
Answer accepted
David Bakkers
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 30, 2021

Hello @Connor

You can archive an entire Space via the REST API by changing its status to 'archived', as per this thread.

Try using the Update content endpoint to set the status of the page to 'archived' to see what happens. I tested that endpoint and it works fine for changing a page's status to current, trashed, historical or draft as per the REST API documentation:

Query parameters

status

string

The updated status of the content. Use this parameter to change the status of a piece of content without passing the entire request body.

Default: current

Valid values: current, trashed, historical, draft

I'm on the Confluence free plan, which doesn't provide archiving, so I can't test any further.

Connor
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 30, 2021

Thank you for the guidance @David Bakkers 

I tested out your suggestion but ultimately wasn't able to archive the page. It seems like the update content endpoint hasn't been updated yet to work with the archived status. 

I was able to execute this request, using the archived status, and a 200 response was returned. But the status was not updated, the response body just contained the original current status.

curl --request PUT \
--url 'https://your-domain.atlassian.net/wiki/rest/api/content/{id}' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"version": {
"number": 19
},
"title": "<string>",
"type": "page",
"status": "archived"
}'

Interestingly, using the get content properties endpoint against an archived page you can see that the status of the page is set to archived. So "archived" does appear to be the correct status value to use for a page just like Spaces, hopefully Atlassian eventually allows it to be used.

David Bakkers
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 30, 2021

Well @Connor , it was worth a try anyhow.

I just tried to set the status of a page to archived and I too got a 200 response back that everything was fine, but when I checked, the page status had stayed as current.

I've raised this as a feature request for Confluence Cloud (CONFCLOUD-72078), so you can go and vote for it.

Connor
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 4, 2021

Thanks for raising the request, I've added my vote to it.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events