> ## Documentation Index
> Fetch the complete documentation index at: https://apidocs.fifteenth.com/llms.txt
> Use this file to discover all available pages before exploring further.

# List Documents

> Retrieve all documents for a client account with filtering options

## Overview

The List Documents endpoint returns all documents associated with a client account. Supports filtering by tax year and pagination for efficient document management.

## Request

### Path Parameters

<ParamField path="account_id" type="number" required>
  Account identifier to list documents for.
</ParamField>

### Query Parameters

<ParamField query="tax_year" type="integer">
  Filter by tax year.
</ParamField>

<ParamField query="limit" type="integer">
  Number of documents to return (1-100, default 50).
</ParamField>

<ParamField query="offset" type="integer">
  Number of documents to skip for pagination.
</ParamField>

## Response

<ResponseField name="documents" type="array">
  Array of document objects.
</ResponseField>

<ResponseField name="total_count" type="integer">
  Total number of documents matching filters.
</ResponseField>

<ResponseField name="has_more" type="boolean">
  Whether more documents are available.
</ResponseField>

## Examples

<CodeGroup>
  ```python Python theme={null}
  import requests

  account_id = "12345"
  url = f"https://api.fifteenth.com/v1beta/accounts/{account_id}/documents"

  headers = {
      "Authorization": "Bearer 15th_your_api_key_here"
  }

  params = {
      "tax_year": 2024,
      "limit": 20
  }

  response = requests.get(url, headers=headers, params=params)
  data = response.json()

  print(f"Found {data['total_count']} documents")
  for doc in data['documents']:
      print(f"- {doc['filename']}: {doc['tax_year']} ({doc['uploaded_at']})")
  ```

  ```javascript JavaScript theme={null}
  const accountId = '12345';
  const url = `https://api.fifteenth.com/v1beta/accounts/${accountId}/documents`;

  const params = new URLSearchParams({
      tax_year: '2024',
      limit: '20'
  });

  const response = await fetch(`${url}?${params}`, {
      headers: {
          'Authorization': 'Bearer 15th_your_api_key_here'
      }
  });

  const data = await response.json();

  console.log(`Found ${data.total_count} documents`);
  data.documents.forEach(doc => {
      console.log(`- ${doc.filename}: ${doc.tax_year} (${doc.uploaded_at})`);
  });
  ```

  ```bash cURL theme={null}
  curl -X GET "https://api.fifteenth.com/v1beta/accounts/12345/documents?tax_year=2024&limit=20" \
    -H "Authorization: Bearer 15th_your_api_key_here"
  ```
</CodeGroup>

### Sample Response

```json theme={null}
{
  "documents": [
    {
      "id": 12345,
      "filename": "w2_2024.pdf",
      "tax_year": 2024,
      "description": "W-2 from ABC Corporation",
      "uploaded_at": "2024-01-15T10:35:00Z"
    },
    {
      "id": 67890,
      "filename": "1099_div.pdf",
      "tax_year": 2024,
      "description": "Dividend income statement",
      "uploaded_at": "2024-01-16T14:20:00Z"
    }
  ],
  "total_count": 8,
  "has_more": false
}
```
