Moving Sidecar XMLs to a Dedicated Folder

By Patrik - July 2, 2015

What are you doing with you sidecar XMLs after you are done with the import? You can of course delete them, but you can also move or copy them to another folder for keeping.

You can easily do either a move/copy of the sidecar file to a dedicated folder, or delete, with a simple API call. The relevant API calls can be found here for delete, and move/copy.

To delete the sidecar XML you would make a DELETE request to :


setting the appropriate source-storage-id, and file-id.

To move a file you make a POST request to:


with query parameter move set to true, and an optional new filename.

To copy the file, set the query parameter move to false instead:


A simple example in Javascript to start a move job for the files, and at the same time rename them, would look like this:

var oldFilename = api.path("storage/"+srcStorageId+"/file/"+sidecarFileId).get()
var regex = /^(.*)\.([^.]+)$/;
var newFileName = (regex.exec(oldFilename)[0] + ".imported")

  .queryParam("move", "true")
  .queryParam("filename", newFileName)