---
title: "Remove a file from an in-progress dataset version"
method: DELETE
path: "/files/{id}"
tags: ["files"]
---

# Remove a file from an in-progress dataset version

`DELETE /files/{id}`

This action only works on an in-progress dataset (this means that the latest version of a dataset associated with this file has to be in-progress). It will destroy the metadata and file if it's a staged file that hasn't been submitted to the repository yet.  If the file was submitted previously in an earlier version of the same dataset it will stage removal from the in-progress dataset version.  In order to finalize staged file changes into the storage repository, the in-progress dataset must be submitted again after all changes are ready.

## Path parameters

- `id` integer, required

## Response `201`

The file and metadata was removed from staging.  Or the file and metadata was staged for removal from this version.

- File
  - `_links` object
    - `self` HalLink
      - `href` string, uri, required
    - `stash:dataset` HalLink
      - `href` string, uri, required
    - `stash:version` HalLink
      - `href` string, uri, required
    - `stash:files` HalLink
      - `href` string, uri, required
    - `stash:download` HalLink
      - `href` string, uri, required
    - `curies` HalCurie[]
      - `name` string, required
      - `href` string, uri, required
      - `templated` boolean, required
  - `path` string
  - `size` integer
  - `mimeType` string
  - `status` string
  - `digest` string
  - `digestType` string
  - `description` string

## Other responses

- `401`
- `403`
- `404`
- `406`

---

[API](https://skmtc.net/datadryad/apis/dryad-api.md) · [All operations](https://skmtc.net/datadryad/apis/dryad-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/datadryad/dryad-api/revisions/5e35babfb8d2/schema)
