---
title: "Attach existing file to dataset"
method: POST
path: "/datasets/{ds_id}/files/{file_id}"
tags: ["datasets"]
---

# Attach existing file to dataset

`POST /datasets/{ds_id}/files/{file_id}`

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

## Path parameters

- `ds_id` string, required
- `file_id` 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)
