Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to Filter Out Deleted Attachments from a Confluence REST API Response?

Soumita
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 20, 2025

When I am making a GET request to the endpoint:
'https://<MY_FIRM_NAME>.atlassian.net/wiki/rest/api/content/<page_id>/child/attachment'

Then I am getting all the attachments that were ever linked to that confluenced doc.

Initially I had 5 documents in total. But now I deleted 3 of them. Hence, in the final result, there should be only 2 elements in the json array response. But it is giving all 5 elements without any field which can be used to distinguish between available and deleted attachments.

Can someone help in this one? I am stuck, as I don't want to read the attachments that have already been deleted.

Thanks in advance !!

1 answer

0 votes
Tomislav Tobijas
Community Champion
September 20, 2025

Hi @Soumita ,

Question—have you deleted those files from Attachments section as well, or only from the page via page editor?

2025-09-21_01-31-12.png

If you do this, does REST API still return 'old'/deleted attachments?

There's also one feature request which might be relevant to this: CONFCLOUD-16577: Ability to detect unused attachments > it's quite old though, but if you scan comments, you might find something useful 👀

Cheers,
Tobi

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
TAGS
AUG Leaders

Atlassian Community Events