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

# List Chapters

> Get all chapters in a project

## Overview

Retrieve all chapters for a specific project.

## Request

### Path Parameters

<ParamField path="projectId" type="string" required>
  The project ID
</ParamField>

### Headers

<ParamField header="Authorization" type="string" required>
  Bearer token with your API key
</ParamField>

## Response

<ResponseField name="project_id" type="string">
  The project ID
</ResponseField>

<ResponseField name="chapters" type="array">
  Array of chapter objects
</ResponseField>

## Examples

<CodeGroup>
  ```bash curl theme={null}
  curl https://api.babou.ai/api/v1/projects/prj_abc123xyz/chapters \
    -H "Authorization: Bearer $BABOU_API_KEY"
  ```

  ```typescript TypeScript theme={null}
  async function listChapters(projectId: string) {
    const response = await fetch(
      `https://api.babou.ai/api/v1/projects/${projectId}/chapters`,
      {
        headers: {
          'Authorization': `Bearer ${process.env.BABOU_API_KEY}`
        }
      }
    );

    return await response.json();
  }

  const result = await listChapters('prj_abc123xyz');
  console.log(`Project has ${result.chapters.length} chapters`);
  ```

  ```python Python theme={null}
  import os
  import requests

  def list_chapters(project_id):
      response = requests.get(
          f'https://api.babou.ai/api/v1/projects/{project_id}/chapters',
          headers={'Authorization': f'Bearer {os.environ["BABOU_API_KEY"]}'}
      )
      return response.json()

  result = list_chapters('prj_abc123xyz')
  print(f'Project has {len(result["chapters"])} chapters')
  ```
</CodeGroup>

## Response Example

```json theme={null}
{
  "project_id": "prj_abc123xyz",
  "chapters": [
    {
      "id": "cht_def456uvw",
      "project_id": "prj_abc123xyz",
      "name": "Introduction",
      "duration": 30,
      "created_at": "2025-12-02T10:01:00Z",
      "status": "ready",
      "prompt_count": 2
    },
    {
      "id": "cht_ghi789rst",
      "project_id": "prj_abc123xyz",
      "name": "Main Content",
      "duration": 60,
      "created_at": "2025-12-02T10:02:00Z",
      "status": "processing",
      "prompt_count": 1
    }
  ]
}
```

<Note>
  The `status` field is derived from chapter interactions and can be `ready`, `processing`, or `error`. The `prompt_count` field indicates how many prompts have been submitted to the chapter.
</Note>

## Next Steps

<CardGroup cols={2}>
  <Card title="Get Chapter" icon="eye" href="/api-reference/chapters/get">
    Get detailed chapter information
  </Card>

  <Card title="Create Chapter" icon="plus" href="/api-reference/chapters/create">
    Add a new chapter
  </Card>
</CardGroup>
