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

# List Documents

GET https://api.filesearch.dev/v2/collections/{collection_name}/documents

List documents in a collection with pagination.

Reference: https://docs.filesearch.dev/reference/v2/documents

## Request

### Path parameters

- `collection_name` (string, required)

### Query parameters

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

## Response

### 200

Successful Response

- `collection_name` (string, required)
- `documents` (list of DocumentListItem, required)
- `limit` (integer, required)
- `offset` (integer, required)
- `total_count` (integer, required)

## Types

### DocumentListItem

- `document_id` (string, required)
- `filename` (string, required)
- `chunk_count` (integer, optional, default: 0)
- `content_type` (string, optional, nullable)
- `created_at` (string, optional, nullable)
- `indexed_at` (string, optional, nullable)
- `indexing_status` (string, optional, nullable)
- `uri` (string, optional, nullable)

## Examples

**Response**

```json
{
  "collection_name": "user_documents",
  "documents": [
    {
      "document_id": "a1b2c3d4-e5f6-7890-ab12-cd34ef567890",
      "filename": "project_proposal.pdf",
      "chunk_count": 5,
      "content_type": "application/pdf",
      "created_at": "2024-05-20T10:15:30Z",
      "indexed_at": "2024-05-21T08:00:00Z",
      "indexing_status": "completed",
      "uri": "https://storage.example.com/user_documents/project_proposal.pdf"
    },
    {
      "document_id": "b2c3d4e5-f6a7-8901-bc23-de45fa678901",
      "filename": "field-notes-images.zip",
      "chunk_count": 18,
      "content_type": "application/zip",
      "created_at": "2024-05-22T14:12:09Z",
      "indexed_at": "2024-05-22T14:45:30Z",
      "indexing_status": "completed",
      "uri": "s3://customer-bucket/user_documents/field-notes-images.zip"
    },
    {
      "document_id": "c3d4e5f6-a7b8-9012-cd34-ef56ab789012",
      "filename": "crop_yield_timeseries.xlsx",
      "chunk_count": 24,
      "content_type": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
      "created_at": "2024-06-01T11:04:18Z",
      "indexed_at": "2024-06-01T11:10:02Z",
      "indexing_status": "completed",
      "uri": "https://storage.example.com/user_documents/crop_yield_timeseries.xlsx"
    }
  ],
  "limit": 10,
  "offset": 0,
  "total_count": 125
}
```

**SDK Code**

```python
import json
import requests

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

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

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

response = requests.get(
    f"{BASE_URL}/v2/collections/{COLLECTION_NAME}/documents",
    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 collection_name = "my_documents";

const headers = {
  Authorization: `Bearer ${API_KEY}`,
};

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

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

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