apyhub
Back

Generate EPUB & DOCX Manuscript Files API

What it does

Manuscript Files generates publishing-ready EPUB and DOCX manuscripts from structured chapter content. Send a book title, chapter titles, and rich text blocks, and get back document files formatted for ebook or manuscript workflows.

Use Manuscript Files when you need to turn editorial content into distributable book formats without hand-building layouts. The EPUB endpoint accepts bookTitle, authorNames, language, chapters, and optional metadata such as isbn, eisbn, subtitle, publisherName, copyrightYear, stableId, watermark, epigraphBlocks, dedicationBlocks, and coverImageDataUri. Chapter content supports paragraphs, headings, images, lists, tables, and scene breaks, with inline styling like bold, italic, underline, superscript, subscript, color, alignment, and line height.

The DOCX endpoint is built for manuscript output. It accepts bookTitle, byline, authorLegalName, and chapters, with optional contact fields like authorEmail, authorPhone, authorAddress, plus watermark. If you are exporting a novel draft, submitting a review copy, or assembling chaptered nonfiction from a CMS, this lets you generate consistent files from the same content model.

Use the EPUB output for ebook distribution and the DOCX output for editorial review, publishing handoff, or print preparation. The service is a fit when your app already has structured chapter data and you want document generation without manual formatting.

▣ ENDPOINT 01 / 02
POST
Publishing: epub
https://api.eu.apyhub.com/freedailypro/generate-epub-docx-manuscript-files/epub

QUICKSTART

GUIDE

Quickstart

Generate an EPUB manuscript from your book metadata, chapters, and optional front/back matter in one POST request.

curl -X POST "https://api.eu.apyhub.com/freedailypro/generate-epub-docx-manuscript-files/epub" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "bookTitle": "The Last Lighthouse",
    "authorNames": ["Avery Stone"],
    "language": "en",
    "chapters": [
      {
        "title": "Chapter 1",
        "blocks": [
          {
            "type": "paragraph",
            "runs": [
              {
                "text": "The sea was calm that morning."
              }
            ]
          }
        ]
      }
    ]
  }'

What you'll get back

Returns the e-book file itself as binary file

TRY ITLIVE · 10 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
body*
chapters*
chapters-1*
blocks*
blocks-0*
runs*
runs-1*
authorNames*

About this endpoint

What it does

Generates an EPUB manuscript file from the book metadata and content you send in the request body. The input includes required book title, author names, language, and chapter content, and the success response schema is an object with no documented properties.

Request Body

