> For a complete page index of the Captain API documentation, fetch https://docs.filesearch.dev/llms.txt?excludeSpec=true

# Delete Chunk Metadata

DELETE https://api.filesearch.dev/v3/collections/{collection_name}/chunks/{chunk_id}/metadata

Remove custom metadata from a chunk.

Reference: https://docs.filesearch.dev/reference/v3/documents/chunk/metadata/delete

## Request

### Path parameters

- `collection_name` (string, required)
- `chunk_id` (string, required)

## Response

### 200

Delete Chunk Metadata response.

- `success` (boolean, required)
- `message` (string, required)

## Errors

### 401 Unauthorized Error

Missing or invalid authentication.

- `error` (string, required) — Error kind. `HTTP_ERROR` for errors raised by the route.
- `message` (string, required) — What went wrong.
- `path` (string, required) — The request path.
- `status_code` (integer, optional) — The HTTP status code.

### 403 Forbidden Error

API key cannot write to this collection.

- `error` (string, required) — Error kind. `HTTP_ERROR` for errors raised by the route.
- `message` (string, required) — What went wrong.
- `path` (string, required) — The request path.
- `status_code` (integer, optional) — The HTTP status code.

### 404 Not Found Error

Collection not found.

- `error` (string, required) — Error kind. `HTTP_ERROR` for errors raised by the route.
- `message` (string, required) — What went wrong.
- `path` (string, required) — The request path.
- `status_code` (integer, optional) — The HTTP status code.

## Examples

**Response**

```json
{
  "success": true,
  "message": "Chunk metadata deleted for ''chunk_agri_report_001'.'"
}
```

**SDK Code**

```python
import json
import requests
import uuid

BASE_URL = "https://api.filesearch.dev"
API_KEY = "your_api_key"
COLLECTION_NAME = "my_documents"
CHUNK_ID = "doc_abc123:0"

headers = {
    "Authorization": f"Bearer {API_KEY}",
    "Idempotency-Key": str(uuid.uuid4()),
}

response = requests.delete(
    f"{BASE_URL}/v3/collections/{COLLECTION_NAME}/chunks/{CHUNK_ID}/metadata",
    headers=headers,
    timeout=30.0
)

print(json.dumps(response.json(), indent=2))
```

```typescript
const BASE_URL = "https://api.filesearch.dev";

const API_KEY = "your_api_key";

const collection_name = "my_documents";

const chunk_id = "doc_abc123:0";

const headers = {
  Authorization: `Bearer ${API_KEY}`,
  "Idempotency-Key": crypto.randomUUID(),
};

const response = await fetch(`${BASE_URL}/v3/collections/${collection_name}/chunks/${chunk_id}/metadata`, {
  method: "DELETE",
  headers,
});

const data = await response.json();
console.log(JSON.stringify(data, null, 2));
```