Is it possible to move attachment files to different page?

Hi, I need to bulk move attachments to a different page in a different space.
Is there a rest api I can use with working example?
Form the documentation center, the rest api end point /rest/api/content/{id}/child/attachment/{attachmentId} should update parent container.
I’m not clear on the ‘update parent container’ description. Does it mean I can move the attachment to a different page?
I have Confluence Data Center 7.19
Please advise.

1 Like

Documentation is bad. If you search on Google, you’d get an older version of the documentation too.

I haven’t tried myself, but I suggest trying to use GET method on the attachments API. There should be a “container” attribute in the result, change the id and include it in the payload in PUT method (Update).

Edit: I tried it.

This is from get attachments API:

So I do this to move it to another page:


I specify the latest version of the attachment.
The attachment and all versions are moved to the new container (page ID) I specified.
(Note: Same container ID in the screenshot because I’m moving it back)

I tried today and it absolutely worked.
Thank you.