---
title: "Delete File"
method: DELETE
path: "/api/file/{file_id}"
tags: ["File"]
---

# Delete File

`DELETE /api/file/{file_id}`

Delete a file from S3 attached to the server based on its id. This will disassociate chunks from the file, but only delete them all together if you specify delete_chunks to be true. Auth'ed user or api key must have an admin or owner role for the specified dataset's organization.

## Path parameters

- `file_id` string, uuid, required

## Query parameters

- `delete_chunks` boolean, required

## Headers

- `TR-Dataset` string, uuid, required

## Response `204`

Confirmation that the file has been deleted

## Other responses

- `400` — Service error relating to finding or deleting the file

---

[API](https://skmtc.net/devflowinc/apis/trieve-api.md) · [All operations](https://skmtc.net/devflowinc/apis/trieve-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/devflowinc/trieve-api/versions/84583e7c9fc1/schema)
