---
title: "Browse the Masnavi's table of contents"
method: GET
path: "/api/toc"
tags: ["rest"]
---

# Browse the Masnavi's table of contents

`GET /api/toc`

## Request

- Base URL: `https://masnavi.ai`
- URL: `https://masnavi.ai/api/toc`
- Auth: none declared

Returns the named sections (972 across 6 daftars) with beyt counts and global beyt ranges. Optionally restrict to one daftar.

## Query parameters

- `daftar` integer, nullable: Restrict to one daftar.

## Response `200`

Successful Response

- TocResponse
  - `daftar` integer, nullable
  - `nodes` TocNode[], required
    - `id` integer, required
    - `slug` string, required
    - `title_fa` string, required
    - `daftar` integer, required
    - `first_beyt_global` integer, nullable
    - `last_beyt_global` integer, nullable
    - `beyt_count` integer
    - `children` TocNode[]

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/masnavi/apis/masnavi-ai.md) · [All operations](https://skmtc.dev/masnavi/apis/masnavi-ai/llms.txt) · [OpenAPI document](https://skmtc.dev/masnavi/apis/masnavi-ai/revisions/2622163d327c?raw)
