---
title: "Delete a folder"
method: DELETE
path: "/api/v1/folders/{folderId}"
tags: ["Folders"]
---

# Delete a folder

`DELETE /api/v1/folders/{folderId}`

## Request

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

Soft-deletes an empty folder. A folder containing active child folders, ready files, or live pending uploads responds 409 with code folder_not_empty; when live pending uploads block deletion, error.details.pendingFileIds lists those file ids. Pending uploads past their upload expiry window do not block deletion. Move, cancel, or wait for expiry, then retry.

## Path parameters

- `folderId` string, required

## Response `200`

The folder 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.
- `409`: Response.
- `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)
