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

# Section

> Generate a hierarchical table of contents from a parsed document (Preview).

Use the [ADE Section API](https://docs.landing.ai/api-reference/tools/ade-section.md) to generate a hierarchical table of contents (TOC) from a parsed document.

ADE Section analyzes the semantic structure of your document and returns a flat, reading-order list of sections and subsections, each with a title, hierarchy level, section number, and a reference to the starting chunk in the parsed document.

![Section in the Playground](https://mintcdn.com/landingaitest/GuvdNoFKBmKF6N1M/images/section-playground.png?fit=max\&auto=format\&n=GuvdNoFKBmKF6N1M\&q=85\&s=66641f075732a5c506d7cc30df34bb3b)

> [!NOTE]
>
> ADE Section is in Preview. This feature is still in development and may not return accurate results. Do not use this feature in production environments.

## Example Use Cases

Use ADE Section in workflows that need to navigate, scope, or retrieve content by section:

* **Extraction pipelines**: Scope extraction queries to specific sections of a document (for example, "extract all tables in the Claims section").
* **RAG and search**: Use section-aware chunking instead of sliding-window chunking for more relevant retrieval results.
* **Document review**: Generate a navigable TOC for long documents such as insurance policies, contracts, reports, and technical manuals.
* **Cross-document analysis**: Process large document batches and compare structure across a corpus.
* **LLM applications**: Provide context windows organized by section rather than arbitrary token splits.

## How It Works

ADE Section accepts the Markdown output from ADE Parse (which contains [reference anchors](https://docs.landing.ai/ade/ade-markdown-response.md#anchor-tags)) and returns a structured table of contents.

ADE Section automatically infers the document's hierarchy. You can also pass an optional `guidelines` parameter to control how sections are grouped.

The response includes two formats for the same TOC:

* **`table_of_contents`**: A structured JSON array for programmatic use
* **`table_of_contents_md`**: A Markdown-formatted TOC you can prepend to the document for navigation

> [!NOTE]
>
> The TOCs that ADE Section generates are in English, regardless of the source document language.

## Run Parse First

The ADE Section API requires the Markdown output from the [ADE Parse API](https://docs.landing.ai/api-reference/tools/ade-parse.md) as input. The Markdown must contain [reference anchors](https://docs.landing.ai/ade/ade-markdown-response.md#anchor-tags) (`<a id="..."></a>`) that ADE Section uses to map sections back to specific chunks in the original document.

## Section in the Playground

Use the [Playground](https://ade.landing.ai) to test sectioning visually before incorporating it into your code. Upload a document, review the generated table of contents, and adjust the structure if needed.

When the table of contents matches your use case, use the generated script with the [API](#section-with-the-api), [Python library](https://docs.landing.ai/ade/ade-python.md#section-getting-started), or [TypeScript library](https://docs.landing.ai/ade/ade-typescript.md#section-getting-started) to section documents at scale.

1. Go to the [Playground](https://ade.landing.ai).
2. Open a project and upload the file you want to section. Parse runs first.
3. After parsing completes, click **+ Tool** in the top toolbar and select **Section**. ADE Section runs on every parsed file in the project. Section will run also automatically on any files later uploaded to the project.
4. In the **Results** panel, review the generated table of contents. The header shows the number of top-level sections, the number of subsections, and the maximum depth.
5. Hover over a section in the tree to highlight its chunks in the document viewer. Click a section to filter the viewer to just that section's chunks. Click the section again to restore the full view.
6. You can toggle between a visual representation of the results (**Formatted**) and the actual API JSON response (**JSON**).
7. (Optional) Enter natural-language instructions refining the sectioning in the **Guidelines** text box and click **Update and Run**. For more details, go to [Refine the Table of Contents with Guidelines](#refine-the-table-of-contents-with-guidelines).
8. Once the structure matches your use case, [get a ready-to-use script](#get-a-ready-to-use-section-script).

### Refine the Table of Contents with Guidelines

To adapt the structure to your use case, pass a natural-language guideline to control how ADE Section groups content. Guidelines are optional and apply per file. Only the most recent guideline for a file is kept; submitting a new guideline replaces the previous result.

To submit a guideline:

1. Go to the [Playground](https://ade.landing.ai/) and open a project that has Section enabled.
2. Select the file you want to refine.
3. At the bottom of the **Section** panel, click **Add Custom Section Guidelines (Optional)** to expand that panel.
4. Enter natural-language instructions or click one of the suggestions to prefill the input.
5. Click **Update and Run**. ADE Section regenerates the table of contents for the selected file using your guideline.

   ![Submit Section Guidelines](https://mintcdn.com/landingaitest/GuvdNoFKBmKF6N1M/images/section-guidelines.png?fit=max\&auto=format\&n=GuvdNoFKBmKF6N1M\&q=85\&s=2c9436924ed27c49fc4a9d421cf6b445)

### Get a Ready-to-Use Section Script

After you create a table of contents, Agentic Document Extraction generates a script to section files using the current guideline (if any). The Playground provides two versions: one for calling the API directly, and one for the [ade-python library](https://docs.landing.ai/ade/ade-python.md).

**To get the script:**

1. Go to the [Playground](https://ade.landing.ai/).
2. Open a project.
3. Click the **Section** tab.
4. Click **Get Code**.

   ![Get the Code](https://mintcdn.com/landingaitest/GuvdNoFKBmKF6N1M/images/section-get-code-1.png?fit=max\&auto=format\&n=GuvdNoFKBmKF6N1M\&q=85\&s=59721ce030aa986c588cfefa976da231)
5. The **View Code** pop-up opens. Click the **Library** or **API** tab to see the code for each method.
6. Click the **Download** or **Copy** buttons to get the code.

   ![View the Code](https://mintcdn.com/landingaitest/GuvdNoFKBmKF6N1M/images/section-get-code-2.png?fit=max\&auto=format\&n=GuvdNoFKBmKF6N1M\&q=85\&s=48a10db1b2a904fb1b00213fbc88ea5d)

## Section with the API

Section a document by calling the [ADE Section](https://docs.landing.ai/api-reference/tools/ade-section.md) endpoint.

```shell theme={null}
curl -X POST 'https://api.va.landing.ai/v1/ade/section' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -F 'markdown=@parsed_output.md' \
  -F 'model=section-latest'
```

### Parameters

Get the full parameters from the [API reference](https://docs.landing.ai/api-reference/tools/ade-section.md).

| Parameter | Required | Description |
| :- | :- | :- |
| `markdown` | Required if `markdown_url` omitted | The Markdown output from the [ADE Parse API](https://docs.landing.ai/api-reference/tools/ade-parse.md). Accepts a file upload or a raw string. |
| `markdown_url` | Required if `markdown` omitted | A URL pointing to a Markdown file to fetch and section. |
| `guidelines` | Optional | Natural-language instructions that control how the hierarchy is built. When omitted, the API infers structure automatically. Examples:  • `"Treat each numbered article as a top-level section"` • `"Create a flat structure, no more than 2 levels deep"` • `"Separate the introduction and appendices from the main body"` |
| `model` | Optional | The section model version to use. If omitted, the API uses the latest model. For more information, see [Section Model Versions](https://docs.landing.ai/ade/ade-section-models.md). |

For detailed information about the API response, go to [JSON Response for Sectioning](https://docs.landing.ai/ade/ade-section-response.md).

> [!NOTE]
>
> For credit consumption rates, see [Credit Consumption](https://docs.landing.ai/ade/ade-credit-consumption.md#credit-costs-for-the-section-api).

## Use Section with Our Libraries

Click one of the tiles below to learn how to use the [ADE Section](https://docs.landing.ai/api-reference/tools/ade-section.md) API with our libraries.

> [card] [Python Library](https://docs.landing.ai/ade/ade-python.md#section-getting-started)
>
> Use ADE Section with our Python library.

> [card] [TypeScript Library](https://docs.landing.ai/ade/ade-typescript.md#section-getting-started)
>
> Use ADE Section with our TypeScript library.

## Share Your Feedback

ADE Section is in public preview and we are actively looking for feedback to improve it. To share your experience, [schedule a feedback session with us](https://landing-ai.zoom.us/zbook/landingai-fatimasalehbhai/landingai-ade-feedback).

Come prepared to discuss:

* What is working well
* Any challenges you've encountered and how the feature could improve
* The email address for your Agentic Document Extraction account, found in your [profile page](https://ade.landing.ai/settings/personal/profile)
* The documents you used
* The code you used


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.