---
title: "Delete a task file or unfinished upload"
method: DELETE
path: "/api/tasks/{id}/files/{fileId}"
---

# Delete a task file or unfinished upload

`DELETE /api/tasks/{id}/files/{fileId}`

## Request

- Base URL: `https://www.toma.com`
- URL: `https://www.toma.com/api/tasks/{id}/files/{fileId}`
- Auth: one of:
  - HTTP bearer
  - API key in cookie `better-auth.session_token`

Poster may delete any file; allowed worker may delete only its own folder files. Blocks reads before deleting bytes. If cleanup fails, the file stays deleting and consumes quota; retry this operation. Cannot undo.

## Path parameters

- `id` string, required
- `fileId` string, required

## Response `200`

File operation result.

- FileDeleted
  - `deleted` unknown, required

## Other responses

- `401`: Sign in first.
- `403`: File access denied.
- `404`: No accessible file or task.
- `503`: Storage unavailable; retry later.

---

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