# How to get attachments for a specific version of a page

**URL:** <https://community.developer.atlassian.com/t/how-to-get-attachments-for-a-specific-version-of-a-page/101082>\
**Category:** Confluence Cloud\
**Tags:** rest-api\
**Created:** [June 4, 2026, 12:20pm UTC](https://community.developer.atlassian.com/t/how-to-get-attachments-for-a-specific-version-of-a-page/101082 "2026-06-04T12:20:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![PabloDominguezFrojan](https://avatars.discourse-cdn.com/v4/letter/p/b5e925/32.png) [@PabloDominguezFrojan](https://community.developer.atlassian.com/u/PabloDominguezFrojan)\
**Post date:** [June 4, 2026, 12:20pm UTC](https://community.developer.atlassian.com/t/how-to-get-attachments-for-a-specific-version-of-a-page/101082/1 "2026-06-04T12:20:20Z")

</div>

Hello,

I’m trying to get the attachments of a page using the API. I’m using an API key, and to get a list of attachments i’m calling:

`https://{company}.atlassian.net/wiki/rest/api/content/{pageID}/child/attachment`

Once I get the attachment ID, I download it (this time using OAuth2 / 3LO) with

`https://api.atlassian.com/ex/confluence/{cloudID}/rest/api/content/{pageID}/child/attachment/{attachmentID}/download`

The results are correct. However, the first call returns all the attachments of all the versions of the page, not just the current version. For example, say the page has the following attachments

- Page version 1:
  - Image1.jpg
  - Image2.jpg
  - Image3.jpg
  - Image4.jpg

- Page version 2 (current):
  - ImageAlbum.pdf (the images were deleted and merged into a single file)

The results includes all 5 files. However, our app should see only the most recent one (in this case ImageAlbum.pdf). The attachment objects returned don’t have any mention of the version of the parent page where they are located, so I can’t filter them either.

**Is there a way to obtain the attachments of just the last version of a page using the API? Alternatively, with the ID of the page and the attachment, can I check if the attachment is present in the last version of the page?**

---

<div class="post-metadata">

**Author:** ![rcsr](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/rcsr/32/50184_2.png) [@rcsr](https://community.developer.atlassian.com/u/rcsr)\
**Post date:** [June 4, 2026, 1:29pm UTC](https://community.developer.atlassian.com/t/how-to-get-attachments-for-a-specific-version-of-a-page/101082/2 "2026-06-04T13:29:05Z")

</div>

Not sure if there’s a better solution but you could parse the page’s ADF and search for all [media nodes](https://developer.atlassian.com/cloud/jira/platform/apis/document/nodes/media/) where attrs.type = file. That should return all attachments for the current version of the page.

---

<div class="post-metadata">

**Author:** ![PabloDominguezFrojan](https://avatars.discourse-cdn.com/v4/letter/p/b5e925/32.png) [@PabloDominguezFrojan](https://community.developer.atlassian.com/u/PabloDominguezFrojan)\
**Post date:** [June 11, 2026, 1:10pm UTC](https://community.developer.atlassian.com/t/how-to-get-attachments-for-a-specific-version-of-a-page/101082/3 "2026-06-11T13:10:26Z")

</div>

I managed to solve it by searching the page with

`https://{baseURL}.atlassian.net/wiki/rest/api/search?cql=id="{pageID}"&expand=content.body.storage`

There, inside the body.storage.value field, there’s a xml list with all the current files.
