# Delete Doc Folder

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

## Description
Delete a doc folder. As in the app, the folder, every folder inside it, and every doc inside any of them move to Recently Deleted together; non-empty folders are not rejected.

## Parameters

- **folderId** (path) (required) — `string`: The folder ID.

- **workspaceId** (query) (required) — `string`: The unique identifier of the workspace.

## Responses

### 200 — Folder deleted.

```json
{
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Indicates whether the request was successful."
    },
    "data": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string"
        },
        "descendantCount": {
          "type": "integer",
          "description": "Number of nested folders deleted with it."
        }
      },
      "description": "Response payload."
    }
  }
}
```

### 400 — Invalid request parameters. Check the details array for specific validation errors.

```json
{
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "Human-readable error message describing the validation failure."
    },
    "details": {
      "type": "array",
      "description": "List of specific validation errors with field-level details.",
      "items": {
        "type": "object"
      }
    }
  }
}
```

### 401 — Invalid or missing API key. Ensure the X-API-Key header is set with a valid key.

```json
{
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "Human-readable error message."
    }
  }
}
```

### 403 — Access denied. You do not have permission to access this resource. For audit log endpoints, this requires an Enterprise subscription and organization admin/owner role.

```json
{
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "Human-readable error message."
    }
  }
}
```

### 404 — The requested resource was not found. Verify the ID is correct and belongs to your workspace.

```json
{
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "Human-readable error message."
    }
  }
}
```

### 429 — Rate limit exceeded. Wait for the duration specified in the Retry-After header before retrying.

```json
{
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "Human-readable error message with rate limit details."
    }
  }
}
```