ParameterTypeMandatoryDescription
isbnStringNoOptional ISBN identifier, maximum length 50.
eisbnStringNoOptional electronic ISBN identifier, maximum length 50.
chaptersObject ArrayYesChapter objects, minimum 1 and maximum 100 items.
Each chapter must include title and blocks.
title: String, 1-300 characters.
blocks: array of content blocks, minimum 1 and maximum 800 items.
chapters[].titleStringYesChapter title, 1-300 characters.
chapters[].blocksObject ArrayYesChapter content blocks, minimum 1 and maximum 800 items.
Allowed block types: paragraph, heading, image, list, table, sceneBreak.
chapters[].blocks[].typeENUMYesBlock type. Allowed values: paragraph, heading, image, list, table, sceneBreak.
chapters[].blocks[].runsObject ArrayYes (if block type is paragraph or heading)Inline text runs for paragraph and heading blocks.
Each run must include text and may include formatting fields such as bold, italic, underline, subscript, superscript, and color.
See schema for nested fields.
chapters[].blocks[].levelNumberYes (if block type is heading)Heading level. Allowed values: 1, 2, 3, 4.
chapters[].blocks[].alignENUMNoText alignment. Allowed values: left, center, right, justify.
chapters[].blocks[].lineHeightStringNoLine height as a numeric string matching ^[0-9](\\.[0-9]+)?$.
chapters[].blocks[].dataUriStringYes (if block type is image)Image data URI, 1-15,000,000 characters.
chapters[].blocks[].altStringNoAlternative text for the image, maximum length 500.
chapters[].blocks[].captionStringNoImage caption, maximum length 500.
chapters[].blocks[].widthFracNumberNoImage width fraction between 0.1 and 1.
chapters[].blocks[].orderedBooleanYes (if block type is list)Whether the list is ordered.
chapters[].blocks[].itemsObject ArrayYes (if block type is list)List items, minimum 1 and maximum 300 items.
Each list item is an array of text runs; each run requires text.
chapters[].blocks[].rowsObject ArrayYes (if block type is table)Table rows, minimum 1 and maximum 200 items.
Each row includes cells; each row can also include header.
chapters[].blocks[].rows[].cellsObject ArrayYesTable cells for the row, minimum 1 and maximum 30 items.
Each cell is an array of text runs; each run requires text.
chapters[].blocks[].rows[].headerBooleanNoMarks the row as a header row.
chapters[].blocks[].typeENUMYesBlock type. Allowed values: paragraph, heading, image, list, table, sceneBreak.
chapters[].partTitleStringNoOptional part title for the chapter, maximum length 300.
languageStringYesLanguage code or identifier, 2-10 characters.
stableIdStringNoOptional stable identifier, maximum length 200.
subtitleStringNoOptional subtitle, maximum length 300.
bookTitleStringYesBook title, 1-300 characters.
watermarkBooleanNoWhether to include a watermark.
authorNamesString ArrayYesAuthor names, minimum 1 and maximum 50 items.
Each name must be 1-200 characters.
copyrightYearIntegerNoCopyright year between 1500 and 3000.
publisherNameStringNoPublisher name, maximum length 300.
epigraphBlocksObject ArrayNoOptional epigraph content blocks, minimum 1 and maximum 800 items.
Allowed block types: paragraph, heading, image, list, table, sceneBreak.
copyrightHolderStringNoCopyright holder name, maximum length 300.
dedicationBlocksObject ArrayNoOptional dedication content blocks, minimum 1 and maximum 800 items.
Allowed block types: paragraph, heading, image, list, table, sceneBreak.
coverImageDataUriStringNoCover image data URI, maximum length 15,000,000 characters.

Response

Returns the e-book file itself as binary file.

▣ ENDPOINT 02 / 02
POST
Publishing: manuscript-docx
https://api.eu.apyhub.com/freedailypro/generate-epub-docx-manuscript-files/manuscript-docx

QUICKSTART

GUIDE

Quickstart

Generate a DOCX manuscript file from a book title, author name, and at least one chapter.

curl -X POST "https://api.eu.apyhub.com/freedailypro/generate-epub-docx-manuscript-files/manuscript-docx" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "bookTitle": "The Last Lantern",
    "byline": "A novel by Mira Sol",
    "authorLegalName": "Mira Sol",
    "chapters": [
      {
        "title": "Chapter 1",
        "blocks": [
          {
            "type": "heading",
            "level": 1,
            "runs": [
              {
                "text": "A New Beginning"
              }
            ]
          },
          {
            "type": "paragraph",
            "runs": [
              {
                "text": "The story begins on a quiet evening."
              }
            ]
          }
        ]
      }
    ]
  }'

What you'll get back

Response

Returns the manuscript as a Word file in binary form

TRY ITLIVE · 10 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.

About this endpoint

What it does

Generates a DOCX manuscript from the submitted book metadata and chapter content, based on the request body schema. The endpoint accepts structured chapter blocks such as paragraphs, headings, images, lists, tables, and scene breaks.

Request Body

