> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.vapi.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.vapi.ai/_mcp/server.

# Detach a file

DELETE https://api.vapi.ai/v2/knowledge-base/{id}/file/{fileId}

Reference: https://docs.vapi.ai/api-reference/knowledge-bases-v-2/knowledge-base-v-2-controller-file-detach

## Authentication

- `Authorization` header (bearer token, required) — Authenticate server-side requests with a private Vapi API key. Create or copy a key from the [Vapi Dashboard](https://dashboard.vapi.ai) and send it in the `Authorization` header as `Bearer <token>`. Keep private API keys out of client-side code and public repositories.

## Request

### Path parameters

- `id` (string, required) — The unique identifier for the resource.
- `fileId` (string, required)

## Response

### 200

- `id` (string, required)
- `knowledgeBaseV2Id` (string, required)
- `fileId` (string, required)
- `status` (enum, required)
  - Allowed values: `indexing`, `ready`, `failed`
- `createdAt` (datetime, required)
- `updatedAt` (datetime, required)
- `fileName` (string, optional)
- `mimetype` (string, optional)
- `bytes` (double, optional)

## Examples

**Response**

```json
{
  "id": "string",
  "knowledgeBaseV2Id": "string",
  "fileId": "string",
  "status": "indexing",
  "createdAt": "2024-01-15T09:30:00Z",
  "updatedAt": "2024-01-15T09:30:00Z",
  "fileName": "string",
  "mimetype": "string",
  "bytes": 1.1
}
```