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)

2 Answers 2


Yes it is possible using this endpoint: site/_api/SP.MoveCopyUtil.CopyFolderByPath() and the right parameters as you can see below:

var postData = {
        type: "POST",
        url: "https://example.com/sites/<siteName>/_api/SP.MoveCopyUtil.CopyFolderByPath()",
        data: JSON.stringify(postData),
        headers: {
            "Accept": "application/json; odata=verbose",
            "X-RequestDigest":  $("#__REQUESTDIGEST").val()
        contentType: "application/json; odata=verbose",
        success: function (data) {

I hope this will help someone in the future.

  • Any option to skip the existing folder if any in the hierarchy?
    – Sudhir
    Commented Nov 24, 2021 at 11:02

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 and acknowledge you have read our privacy policy.

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