# Split

Human URL: https://dochorizon.klippa.com/docs/api/document-toolkit/split
Source: https://dochorizon.klippa.com/docs/llms/api/document-toolkit/split.md

> Split a document into multiple documents

---

Use this endpoint to split a document into multiple documents. This endpoint expects a single document object and will return a multitude of document objects as a response.

**POST** `document_toolkit/v1/split`

## How It Works

### Ready Your Document

- [Sending a Document for Capturing](https://dochorizon.klippa.com/docs/llms/api/sending-documents.md): Ready your document and provide it to the endpoint as a document object called `document`. This step also provides you with customization options such as including a filename and setting the document's content type.

### Configure your Output Target

### The output_target Field

The output of this endpoint is one or more PDF or TIFF files, one per page range. You can receive each file as **Base64** data in the response, or have the files stored in the Doxis AI.dp Storage API and receive file IDs instead. Set the `output_target` field to `Base64` (default) or `StorageAPI`.

Both PDF and TIFF support multiple pages in a single file, so a page range that covers several pages produces one multi-page output file for that range. PNG is not available as an output format because the PNG format does not support multiple pages.

### Configure the Page Ranges

### Sending a Document for Capturing

Another optional field you can supply to this endpoint is the **page_ranges** field. If you set its value to a string containing a range of pages, only those pages will be used for the splitting operation. You can use a string format such as '`1,2,5`', '`1-3`', or a combination like '`1-3,5`'. Additionally, you can utilize the words '`first`' and '`last`' to indicate the initial or final page of the document. For example, '`2-last`' refers to all pages starting from the second page to the last page, while '`2-r1`' refers to the second-to-last page. If you do not provide the `page_ranges` field, the endpoint will automatically split the document per page, creating separate documents for each page. By leveraging the flexibility of the page_ranges field, you can precisely control how the document is split, tailoring it to your specific needs and preferences.

### Request & Response

- [API Reference](https://dochorizon.klippa.com/docs/llms/api/reference/document-toolkit/split.md): Once the JSON is ready, send it as a payload in a **POST** message to the endpoint url and obtain information from the API. View the API reference of this endpoint to learn more about the possible in- and output JSONs.

### Split

**POST** `document_toolkit/v1/split`

```json
{
    "document": {
        "data": "{base64-string-of-your-document}"
    },
    "output_target": "Base64"
}
```