---
title: "Delete an index"
---

> Documentation Index
> Fetch the complete documentation index at: https://sandrinodm.github.io/logbrook/llms.txt
> Use this file to discover all available pages before exploring further.

# Delete an index

Path: Logbrook API › Indexes

`DELETE /indexes/{index}`

Permanently deletes a dynamically created index and its events. Requires the admin token. The `default` index and indexes declared in the server configuration can't be deleted. Once accepted, the deletion finishes even if the client disconnects. A later ingest to the same name recreates the index, so stop producers first.

## Authentication

- `bearerAuth`, http, header `Authorization`

## Path parameters

- `index` (`deleteIndex.path.index`; string, required) — Index name: lowercase letters, digits, underscores and hyphens. The token's index scope applies as well as its source scope.
  - minLength 1; maxLength 63; pattern `^[a-z0-9][a-z0-9_-]*$`

## Code samples

### cURL

```bash
curl --request DELETE \
  --url '<base-url>/indexes/audit' \
  --header 'Authorization: Bearer <token>'
```

### TypeScript

```typescript
const url = '<base-url>/indexes/audit';
const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "<base-url>/indexes/audit"

headers = {"Authorization": "Bearer <token>"}

response = requests.delete(url, headers=headers)

print(response.text)
```

## Responses

### 200

Index deleted

#### Example

```json
{
  "deleted": "audit"
}
```

- `deleted` (`deleteIndex.response.200.deleted`; string, required)

### 400

Invalid name or protected default/configured index

### 401

Valid credential required

### 403

Admin token required

### 404

Unknown index

### 429

Request capacity exhausted

### 503

Shutdown or filesystem operation failed; inspect state before retrying


Source: https://sandrinodm.github.io/logbrook/api/indexes/delete/index.md
