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.
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.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for raising the request, I've added my vote to it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.