---
title: "Attach existing file to a new dataset and delete it from the old one"
method: POST
path: "/datasets/{datasetId}/moveBetweenDatasets/{toDataset}/{fileId}"
tags: ["datasets"]
---

# Attach existing file to a new dataset and delete it from the old one

`POST /datasets/{datasetId}/moveBetweenDatasets/{toDataset}/{fileId}`

If the file is an XML metadata file, the metadata are added to the
dataset.

## Path parameters

- `datasetId` string, required
- `toDataset` string, required
- `fileId` string, required

## Response `200`

OK

## Other responses

- `404` — The requested resource was not found

---

[API](https://skmtc.net/clowder-framework/apis/clowder.md) · [All operations](https://skmtc.net/clowder-framework/apis/clowder/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/clowder-framework/clowder/versions/bcd187478e0d/schema)
