---
title: "Delete selected dataset files"
method: POST
path: "/api/Dataset/{datasetId}/files/delete_selected"
tags: ["Dataset Management"]
---

# Delete selected dataset files

`POST /api/Dataset/{datasetId}/files/delete_selected`

Deletes the specified files from the dataset. Ids that do not belong to the dataset are ignored.

## Path parameters

- `datasetId` string, required

## Request body

- DeleteSelectedFilesRequest — Request model for deleting a user-selected subset of a dataset's files. Sent as a POST body rather than a query string because a selection can hold hundreds of file ids, which would exceed URL length limits.
  - `fileIds` string[], required — Ids of the dataset files to delete. Ids that do not belong to the dataset are ignored.

## Response `200`

Returns the deleted files

- FileResponseModel[]
  - `fileId` string — The file ID
  - `fileName` string — The file name
  - `fileType` string — The file type, such as csv, txt, pdf, docx
  - `datasetId` string — The identifier of the dataset that owns the file
  - `numRows` integer, nullable — The number of rows in a csv file.
  - `numColumns` integer — The number of columns in a csv file
  - `piiTypes` string[] — List of all of the entity types that were detected in the file
  - `wordCount` integer — Total number of words in file
  - `redactedWordCount` integer — Total number of redacted words in the file
  - `uploadedTimestamp` Instant — A point in time represented as an ISO 8601 timestamp string.
  - `fileSource` 'Local' | 'Sharepoint' | 'Aws' | 'Sdk' | 'Azure' | 'OneLake' — The original upload location of source files (Local, S3, Azure, SharePoint, OneLake, or SDK).
  - `processingStatus` string — Current status of the file: Queued, Running, Completed, or Failed
  - `processingError` string, nullable — For a file that failed to process, the processing error
  - `mostRecentCompletedJobId` string, nullable — The identifier of the most recent job that processed the file
  - `fileParseResultId` string, nullable — The identifier of the file parse result
  - `filePath` string, nullable — If applicable, the file path of the source file
  - `generatedFileStatus` string, nullable — Status of the external-file generation job for this file, if applicable

## Other responses

- `400` — Invalid request
- `404` — Dataset or selected files not found

---

[API](https://skmtc.net/tonic/apis/textual-api.md) · [All operations](https://skmtc.net/tonic/apis/textual-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/tonic/textual-api/revisions/41da8739a690/schema)
