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

1 accepted

1 vote
Answer accepted
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

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

Hey @Tomislav Tobijas , thanks for a quick turnaround.

I deleted the 3 docs from the page editor only.
I am able to see the below options, as depicted in the screenshot. The Attachments option isn't visible.


Screenshot 2025-09-21 at 5.14.26 AM.png

Tomislav Tobijas
Community Champion
September 20, 2025

@Soumita click on this info button ('Show more') and you should see the screenshot I've pasted above + link for attachments.

2025-09-21_01-48-47.png

Or, you could use a direct link such as:

https://<site-name>.atlassian.net/wiki/pages/viewpageattachments.action?pageId=<page-id>

*just replace <site-name> and <page-id> with your values

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

Thanks @Tomislav Tobijas

Yes, I am able to see that it's showing 5 attachments in the info tab.
So, basically even if the document is deleted from the page editor, it remains in the attachment list.

Thanks a lot for the clarification.

Suggest an answer

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

Atlassian Community Events