Update an ebook
update_ebookEdit an existing Unplain ebook: its design, its cover, its table of contents, its CTA page, the dashboard name, and the body. RESTYLING happens here, not through separate setters: 'brandThemeId', then 'preset', then 'theme' (individual colours, fonts, type sizes and spacing), then 'cover.style', applied in that order in one atomic write, so "make it feel like an independent literary journal" is a single call. get_design_options lists the valid values; get_ebook reports the current ones under theme.design, in the same field names this tool accepts. 'cta' is the CTA page Unplain adds at the end: its layout, headline, body, button label, link and showButton switch (false, or an empty label, hides the button), social links and the footer credit switch, the same fields as the editor's CTA settings. A shown button needs a real url: with none, one Unplain cannot link to, or the placeholder https://example.com it is left out of the PDF, and warnings say so. Send only the keys to change; the rest stay as they are. Edit the body EITHER with 'operations' (precise block edits by block id, from get_ebook, applied atomically) OR with 'content' (replace the whole body with new Markdown), never both. Pass the 'version' from get_ebook so the update is rejected rather than silently overwriting a change made in the web app in the meantime. Nothing is written unless every part of the call is valid.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cta | No | The CTA page Unplain adds at the end of the ebook: its layout, headline, body, button (and whether it is shown), the address the button opens, the social links and the footer credit switch. Unplain writes this page, so it takes no part of the document and never counts toward the free plan's page limit. Send only what should change; every key left out stays as it is. | |
| toc | No | Table of contents. A guide of more than a few sections reads better with one. | |
| name | No | dashboard name | |
| cover | No | ||
| theme | No | Individual theme properties for THIS ebook only, applied on top of any preset or Brand Theme in the same call. Every field is optional; send only what you want to change. | |
| title | No | ||
| author | No | ||
| preset | No | Apply a built-in Unplain preset as the starting look (colors, fonts, type scale, corner radius, cover layout, footer). Content is never touched. Combine with 'theme' to adjust individual properties on top. See get_design_options for what each preset looks like. | |
| content | No | replace the entire body with this Markdown. Cannot be combined with operations. | |
| version | No | the version returned by get_ebook. Strongly recommended: the update is then rejected rather than applied if the ebook changed in the meantime. | |
| subtitle | No | ||
| projectId | Yes | ||
| operations | No | block-level edits, applied in order and atomically. A block rewritten with set_text or set_items keeps its treatment (see get_ebook) only if the new text still qualifies, for example a stat must stay a short figure like "47%" or "$2.4M ARR"; otherwise it returns to standard styling and warnings name it. A statCaption also loses its treatment when the block above it stops being its stat (rewritten, deleted, moved, or a block inserted between). No operation adds a treatment. | |
| brandThemeId | No | Apply one of the caller's saved Brand Themes, from list_brand_themes: its colors, fonts, logo and social links. Use this when the user says "my brand" or names their company. Applied BEFORE preset and theme, so those can adjust it. |