Showing results for 
Search instead for 
Did you mean: 
Regular Visitor

Copy File from REST API to SPO library


I want to copy old document version from SPO library to arcive library, I found this REST API:


When I click this URL the file start to download to my machine


So I tried this action of "Copy File":


But I get "BadGateway" error:




How can I copy the file from the REST API?




Community Support
Community Support

Hi @Saharc,


When using the action Copy file, we are asked to specify a file for the field "File to copy" using a valid File Identifier. It is either a dynamic content “File identifier” from the previous trigger/action, or a specific file that you selected from the SharePoint library.


Please take a try with it on your side.


Best regards,


Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-yamao-msft

If I use "/Documents/Document.docx" in "File to copy" it work, but I want to copy file from API: "/_vti_history/1024/Documents/Document.docx" and this doesnt work

Is there a way?



Helpful resources

Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Carousel April Dunnam Updated 768x460.jpg

Urdu Hindi D365 Bootcamp

Dont miss our very own April Dunnam’s The Developer Guide to the Galaxy! Find out what the Power Platform has to offer for the traditional developer.

Users online (2,318)