---
title: "Split EPUB into chapters, or pull a chapter range out as one EPUB"
method: POST
path: "/split"
---

# Split EPUB into chapters, or pull a chapter range out as one EPUB

`POST /split`

## Request

- Base URL: `https://epublys.com/v1`
- URL: `https://epublys.com/v1/split`
- Auth: HTTP bearer

With chapterStart and/or chapterEnd the result is ONE EPUB (contentType application/epub+zip) of exactly those chapters, in order, with the book’s metadata, a table of contents limited to them and the fonts and images they use. Without a range the result is a ZIP (application/zip) holding one EPUB per chapter.

## Request body

- object
  - `file` string, required: Base64-encoded EPUB
  - `name` string: Original filename — the output is named after its stem (e.g. "Book.epub" gives "Book (compressed).epub"); without it the output keeps a fixed name
  - `chapterStart` integer: First chapter to include (1-indexed). Giving either bound returns one EPUB of the range instead of a ZIP
  - `chapterEnd` integer: Last chapter to include (inclusive)
  - `keepMetadata` boolean: Preserve the original author, publisher and description in the output

## Response `200`

Success — JSON envelope with the base64-encoded output file

- FileResult
  - `success` boolean
  - `file` string: Base64-encoded output file
  - `filename` string
  - `contentType` string
  - `message` string
  - `pro_tip` string: Present on free-tier responses only

## Other responses

- `400`: Invalid input — human message in `error`, machine category in `code`
- `401`: Missing or invalid API key
- `413`: Upload exceeds the per-request total cap
- `429`: Rate limited
- `500`: Processing failure

---

[API](https://skmtc.dev/epublys/apis/epublys-api.md) · [All operations](https://skmtc.dev/epublys/apis/epublys-api/llms.txt) · [OpenAPI document](https://skmtc.dev/epublys/apis/epublys-api/revisions/b705f822c814?raw)
