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

# List Collections

GET https://api.filesearch.dev/v2/collections

List collections for the authenticated organization with pagination.

Reference: https://docs.filesearch.dev/reference/collections

## Request

### Query parameters

- `limit` (integer, optional, default: 100)
- `offset` (integer, optional, default: 0)

## Response

### 200

Successful Response

- `collections` (list of CollectionListItem, required)
- `limit` (integer, required)
- `offset` (integer, required)
- `total_count` (integer, required)

## Types

### CollectionListItem

- `collection_id` (string, required)
- `collection_name` (string, required)
- `created_at` (string, optional, nullable)
- `document_count` (integer, optional, nullable)

## Examples

**Response**

```json
{
  "collections": [
    {
      "collection_id": "db_9f8e7d6c5b4a3",
      "collection_name": "Marketing Assets",
      "created_at": "2024-05-20T10:15:30Z",
      "document_count": 245
    },
    {
      "collection_id": "db_2a7b4c9d8e1f0",
      "collection_name": "Customer Research",
      "created_at": "2024-06-03T16:42:11Z",
      "document_count": 87
    },
    {
      "collection_id": "db_6c5b4a3f2e1d0",
      "collection_name": "Legal Contracts",
      "created_at": "2024-07-12T09:05:44Z",
      "document_count": 412
    }
  ],
  "limit": 50,
  "offset": 0,
  "total_count": 1200
}
```

**SDK Code**

```python
import json
import requests

BASE_URL = "https://api.filesearch.dev"
API_KEY = "your_api_key"

headers = {
    "Authorization": f"Bearer {API_KEY}",
}

params = {
    "limit": 10,
    "offset": 0
}

response = requests.get(
    f"{BASE_URL}/v2/collections",
    headers=headers,
    params=params,
    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 headers = {
  Authorization: `Bearer ${API_KEY}`,
};

const params = new URLSearchParams({
  "limit": "10",
  "offset": "0"
});

const response = await fetch(`${BASE_URL}/v2/collections?${params}`, {
  method: "GET",
  headers,
});

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