Copy multiple files between projects

This call allows you to copy files between projects. Unlike the call to copy a file between projects, this call lets you batch the copy operation and copy a list of files at a time.

📘

If you are using Seven Bridges Platform EU, please use the following endpoint: https://eu-api.sbgenomics.com/v2/action/files/copy

👍

File IDs

Note that a file's ID is dependent on the project it is contained in. So, when you copy files from one project to another, their IDs will be different in the target project.

The file names, however, do not change by copying, except where copying would yield non-unique file names in a project. For details of this use case, see the tipbox at the bottom of the page.

Example request body

{
    "project": "RFranklin/my-project",
    "file_ids": ['567890abc9b0307bc0414164', '567890abc1e5339df0414123']

}

Interpreting the request body

The request returns an object "new_file_name" for every file copied.

The "new_file_name" will be the same as the file's old name in all cases except for the case in which you already have a file with that name in the target project. If an identically-named file exists in the project, then the copied file will be automatically renamed by prefixing it with an increment of 1. For instance, if I copy the file named file.ext to my project, and there already exists a file.ext there, then my incoming file will be renamed 1_file.ext.

It is not possible to re-name files other than by this automatic procedure with this call. If you want to copy and rename a file, use the alternative (non-batch) call to copy a file. This restriction optimizes the batch request: it adds 100ms per file to rename it during copying, so if copying 100 files, it would take 10s longer to rename all of them.

Language