ParameterTypeMandatoryDescription
bookTitleStringYesTitle of the book. String, 1 to 300 characters.
bylineStringYesByline for the manuscript. String, 1 to 300 characters.
authorLegalNameStringYesAuthor’s legal name. String, 1 to 300 characters.
chaptersObject ArrayYesArray of chapters. Each chapter must include title and blocks. Maximum 100 chapters.
chapters[].titleStringYesChapter title. String, 1 to 300 characters.
chapters[].partTitleStringNoPart title for the chapter. String, up to 300 characters.
chapters[].blocksObject ArrayYesArray of content blocks for the chapter. Each block must be one of the supported block shapes below. Minimum 1 block per chapter.
chapters[].blocks[].typeENUMYesBlock type. Allowed values: paragraph, heading, image, list, table, sceneBreak.
chapters[].blocks[].runsObject ArrayYes (if type is paragraph or heading)Text runs for paragraph or heading blocks. Each run contains styled text. Minimum 1 run.
chapters[].blocks[].runs[].textStringYesText content of the run. Minimum 1 character.
chapters[].blocks[].runs[].boldBooleanNoWhether the run is bold.
chapters[].blocks[].runs[].italicBooleanNoWhether the run is italic.
chapters[].blocks[].runs[].underlineBooleanNoWhether the run is underlined.
chapters[].blocks[].runs[].subscriptBooleanNoWhether the run is subscript.
chapters[].blocks[].runs[].superscriptBooleanNoWhether the run is superscript.
chapters[].blocks[].runs[].colorStringNoText color as a hex value matching ^#[0-9a-fA-F]{3,8}$.
chapters[].blocks[].alignENUMNoAlignment for paragraph or heading blocks. Allowed values: left, center, right, justify.
chapters[].blocks[].lineHeightStringNoLine height as a decimal string matching ^[0-9](\\.[0-9]+)?$.
chapters[].blocks[].levelNumberYes (if type is heading)Heading level. Allowed values: 1, 2, 3, 4.
chapters[].blocks[].dataUriStringYes (if type is image)Image data URI. String, 1 to 15,000,000 characters.
chapters[].blocks[].altStringNoAlternative text for the image. Up to 500 characters.
chapters[].blocks[].captionStringNoImage caption. Up to 500 characters.
chapters[].blocks[].widthFracNumberNoImage width fraction. Minimum 0.1, maximum 1.
chapters[].blocks[].orderedBooleanYes (if type is list)Whether the list is ordered.
chapters[].blocks[].itemsString ArrayYes (if type is list)List items, grouped as nested text-run arrays in the schema. Minimum 1 item, maximum 300 items.
chapters[].blocks[].items[][].textStringYesText content for a list item run. Minimum 1 character.
chapters[].blocks[].items[][].boldBooleanNoWhether the list item run is bold.
chapters[].blocks[].items[][].italicBooleanNoWhether the list item run is italic.
chapters[].blocks[].items[][].underlineBooleanNoWhether the list item run is underlined.
chapters[].blocks[].items[][].subscriptBooleanNoWhether the list item run is subscript.
chapters[].blocks[].items[][].superscriptBooleanNoWhether the list item run is superscript.
chapters[].blocks[].items[][].colorStringNoText color as a hex value matching ^#[0-9a-fA-F]{3,8}$.
chapters[].blocks[].rowsObject ArrayYes (if type is table)Table rows. Minimum 1 row, maximum 200 rows.
chapters[].blocks[].rows[].cellsString ArrayYesTable cells for the row, grouped as nested text-run arrays in the schema. Each row must include at least 1 cell and at most 30 cells.
chapters[].blocks[].rows[].headerBooleanNoWhether the row is a header row.
chapters[].blocks[].rows[].cells[][].textStringYesText content for a table cell run. Minimum 1 character.
chapters[].blocks[].rows[].cells[][].boldBooleanNoWhether the table cell run is bold.
chapters[].blocks[].rows[].cells[][].italicBooleanNoWhether the table cell run is italic.
chapters[].blocks[].rows[].cells[][].underlineBooleanNoWhether the table cell run is underlined.
chapters[].blocks[].rows[].cells[][].subscriptBooleanNoWhether the table cell run is subscript.
chapters[].blocks[].rows[].cells[][].superscriptBooleanNoWhether the table cell run is superscript.
chapters[].blocks[].rows[].cells[][].colorStringNoText color as a hex value matching ^#[0-9a-fA-F]{3,8}$.
chapters[].blocks[].typeENUMYesBlock type. For sceneBreak, no additional fields are defined.
watermarkBooleanNoWhether to apply a watermark.
authorEmailStringNoAuthor email address. Up to 300 characters.
authorPhoneStringNoAuthor phone number. Up to 100 characters.
authorAddressStringNoAuthor address. Up to 500 characters.

Response

Returns the manuscript as a Word file in binary form

▣ COMMON ERRORS

Errors any endpoint can return

400bad_request

Required parameter missing or malformed body.

401unauthorized

API key missing, revoked, or not authorized for this service.

429rate_limited

Your plan's per-second rate exceeded. Retry with exponential backoff.

503upstream_busy

Backend temporarily unavailable. Try again in a few seconds.