---
title: "Split HTML Content into Chunks"
method: POST
path: "/api/chunk/split"
tags: ["Chunk"]
---

# Split HTML Content into Chunks

`POST /api/chunk/split`

This endpoint receives a single html string and splits it into chunks based on the headings and
body content. The headings are split based on heading html tags. chunk_html has a maximum size
of 256Kb.

## Request body

- ChunkHtmlContentReqPayload
  - `body_remove_strings` string[], nullable — Text strings to remove from body when creating chunks for each page
  - `chunk_html` string, required — The HTML content to be split into chunks
  - `heading_remove_strings` string[], nullable — Text strings to remove from headings when creating chunks for each page

## Response `200`

This will be a JSON response of the chunks split from the HTML content with the headings and body

- SplitHtmlResponse
  - `chunks` ChunkedContent[], required
    - `body` string, required — The body of the content
    - `headings` string[], required — The headings of the content in order of when they appear

## Other responses

- `413` — Payload too large, if the HTML contnet is greater than 256Kb

---

[API](https://skmtc.net/devflowinc/apis/trieve-api.md) · [All operations](https://skmtc.net/devflowinc/apis/trieve-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/devflowinc/trieve-api/revisions/84583e7c9fc1/schema)
