I have a Folder whose folder structure must be cloned to another folder in another document library.

Is it possible to do something like using file/folder REST API


or List REST API

/_api/web/lists(guid'{0}')/items({1})/copyto(destiation list/item)

I haven`t tested the complete code but seems should work for your scenario.

<<web url>>/_api/web/getfilebyserverrelativeurl('/subsite/Shared%20Documents/sample.txt')/copyTo('/subsite/Shared%20Documents/sample1.txt')

The above one is POST end point.

I don`t see any CopyTo end point for folder.


MSDN reference for Folder and File end points


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.