---
title: "Get 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.

# Get an index

Path: Logbrook API › Indexes

`GET /indexes/{index}`

Source-scoped read tokens get the name only; other callers also get file sizes and retention policy.

## Authentication

- `bearerAuth`, http, header `Authorization`

## Path parameters

- `index` (`getIndex.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 GET \
  --url '<base-url>/indexes/payments' \
  --header 'Authorization: Bearer <token>'
```

### TypeScript

```typescript
const url = '<base-url>/indexes/payments';
const options = {method: 'GET', 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/payments"

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

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

print(response.text)
```

## Responses

### 200

Index information

#### Example

```json
{
  "name": "payments",
  "size_bytes": 16217,
  "database_bytes": 12288,
  "wal_bytes": 3929,
  "archive_bytes": 0,
  "temp_bytes": 0,
  "other_bytes": 0,
  "max_size_bytes": null,
  "retention_ms": 604800000,
  "ready": true
}
```

- `name` (`getIndex.response.200.name`; string, required)
- `size_bytes` (`getIndex.response.200.size_bytes`; integer, optional)
  - format `int64`; min 0
- `database_bytes` (`getIndex.response.200.database_bytes`; integer, optional)
  - format `int64`; min 0
- `wal_bytes` (`getIndex.response.200.wal_bytes`; integer, optional)
  - format `int64`; min 0
- `archive_bytes` (`getIndex.response.200.archive_bytes`; integer, optional)
  - format `int64`; min 0
- `temp_bytes` (`getIndex.response.200.temp_bytes`; integer, optional)
  - format `int64`; min 0
- `other_bytes` (`getIndex.response.200.other_bytes`; integer, optional)
  - format `int64`; min 0
- `max_size_bytes` (`getIndex.response.200.max_size_bytes`; integer | null, optional)
  - format `int64`; min 1
- `retention_ms` (`getIndex.response.200.retention_ms`; integer, optional)
  - format `int64`; min 1
- `ready` (`getIndex.response.200.ready`; boolean, optional)

### 401

Read or admin token required

### 403

Index outside token scope

### 404

Unknown index

### 429

Diagnostics capacity exhausted

### 503

Filesystem inspection unavailable


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