---
title: "Create a book and asynchronously generate its pages and cover."
method: POST
path: "/api/v1/books"
tags: ["Books"]
---

# Create a book and asynchronously generate its pages and cover.

`POST /api/v1/books`

## Request

- Base URL: `https://coloringbookify.com`
- URL: `https://coloringbookify.com/api/v1/books`
- Auth: HTTP bearer

Each requested coloring or special page consumes one credit; automatically generated covers and structural pages do not.

## Headers

- `Idempotency-Key` string, required

## Request body

- BookCreateInput
  - `book` object, required
    - `title` string, required
    - `description` string, required
    - `additional_instructions` string
    - `aspect` 'square' | 'portrait' | 'landscape'
    - `level` string
    - `privacy` string
    - `border_type` string
    - `outline_weight` string
    - `cover_style` string
    - `include_test_color_page` boolean
    - `language` string
    - `style_template_key` string
    - `style_prompt` string
    - `dedication_text` string
    - `ending_text` string
    - `reference_image` string, binary
    - `character_ids` string[]
    - `pages` object[], required
      - `title` string
      - `template_data` object

## Response `202`

Book generation accepted.

- object
  - `data` Operation, required
    - `id` string
    - `action` 'character.create' | 'character.regenerate' | 'book.create' | 'page.create' | 'page.regenerate'
    - `status` 'queued' | 'running' | 'succeeded' | 'partially_succeeded' | 'failed'
    - `credits` object
      - `charged` integer
      - `refunded` integer
    - `progress` object
    - `resource` object
      - `type` string
      - `id` string
      - `link` string
    - `error` object
      - `code` string
      - `message` string
    - `created_at` string, date-time
    - `started_at` string, date-time, nullable
    - `finished_at` string, date-time, nullable
    - `links` Links
  - `resource` object, required
    - `id` string
    - `title` string, nullable
    - `description` string, nullable
    - `language` string
    - `aspect` 'square' | 'portrait' | 'landscape'
    - `level` string
    - `privacy` string
    - `outline_weight` string
    - `cover_style` string
    - `page_count` integer
    - `character_ids` string[]
    - `cover_page_id` string, nullable
    - `back_page_id` string, nullable
    - `pages` Page[]
      - `id` string
      - `title` string
      - `description` string, nullable
      - `status` string
      - `kind` string
      - `aspect` string
      - `level` string
      - `privacy` string
      - `outline_weight` string
      - `character_ids` string[]
      - `book_ids` string[]
      - `image_format` string
      - `book_index` integer, nullable
      - `error` 'Generation failed.'
      - `created_at` string, date-time
      - `updated_at` string, date-time
      - `links` Links
    - `created_at` string, date-time
    - `updated_at` string, date-time
    - `links` Links

## Other responses

- `400`: Invalid request or idempotency key
- `401`: Bearer API key missing or invalid
- `402`: Not enough credits
- `403`: Active Business plan required
- `409`: Idempotency
- `422`: Validation failed

---

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