---
title: "Delete a file"
method: DELETE
path: "/api/v1/files/{fileId}"
tags: ["Files"]
---

# Delete a file

`DELETE /api/v1/files/{fileId}`

## Request

- Base URL: `https://app.khotan.com`
- URL: `https://app.khotan.com/api/v1/files/{fileId}`
- Auth: one of:
  - HTTP bearer
  - API key in header `x-api-key`

Soft-deletes the file and removes its bytes from storage. Works for ready files and pending uploads (cancel an incomplete upload by deleting it). The file disappears from listings immediately; deletion is permanent.

## Path parameters

- `fileId` string, required

## Response `200`

The file was deleted.

- object
  - `deleted` true, required

## Other responses

- `401`: Authentication is missing or invalid.
- `403`: The caller is not permitted to perform this action.
- `404`: The resource was not found.
- `429`: Too many requests; retry after the indicated delay.

---

[API](https://skmtc.dev/khotan/apis/khotan-api.md) - [All operations](https://skmtc.dev/khotan/apis/khotan-api/llms.txt) - [OpenAPI document](https://skmtc.dev/khotan/apis/khotan-api/revisions/90b512a53e42?raw)
