How to use REST API to delete page and purge it from the trash?

I'm trying to delete a page from Confluence and also purge it from the trash using the REST API. I can delete the page fine - however it always ends up in the trash.

According to the documentation for deleting a page: https://docs.atlassian.com/confluence/REST/latest/

If the content is trashable, its status is {@link ContentStatus#TRASHED} and the "status" query parameter in the request is "trashed", the content will be purged from the trash and deleted permanently.

...so I assume all I need to do is add ?trashed to the URL.

When I execute this:

curl -u admin:admin -X DELETE 'http://localhost:8080/confluence/rest/api/content/3604482?trashed'

...the page gets deleted however it's still in the trash.

Does anyone know how to purge a page from the trash using the REST API?

By the way - I'm using Confluence 5.8.5

Thanks!

 

1 answer

1 accepted

1 vote
Stephen Deutsch Community Champion Aug 27, 2015

I think they mean that you need to do ?status=trashed smile

That was it! Thanks - appreciate the tip.

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Kesha Thillainayagam
Posted Apr 13, 2018 in Confluence

We want to hear how your non-technical teams are using Confluence!

Hi Community! Kesha (kay-sha) from the Confluence marketing team here! Can you share stories with us on how your non-technical (think Marketing, Sales, HR, legal, etc.) teams are using Confluen...

2,260 views 25 10
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you