The ariach API

עברית

Everything the studio does — for a program and for an AI assistant: the user's books, new ones (blank, from the library, from a Word file), the studio assistant's actions on a book, its versions, pictures of its pages, and its PDF at the studio's prices.

Quick start

Make a key in the studio: account → «חיבורים ומפתחות» (Connections and keys), choose its scopes and copy it (it is shown once). Every request carries it:

Who am I

curl https://api.ariach.com/v1/me \
  -H "Authorization: Bearer $ARIACH_KEY"

A new book from a Word file (a job: 202 with the job's address)

curl https://api.ariach.com/v1/books \
  -H "Authorization: Bearer $ARIACH_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -F file=@book.docx

Follow the job until it ends

curl https://api.ariach.com/v1/jobs/<job id> \
  -H "Authorization: Bearer $ARIACH_KEY"

The book's PDF (not paid for: a sample of its first pages, and where it is paid for in the studio)

curl https://api.ariach.com/v1/books/<book id>/exports \
  -H "Authorization: Bearer $ARIACH_KEY" \
  -H "Content-Type: application/json" \
  -d '{"format":"pdf"}'

The MCP server — for AI assistants

The same tools, for an assistant talking with the user. One address; the user approves it in their own account (OAuth). Before each series of changes to a book a version is saved, and a window in the conversation shows the pages and uploads Word files.

Claude (web and apps): Settings → Connectors → Add custom connector, with the address:

https://mcp.ariach.com/mcp

Claude Code:

claude mcp add --transport http ariach https://mcp.ariach.com/mcp

ChatGPT: Settings → Apps & Connectors → Create, with the address above.

Rules every request keeps

AuthenticationAuthorization: Bearer <key> — a key from the studio, or an OAuth 2.1 access token (authorization code with PKCE). A request without the scope it needs: 403 insufficient-scope naming it.
ErrorsRFC 9457 (application/problem+json): type is a page explaining the problem, title in the user's language, and on a field's error errors for each field.
Done onceEvery POST that creates takes an Idempotency-Key: the same key again within 24 hours gives the first answer again, and does nothing twice.
RateEvery answer has RateLimit and RateLimit-Policy — what is left; past it, 429 with Retry-After.
JobsA long one (a new book, a file) answers 202 with the job and Location; follow it, or get a webhook at its end.
PaymentA book is paid for in the studio, at the studio's prices — the API never charges or pays. A book not paid for exports a sample with pay_url.

Scopes

books:readRead the user's books, their versions and pages, and run the read-only actions
books:writeMake, rename and trash books, run the actions that change a book, save and restore versions
exportMake files of a book: the PDF, a proof copy, the cover, InDesign — as the studio's «ייצוא», at the studio's prices
library:readSearch the library (Otzaria) a book is made of
webhooksManage the account's webhook endpoints

Webhooks

When a job ends, a POST to each endpoint that asked for the event, by Standard Webhooks 1.0. Verify the signature, and drop a webhook-id seen before. An answer other than 2xx is tried again for a day; 410 stops the endpoint.

job.succeededA job ended well; data.job is the job, its result what came of it
job.failedA job failed; data.job.problem says why (a problem body, RFC 9457)
book.createdA new book was made (a book.create job succeeded); data.book is the book
export.readyA file of a book is ready (an export job succeeded); data.file is where to download it, for a day

Verifying the signature (Node):

import { createHmac, timingSafeEqual } from "node:crypto"

function verified(headers, body, secret) {
  const id = headers["webhook-id"], ts = headers["webhook-timestamp"]
  if (Math.abs(Date.now() / 1000 - Number(ts)) > 300) return false
  const key = Buffer.from(secret.replace(/^whsec_/, ""), "base64")
  const want = createHmac("sha256", key).update(`${id}.${ts}.${body}`).digest("base64")
  return headers["webhook-signature"].split(" ").some((s) => {
    const [v, sig] = s.split(",")
    return v === "v1" && sig.length === want.length && timingSafeEqual(Buffer.from(sig), Buffer.from(want))
  })
}

Every operation

The whole description · https://api.ariach.com

Account

Who the caller is, and their jobs

GET /v1/me Who the caller is

Answer: 200

GET /v1/jobs The caller's jobs

Parameters

limitinteger1–100
beforestringJobs created before this time (the next link gives it)

Answer: 200

GET /v1/jobs/{id} One job

Answer: 200

Books

The user's books, and new ones

GET /v1/books The user's books books:read

Parameters

qstringWords of the title
sharedstringonly: books shared with the user · none: their own alone
limitinteger
pageinteger

Answer: 200

POST /v1/books A new book books:write

Made as the studio makes a new book: the site's design for a new book; a Word file read by the model as there (part of the week's allowance; ai: false — by the rules alone); the account's limits and book quota as there. A job: follow Location, or a webhook book.created.

Body

NewBook

Answer: 202 · Idempotency-Key

GET /v1/books/{id} One book books:read

Answer: 200

PATCH /v1/books/{id} Rename a book books:write

Body

titlestring

Answer: 200

DELETE /v1/books/{id} Put a book in the trash books:write

The owner alone. The studio's trash gives it back for 30 days.

Answer: 204

Library

The library a book is made of (Otzaria)

GET /v1/library Search the library library:read

Parameters

q *stringWords of the title
limitinteger

Answer: 200

GET /v1/library/commentaries What is linked to a library book library:read

Parameters

book *stringThe library book's id

Answer: 200

Actions

The actions on a book — the studio assistant's own tools. The body: the action's input (its schema in GET /v1/actions).

GET /v1/actions The actions there are

Answer: 200

POST /v1/books/{id}/actions/book_overview book overview books:read

The open book: its title, its texts with the code a search names them by (0 the main text, then each note region), its note regions (index in notes[] and name), its heading levels, its paragraph styles (index, name, their look in a few words — font, size, bold, alignment where the style sets them — and how many paragraphs of the main text are in each; of a style that numbers its paragraphs, automatic_number: in how many the number shows and in how many it is turned off) and character styles (index, name, and a character style's code), whether the open book is a site's sample (open_book) and not the user's, the page count, the pages flagged for review, and whether the settings and the text may be changed here — and headings: each level of the book's headings as the engine laid them out, in a line (how many, how their numbers run — automatic or written in the headings — where they start again, where the run breaks) and the breaks themselves (paragraph, page, the number expected). Call it first when the request names a region, a style or a heading level, or is about the book's headings or their numbers.

Answer: 200

POST /v1/books/{id}/actions/read_settings read settings books:read

The current settings, flat: {path: value} for every setting on the map, by the same paths change_settings takes; a style or part read by its path has its structures with it (para_styles[3].deco — its frame and lines), and a list read whole names them (read_by_their_paths). paths: only the settings under these (para_styles[3], para_styles[3].first_word, page) — prefer it: all the paragraph styles are thousands of words. sections: whole parts (page, main, notes, headings, column_style, note_sep, furniture, styles, para_styles); neither = all.

Body

pathsarray
sectionsarray

Answer: 200

POST /v1/books/{id}/actions/list_fonts list fonts books:read

The fonts there are: slot number (what a font setting holds), Hebrew name, and kind (text / ornament); computer true: a font from the user's computer that the book is set in — the book's own, named by its name and set again by its slot like any other. Choose a font by its name here. named_as: the user's words that name that font, spelt their way or with more to its name («פרנקריל» for «פרנקריהל», «הדסה פרידלנדר» for «הדסה») — it is the font they asked for: set it, and say its name as listed here; where two fonts are named so, ask which (ask_user).

Answer: 200

POST /v1/books/{id}/actions/change_settings change settings books:write

Change settings, all at once, as one step the user can undo. Each change: a path (with indexes: para_styles[0].font, notes[1].numbering.style, furniture.head.items[0].place.dy_mm) and its new value. A value is one setting — of the kind the map gives — or a WHOLE structure as an object (a frame, an ornamented line, a running-head item, a flexibility stage): checked field by field against the engine's schema, fields left out take their defaults, a tagged structure needs its "kind"; null where null has a meaning (no frame, as the main text). A change inside a part that is not set yet (para_styles[0].deco.frame.shape where there is no frame) makes the part from its defaults. Each change is checked — an unknown path or field, a value of the wrong kind or outside its span, a closed setting, settings wrong together — and the engine itself reads the result last; what fails is rejected and said why, the rest applied. Answers what was applied (before → after, in Hebrew), what was rejected, reach (for a change in a paragraph style: how many paragraphs of the main text are in it — all of them changed), the page count before and after, the pages flagged for review — and what the change did to the headings as the engine laid them out: headings_changed (each level that changed, before → after) or headings_unchanged (a change meant for the headings that changed nothing in them). A change of a style's heading level where the text uses the style is shown to the user first as a card, and waits for their approval.

Body

changesarray

Answer: 200 · Idempotency-Key

POST /v1/books/{id}/actions/edit_list edit list books:write

Change one of the settings' lists, as one step the user can undo: "add" an item (value: its fields — those left out take the engine's defaults; a tagged item needs its "kind"; index: where, default at the end), "remove" the item at index, "move" it to place to, or "duplicate" it. list is the list's path: para_styles[i].text.enclosures, notes[0].enclosures, subst.rules, zone.rows, zone.rows[0].slots, furniture.head.items (also furniture.head.even, furniture.foot.items), furniture.head.items[0].what.runs, group_styles, templates, flex.sources (move only), para_styles (remove, duplicate), notes[0].headings, notes[0].styles, templates[0].toc.levels … Guarded as the settings panel guards: a note region or a character style is not added or removed here (their codes are written in the book's text — add_commentary / add_style add one), a part is not added or duplicated here (add_part with part puts its settings and its line in together), a style or a part the text uses is not removed, names stay one of a kind. Answers the item as it now is and its index. To change an item that exists, use change_settings on its path.

Body

liststring
opstringadd · remove · move · duplicate
indexinteger
tointeger
valueadd: the new item (an object; for a list of plain values, the value)

Answer: 200 · Idempotency-Key

POST /v1/books/{id}/actions/describe_settings describe settings books:read

One part of the settings in full, for the parts the map below only names: its structure (every field: Hebrew name, what it may hold, its span or choices, what null means), the structures inside it, its current value, the value a new one starts from, and — where it holds ornaments — the ornaments there are (id and name). path: a part (zone, subst, flex, furniture.head, para_styles[0].deco, note_sep.line, templates[0], para_styles[i].text.enclosures) or one setting. Call it before changing a structure you have not seen in this conversation; not needed for the settings listed on the map.

Body

pathstring

Answer: 200

POST /v1/books/{id}/actions/add_style add style books:write

Add a new style to the book, at once (one step the user can undo). kind "character": a look for words inside a paragraph (given to text with change_text → set_looks.add_style); answers its code and its index in styles[]. kind "paragraph": a look and format for whole paragraphs (given with set_block_kind / set_paragraphs, kind "style"); heading_level n makes it a heading of that level (in the running head and the table of contents); answers its index in para_styles[]. like (a paragraph style's name): the new one a copy of it — its look, format, opening words — so "like «רגיל» but with no space after" is like «רגיל», then the one change; without it a paragraph style starts from the plain defaults (automatic line spacing, no opening words). font (a slot from list_fonts), size ({"pt": n} or {"rel": n} of the text around it), weight, color ("#rrggbb") set its letters now; everything else about it afterwards with change_settings (styles[i].… / para_styles[i].…: columns, format, first_word…).

Body

kindstringcharacter · paragraph
namestringits Hebrew name, as the user would call it (up to 40 characters)
fontinteger
size{"pt": n} or {"rel": n}
weightinteger400 regular, 700 bold: a weight the font has (omit: the font as it is)
colorstring
heading_levelinteger
likestringkind paragraph: the name of a paragraph style of the book to copy

Answer: 200 · Idempotency-Key

POST /v1/books/{id}/actions/list_templates list templates books:read

The site's ready designs. There is no design of a whole book, only designs of each part of its look, each part a library of its own: page — size and margins; fonts; text — the main text; headings; head — the running head and foot; notes; sep — the separator above the notes; zone — where the texts stand on the page (put only on a book with as many note regions as it places); toc — the table of contents; look — the small things of the look, a page's frame and background; title — ready title pages. Answers {part_designs}: id, part, name, about, for (the kinds of book it is marked for: gemara, halacha, chiddushim, drashot, shut, siddur, memorial — a book in memory of a person; left out: none marked), new_book: true (the design of its part a new book takes). A coherent look names several parts together (e.g. text, headings, head and notes): designs marked for the same kind of book, or those of a new book, go together. A design of a part is a look alone and fits any book: it keeps the book's region names, how many heading levels and note regions it has and how its pages are numbered; page only when the page's size was asked for.

Answer: 200

POST /v1/books/{id}/actions/apply_template apply template books:write

Put the site's designs of parts on the book at once (one step the user can undo): parts — [{part, design}], design an id of list_templates' part_designs, one a part; every part not named stays as it is (only the notes' design when asked to design the notes alone). There is no design of a whole book: a whole look names several parts. With changes of your own over them (paths on the map, as change_settings — e.g. to fit this book: a smaller main text, the notes in two columns). Answers as change_settings.

Body

partsarray
changesarray

Answer: 200 · Idempotency-Key

POST /v1/books/{id}/actions/find_blocks find blocks books:read

Paragraphs of the book's main text, by their words (niqqud and quote marks don't matter) and / or kind — h1…h6, p, "heading" (any level), "picture" (the pictures in the text), or "style:<name>" (a paragraph style's): each one's number, kind and opening words, and how many matched in all. By words or a stretch (from…to, or block for one paragraph): at most 30. By a heading kind or a style: up to 150 short lines in one answer, as [paragraph, words] — a level's headings are read in ONE call, never page by page. Use it before changing one paragraph, to have its number and opening words. full true: words whole — block one paragraph (up to 6000 characters), from…to SEVERAL in one call (up to 12000 characters together; more_from says where to go on) — to read paragraphs, never one call per paragraph, never a pattern of .{1,150}. bold ("all", "most", "opening", "some", "none"): the paragraphs by how much of them the reader sees bold — «המודגשים» a user names are most often those bold through ("all"): up to 60 as [paragraph, kind, words], within from…to.

Body

textstring
kindstring
frominteger
tointeger
blockinteger
fullboolean
boldstringby how much of each the reader sees bold, whatever made it so (the bold mark, a bold character style, a bold style, bold first words): "all" — bold through (a line made bold by hand to stand as a sub-heading: «המודגשים», «השורות המודגשות»), "most", "opening" — opens bold, most of it not (a bold lead-in), "some", "none". Alone: of the whole main text (or of paragraphs {from, to}); with others: of those they find. Headings are bold by their style in most books: with blocks ["p"] (find_blocks: kind "p") the plain paragraphs alone

Answer: 200

POST /v1/books/{id}/actions/set_block_kind set block kind books:write

Make a paragraph a heading of a level, a paragraph of a paragraph style, or a plain paragraph again: one by block, starts_with, kind (and style); SEVERAL known paragraphs in ONE call by items — each {block, starts_with, kind, style}, up to 80, each its own kind — all of them or none (each checked first), one step of the undo; answers [paragraph, before, after] for each. For many found by a rule (every paragraph that starts with…, every heading of a level): set_paragraphs.

Body

blockintegerthe paragraph's number from find_blocks (1 = the book's first)
starts_withstringthe paragraph's opening words, as find_blocks gave them — checked, so a paragraph that moved is not the one changed
kindstringh1…h6 = heading level n; p = a plain paragraph; style = a paragraph style of the book, named in style (a centered line is a paragraph style whose format.align is center: use the book's, or add one first)
stylestringwith kind "style": the paragraph style's name (book_overview: paragraph_styles)
itemsarray

Answer: 200 · Idempotency-Key

POST /v1/books/{id}/actions/add_title_page add title page books:write

Add a title page to the book — the only way to make a new one: a part of kind title, at the book's start, in the ready design the site marks for a new book, with the book's name on it — and, where the book has none, the page behind it (kind titleback) as a part of its own right after it, so the text never starts on the title page's back. Whatever the user asks of it — its words, its look, another ready design — is changed from there with change_settings (templates[i].title.lines[j]) or apply_template; never built anew. Answers its index in templates, the design's name and its lines. A book that has a title page: refused, unless name asks for another (a second title page). One step the user can undo.

Body

namestringonly for a second title page: its name

Answer: 200 · Idempotency-Key

POST /v1/books/{id}/actions/bold_title_words bold title words books:write

Make words of a title page's line bold, or of another size (size) — only those words, the rest of the line as it is (templates[i].title.lines[j].bold; never with change_settings: it counts characters) — or plain again (bold false). words: each the words of one stretch, as the line has them ("אלחנן שלמה, ר' יוסף"); found here — a quote or a geresh alike, the spaces, niqqud — every time they stand in the line. line: its index in title.lines (left out: every line of the title page that has them); part: the title page's name (left out: the book's one); only: those words alone bold in the line, any other bold of it removed. Words not on the page: nothing changes, and the lines are said. Answers as change_settings, and lines_now: each line changed, its bold words between **. One step the user can undo.

Body

wordsarraythe words to make bold (or plain), each stretch as the line has it
lineintegerthe line's index in templates[i].title.lines
partstringthe title page's name (templates[i].name), when the book has more than one
boldbooleanfalse: make them plain again (default true)
onlybooleanthese words alone bold in the line
sizenumberthe words' size, a share of the line's own (1.3: larger, 0.8: smaller, 1: the line's again); alone, their weight stays as it is

Answer: 200 · Idempotency-Key

POST /v1/books/{id}/actions/insert_heading insert heading books:write

Add a heading line (h1…h6) before paragraph before — or at the book's end, with before one past the last paragraph. After it, the paragraphs after it are numbered one more. Only a heading: a title page is a part of its own (add_title_page), an ornament at a chapter's end is the heading style's deco.end, a separator of asterisks is insert_separator, and a line of plain text the user adds in the editor.

Body

beforeintegerthe paragraph's number from find_blocks (1 = the book's first)
starts_withstringthe paragraph's opening words, as find_blocks gave them — checked, so a paragraph that moved is not the one changed
textstringthe heading's words (↵: a line break inside it)
kindstringthe heading's level: h1…h6

Answer: 200 · Idempotency-Key

POST /v1/books/{id}/actions/add_part add part books:write

Add a part to the book: its settings (a new item of templates) and its line «--- name ---» in the text, together, in this one call — a part never has settings and no line in the book. A NEW part: name and part, its settings as an item of templates is written (describe_settings templates; left empty {}: a part as the book — a contents: { "toc": {} }); never edit_list on templates for a part (it is refused), and a new title page is add_title_page, a subject index add_index. The part goes before paragraph before, which then opens its text — all of it up to the next part's line (said in the answer). A part whose pages are made (a contents, an index, pages of pictures) takes no text: at a part's first paragraph its line goes before that part's, at its last after it, and inside a part's text that part goes on after it (said in the answer). A blank page there: blank true and nothing else needed (no part; the name is given if left out or taken) — the part holds no text, and the part it stood in goes on after it. A part the settings already have and the text not (an older book): name alone puts its line in. One step the user can undo; the book_overview's parts say which are in the text; to stand elsewhere: move_part; out of the book again: remove_part (its settings go with its line).

Body

namestringthe part's name (a new part: the name it is given)
partobjecta NEW part: its settings, as an item of templates (without name) — {} for a part as the book. Left out for a blank page and for a part the settings already have
beforeintegernot for a title page: the paragraph the part opens before (find_blocks); with blank, left out: at the book's end
starts_withstringthe paragraph's opening words, as find_blocks gave them — checked, so a paragraph that moved is not the one changed
blankbooleana page left blank there, the part holding no text — only when the user asked for an empty page; never in place of a part that holds text (a preface, a contents)

Answer: 200 · Idempotency-Key

POST /v1/books/{id}/actions/edit_heading_text edit heading text books:write

Change the words of a heading (only a paragraph that is already a heading — the body of the text is the user's to edit).

Body

blockintegerthe paragraph's number from find_blocks (1 = the book's first)
starts_withstringthe paragraph's opening words, as find_blocks gave them — checked, so a paragraph that moved is not the one changed
textstringthe heading's new words (↵: a line break inside it — a heading in two lines)

Answer: 200 · Idempotency-Key

POST /v1/books/{id}/actions/set_paragraphs set paragraphs books:write

Give MANY paragraphs of the main text a kind together — a heading level, a paragraph style, plain. Which paragraphs, in where: one or a few by their numbers (paragraphs {from, to} from find_blocks, with starts_with), or a search (the same fields as find_text: every paragraph the search matches in — e.g. match "pattern", text "^סימן \\p{אות}+" for every paragraph that opens with סימן and a letter), or — without text — the paragraphs that are now of the kinds in blocks (p, h1…h6, center) or of paragraph_style, or first_after (["h1","h2"], or ["heading"]: any): the paragraph that opens what each such heading heads — the first after it that is no heading (a heading under it is passed over) — "the first paragraph of each chapter" ("אות גדולה בריש פרק": a style of its own with first_word, given to those alone); bold ("all", "most", "opening", "some", "none"): by how much of each the reader sees bold — alone, of the whole text ("all": the lines made bold through by hand to stand as sub-headings — given a style of their own, which can then be changed together), or of those the others find; paragraphs {from, to} keeps it to a stretch of the book. The user is shown a card — how many paragraphs, some of them, and what it does to the book's structure (headings that stop being headings leave the contents and the running head) — and the call waits until they approve: it answers applied true with the count, or false with what they wrote instead. title: one short Hebrew line saying what will change, for the card.

Body

titlestring
kindstringh1…h6 = heading level n; p = a plain paragraph; style = a paragraph style of the book, named in style (a centered line is a paragraph style whose format.align is center: use the book's, or add one first)
stylestringwith kind "style": the paragraph style's name (book_overview: paragraph_styles)
whereobject

Answer: 200 · Idempotency-Key

POST /v1/books/{id}/actions/remove_paragraphs remove paragraphs books:write

Take whole paragraphs of the main text out of the book together, each with its line — the only way to remove a paragraph (change_text cannot remove a line). Which, in where, as set_paragraphs: one or a few by their numbers (paragraphs {from, to} from find_blocks, with starts_with — the way for a paragraph you have found), or of the kinds in blocks (each level by itself: ["h4","h5"] is those two levels alone) or of paragraph_style, or every paragraph a search matches in; empty true: only paragraphs with no words (alone, or with blocks); paragraphs {from, to}: a stretch. A card shows the user how many and some of them, and the call waits: applied true with removed, or false with what they wrote instead; left_out: what it can't take out and why — a part's line (remove_part), a paragraph a note's sign stands in (remove_notes first). title: one short Hebrew line for the card.

Body

titlestring
whereobject

Answer: 200 · Idempotency-Key

POST /v1/books/{id}/actions/find_text find text books:read

Search the book's texts with the studio's proofing engine (the fields: "How the engine matches" below) — nothing is changed. Answers how many places were found, how many in each text, and up to 10 of them spread over the book, each with the words around it — and what the words alone do not show: looks, the match cut into stretches where part of it is bold or in a character style (absent: all of it plain), and spaces, its spaces by kind, in order, where one is not the regular space (thin, no-break …); given replace or set_looks, also what each would become; mended: what was set right in your wording before it ran (quote marks, examples of more than one paragraph). Use it to answer a question about the text ("כמה פעמים…", "איפה כתוב…"), and ALWAYS before change_text: look at the samples — if they show places that shouldn't be found, or miss ones that should, mend the search and look again. When the user asks to SEE places ("תראה לי איפה…", "איפה מוזכר…", "אילו…"), pass show_user true with a title: they get a card listing the places, each opening its place in the book — then answer in a sentence, without repeating the list.

Body

matchstringexact · spelling · pattern
textstringthe words (exact / spelling) or the expression (pattern); empty with looks alone
whole_wordboolean
prefixesbooleanleft out with whole_word true (not in a pattern): true — the word with its prefix letters; false only for the exact letters
wildcardsboolean
ignoreobject
streamsarraythe texts searched, by code (book_overview: texts; 0 the main text); left out: all
blocksarraykinds of paragraph the search looks in; left out: all. Here h3 is every heading of level 3 AND DEEPER (h4, h5, h6 too) — to act on the headings of one level exactly, use set_paragraphs / remove_paragraphs with where.blocks
paragraphsobject
looksobject
examplesarray3–6 short Hebrew examples the engine runs before the search: where it must match, and a close miss where it must not. Each is one paragraph of plain text, read with the search's own ignore — not by its blocks, streams, looks, paragraphs or the selection: a miss that only those leave out is no example
replacestring,nullthe new text, plain ("" deletes; a pattern's template: $1 …; ¶ a new paragraph; ↵ a line break inside the paragraph, which goes on in the next line); null / left out: the text stays. Bold or a style is set_looks — never * or ** in the text: they are printed as stars
set_looksobject
paragraph_listarrayseveral stretches of paragraphs (numbers from find_blocks) in ONE search — in place of paragraphs; never a call per paragraph
morearraymore words searched the same way (the same match, ignore, place and looks), each with its own replacement (left out: replace's) — several word pairs (מאוד → מאד, כיוון → כיון…) in ONE call and one card; the answer counts each
titlestringwith show_user: the card's title, one short Hebrew line

Answer: 200

POST /v1/books/{id}/actions/change_text change text books:write

Change what a search finds (the search fields: as find_text), everywhere it finds it: other text (replace), or the same text in another look (set_looks: a character style added or removed, bold, source-reference) — the only way the book's words are changed. The user is shown a card — every place, before → after, each opening its place in the book; the places are also marked on the pages — and the call waits until they approve: it answers applied true with how many places were changed (they may leave some places out: then also how many), or false with what they wrote instead (then do what they wrote; don't propose the same again). One undo takes the whole change back. Several word pairs, or several stretches of paragraphs: ONE call (more, paragraph_list), one card. title: one short Hebrew line saying what will change, for the card ("האות שבתחילת כל סעיף — בסגנון «אות סעיף»"). Give examples whenever the search is a pattern.

Body

titlestring
matchstringexact · spelling · pattern
textstring
whole_wordboolean
prefixesboolean
wildcardsboolean
ignoreobject
streamsarray
blocksarray
paragraphsobject
looksobject
examplesarray
replacestring,nullthe new text, plain ("" deletes; a pattern's template: $1 …; ¶ a new paragraph; ↵ a line break inside the paragraph, which goes on in the next line); null / left out: the text stays. Bold or a style is set_looks — never * or ** in the text: they are printed as stars
set_looksobject
paragraph_listarray
morearray

Answer: 200 · Idempotency-Key

POST /v1/books/{id}/actions/insert_text insert text books:write

Put text THE USER wrote or pasted in this conversation (an index, an introduction, a list they gave) into the book's main text as paragraphs, word for word — never a text of your own (checked: what is not theirs is refused). text: their text, a paragraph a line; before: the paragraph it goes before (find_blocks), with starts_with; left out — at the book's end; part: a part's name (templates[i].name) whose line «--- name ---» opens it, when it is defined and not in the text yet (an index: define a part of kind index first with edit_list). title: one short Hebrew line for the card. The user is shown a card and the call waits for their approval. One step the user can undo.

Body

textstring
beforeinteger
starts_withstringwith before: the words that open that paragraph, as find_blocks gave them — checked, so a paragraph that moved is not the one written before
partstring
titlestring

Answer: 200 · Idempotency-Key

POST /v1/books/{id}/actions/format_paragraphs format paragraphs books:write

A paragraph's OWN formatting, over its style, for the paragraphs found alone — as the editor's design window sets it on a paragraph: one heading on a new page, space after one heading, one note with no lone word on its last line or with tighter word spacing, one paragraph centered. Never a new style for it, never its style's setting (every paragraph of the style shares that). Which, in where: selection true — the paragraphs the user selected (on the page or in the editor); or as set_paragraphs: paragraphs {from, to} with starts_with, a search (text, … — in notes too with streams [their codes]), blocks, paragraph_style, first_after, bold (by how much of them is bold: "all" — the lines made bold through, alone or with the others). set: each field with its value, as the style's own of the same name on the map reads it — break_before ("page", "odd", "even", "none"), keep_with_next, keep, space_before / space_after (lines), space_before_pt / space_after_pt, align, indent, hang, margin_start_mm, margin_end_mm, leading, word_space, center_last, center_single, avoid_lonely_word, keep_with_prev (never parted from the paragraph before it), tight_next, keep_whole (soft: kept whole on one page where the pages allow), tabs (its tab stops, whole: {"columns": n} or {"stops": [{pos_mm, align, leader}]} — the map's ParaFormat.tabs), hyphenate, direction, columns, size ({"pt": n}, or {"rel": r} of its style's), font, weight, color, width, track; null gives that field back to the style. clear true: all their own formatting taken away. More than 3 paragraphs: a card first, and the call waits. Answers what came onto the pages (visible / no_visible_change). One step the user can undo.

Body

titlestringone short Hebrew line saying what changes, for the turn's list and a card
whereobject
setobjectfield → value (null: back to the style)
clearboolean

Answer: 200 · Idempotency-Key

POST /v1/books/{id}/actions/read_looks read looks books:read

What sets the look of paragraphs as the reader sees them — read before saying a place looks as its style says, and whenever the user says one place is bigger, smaller or other than its kind elsewhere, or that a change didn't reach it: per paragraph its style, its font and size in points, own_formatting (set on it alone, over its style: kept when the style changes), character_styles on its words (their look and the words), brackets (the text's rule for words between marks: places and the longest in words). Which, in where, as format_paragraphs: selection true (only the selected words' looks), paragraphs {from, to} with starts_with, a search (text), blocks, paragraph_style, bold (by how much of them is bold). At most 12 paragraphs. Reads only.

Body

whereobject

Answer: 200

POST /v1/books/{id}/actions/remove_part remove part books:write

Take a part out of the book — its line «--- name ---» out of the text (a title page, contents, an introduction that should not be printed: «תוריד את השער»): its pages are no longer made, and its settings (templates) go with its line — the book has no part with settings and no line; to have it again it is made anew (add_title_page; add_part with part). Text the part had goes on in the part before it — said in the answer (to remove that text too: remove_paragraphs). A blank page taken out of the middle of a part's text takes with it the part that only went on after it («X (המשך)»): the text is one part again. The user is shown a card and the call waits. One step the user can undo.

Body

namestringthe part's name, as its line in the text has it (book_overview: parts)
nthintegeronly when the text opens a part of that name more than once: which (from 1)
titlestring

Answer: 200 · Idempotency-Key

POST /v1/books/{id}/actions/move_part move part books:write

Move a part — its line and all its text, with their notes — to stand before another part (before: that part's name), or to the book's end (before left out): the order of the book's parts («התוכן אחרי השער»). The user is shown a card and the call waits. Answers the parts' order now. One step the user can undo.

Body

namestringthe part's name, as its line in the text has it (book_overview: parts)
nthintegeronly when the text opens a part of that name more than once: which (from 1)
beforestringthe part's name, as its line in the text has it (book_overview: parts)
before_nthintegeronly when the text opens a part of that name more than once: which (from 1)
titlestring

Answer: 200 · Idempotency-Key

POST /v1/books/{id}/actions/move_paragraphs move paragraphs books:write

Move whole paragraphs of the main text to another place — or copy them (copy true) — never by insert_text (that leaves them twice, and retyped). paragraphs {from, to} with starts_with (and last_starts_with, the last one's opening words, for more than one); where to: before or after a paragraph (its number, with target_starts_with), or to_end. They go as they are: style, looks, notes (renumbered in order), index marks. A copy can't hold notes (a note has one sign). A part's line is not moved here (move_part). The user is shown a card and the call waits. Numbers change after it: find_blocks again. One step the user can undo.

Body

paragraphsobject
starts_withstringthe paragraph's opening words, as find_blocks gave them — checked, so a paragraph that moved is not the one changed
last_starts_withstring
beforeintegerthe paragraph's number from find_blocks (1 = the book's first)
afterintegerthe paragraph's number from find_blocks (1 = the book's first)
target_starts_withstring
to_endboolean
copyboolean
titlestring

Answer: 200 · Idempotency-Key

POST /v1/books/{id}/actions/insert_separator insert separator books:write

Put a separator between two pieces of the text before paragraph before (one past the last: at the end): a line of asterisks the book draws as its separator ornament, with room above and below (text_sep; turned on with the book's own end-of-chapter ornament where it has none, as «הוספה › עיטור בין קטעים», on the top bar and in the editor). Never a heading of a «*» (it would enter the contents and the running head). One step the user can undo.

Body

beforeintegerthe paragraph's number from find_blocks (1 = the book's first)
starts_withstringthe paragraph's opening words, as find_blocks gave them — checked, so a paragraph that moved is not the one changed

Answer: 200 · Idempotency-Key

POST /v1/books/{id}/actions/remove_notes remove notes books:write

Take notes out of the book — each note with its sign in the text, as erasing the sign in the editor does (never by emptying their words: that leaves the signs). Which, in where: selection true — the notes whose signs are in what the user selected; paragraphs {from, to} with starts_with — those whose signs are in those paragraphs; all true — every note of the text of notes region; empty true — only notes with no words (alone: in every text of notes). region: a text of notes by its code (book_overview: texts). The user is shown a card of the notes and the call waits. One step the user can undo.

Body

regioninteger
whereobject
titlestring

Answer: 200 · Idempotency-Key

POST /v1/books/{id}/actions/move_notes move notes books:write

Move notes to another text of notes, each keeping its words and its sign where it stands (renumbered in its new text, in the text's order) — also the way to split one text into two («ההערות הקצרות לאזור נפרד מתחת») and to merge two. Which, in where: selection, paragraphs {from, to} with starts_with, or all — as remove_notes — or rule (with region): paragraph_style (the style the note's first paragraph has — a Word book's «footnote text 2»; "" or the text's own style: those of none of their own), mark (the sign they open with: * @ # …; it stays in their words), opens_with or contains (words, as find_text reads them). Where to, in to: region (an existing text, by code), or new: "below" (default for a split: a new text under this one) / "beside" (side by side with it) with name — a copy of the source's design and numbering, with a sign of its own. merge true (with where.all, region and to.region): all of it into the other, and the emptied text then removed with its design — say that first. Not moved: notes on notes. The user is shown a card and the call waits. One step the user can undo.

Body

regioninteger
whereobject
toobject
mergeboolean
titlestring

Answer: 200 · Idempotency-Key

POST /v1/books/{id}/actions/move_to_notes move to notes books:write

Move text OUT of the main text INTO a text of notes — a commentary, glosses or a second work the user wrote inside the main text (a commentary after each paragraph, two works one after another, notes typed as plain text). Which, in where: selection true — what the user selected, on the page or in the editor (words inside one paragraph become one note, its sign where they stood); paragraphs {from, to} with starts_with — those paragraphs; paragraph_style — every paragraph of that style. Each run of paragraphs one after another becomes ONE note of several paragraphs (headings and styles kept), its sign at the end of the paragraph before it. link "headings": two works written one after another — each heading of the moved text, with what follows it, goes beside the main text's heading of the same words or number (the commentary's chapter 3 beside the main text's chapter 3). to: region — a text of notes the book has (its code, book_overview: texts), or new_name — a new text of notes by that name (made with no number shown: its signs are anchors alone, as Rashi on a daf). A note on the moved text is refused (it can't be moved with notes on it yet). The user is shown a card and the call waits; one step the user can undo. Answers offer_layout: the ready pages that set the text beside the main text (beside; around: this one text on both sides of it, read like two columns — right, then left; sides: one text at each side, the Vilna page) as change_settings changes — offer them (ask_user) after moving, never set one unasked.

Body

titlestringone short line saying what moves, for the card and the turn's list
whereobject
toobject
linkstringbefore · headings

Answer: 200 · Idempotency-Key

POST /v1/books/{id}/actions/read_cover read cover books:read

The book's cover for the printer, flat: {path: value} by the paths change_cover takes — binding (soft: glued in a card cover; hard: boards; staple: a stapled booklet, no spine), spine_turn (which way the spine's lines run: auto by its width, down — read from the top down, up, across, none), color (the sheet's colour "#rrggbb", null the paper's), spine.color (the spine's own colour, over the sheet's — a ready cover may give it one, a dark spine on a light cover; null: none, the spine is the sheet's colour — «למה השדרה ירוקה/כהה»: this), margin_mm (the room kept from each edge of the front and the back), spine_mm (the spine's width as the printer gave it; null: estimated by the pages and the paper), paper, marks (crop and fold marks), bleed_mm; and each panel — front, spine, back: valign (where its lines stand: top, upper — a third down, center, spread — the room shared evenly among them, each line in the middle of its share: «שורה בשליש העליון ושורה בשליש התחתון»), margins (its own, mm, inner at the spine; null: margin_mm all round; the spine's: its top and bottom alone, along it — its sides are its folds' room, whatever they say), gap_mm (with valign spread: the space between each line and the next, mm — the lines together in the middle, that far apart: «לקרב / להרחיק את השורות בשדרה»; null: the room shared evenly), its lines <panel>.lines[j]… (each a title page's line: role, text, look — font, size, weight, colour —, format — alignment, space before and after —, bold words), the frame around its lines <panel>.lines_frame. look: the ready cover it is in now (null: a design of its own). designed false: none was designed yet — this is the one the cover's room starts from (the title page's lines). Call it before change_cover.

Answer: 200

POST /v1/books/{id}/actions/change_cover change cover books:write

Change the book's cover, as one step the user can undo. look — a whole ready cover put on it: its ground, its inks, a frame, a line under the book's name, the spine; what is written, its fonts and sizes stay, pictures go (plain — white, no ornament; classic — cream, a thin frame, a line under the name; navy — dark blue and gold, a double frame, a line with a diamond; wine — burgundy and cream, framed; forest — dark green and gold; night — black and gold; gilt — white with a gold double frame; plate — dark blue, the front's lines on a light plate; label — burgundy, a cream label; sky — light blue, a dark blue spine; stone — warm grey, quiet; band / sash / bar — the book's name on a band of colour across the front (dark blue on white / burgundy on cream / gold on black); ribbon — cream, a burgundy spine). «תעשה לי כריכה» / «עיצוב יפה לכריכה»: put on the look that suits the book and say which, and that the others are in the cover's room («כריכה מוכנה») to press; a colour or a detail asked beside it goes in changes of the same call. Then lines — a line added to a panel (op add, value its fields as a title page's line: role, text, and any of look / format — left out take the defaults; index where, default at the end), removed, moved (to) or duplicated, at index —, then changes: each a path as read_cover gives it and its new value — a line's field (front.lines[0].text, spine.lines[1].look.size {"rel": 1.2} or {"pt": n}, back.lines[2].format.align, front.lines[0].look.font by its slot from list_fonts), a whole line as an object, the frame around a panel's lines (front.lines_frame), a panel's valign, margins or gap_mm, or the cover's own (binding, spine_turn, color, margin_mm, spine_mm, paper, marks, bleed_mm). spine.color: the spine's own colour "#rrggbb" (its words take an ink that reads on it), null takes it off — the spine then is the cover's colour. A line is checked as a title page's line is (its fields, fonts and spans, like change_settings); the cover's own fields keep only their choices and limits; the engine draws the result last. What fails is rejected and said why, the rest applied. A picture is taken off by null: picture (the one behind the whole cover), front.picture / back.picture / spine.picture; a frame near a panel's edges by front.frame null. picture.ink: the picture behind the whole cover drawn in one colour (#rrggbb) — its darks in it, its lights toward white («התמונה בזהב», a grey texture in the cover's colour); null: its own colours. Not here — the user does it in the cover's room: choosing a picture behind the cover or a panel (from their art library), drawing a frame near a panel's edges, a hard cover's measures. The cover is not on the book's pages: say that it is seen in «חלקים» › «כריכה» (show_place parts).

Body

lookstringplain · classic · navy · wine · forest · night · gilt · plate · label · sky · stone · band · sash · bar · ribbon
linesarray
changesarray

Answer: 200 · Idempotency-Key

Versions

The book's saved versions, and its proofreading link

GET /v1/books/{id}/versions The book's versions books:read

Answer: 200

POST /v1/books/{id}/versions Save a version books:write

Body

namestring

Answer: 201 · Idempotency-Key

POST /v1/books/{id}/restore Restore a version books:write

The book made again as it was at the version — a new change of the user's (nothing is lost). Without version: the one saved before this credential's latest series of changes, i.e. that series taken back.

Body

versionstringA record's id: 15 lowercase letters and digits

Answer: 200 · Idempotency-Key

Pages

Pictures of the book's pages as typeset

GET /v1/books/{id}/pages Pictures of pages books:read

As the studio shows them; a book not paid for under the words of a preview. Each sets the whole book: they have a limit of their own.

Parameters

frominteger
countinteger
widthintegerPixels

Answer: 200

GET /v1/books/{id}/pages/{page}.webp One page's picture books:read

Parameters

widthintegerPixels

Answer: 200

Exports

The book's files — the PDF for print, a proof copy, the cover, InDesign

POST /v1/books/{id}/exports Make a file of the book export

As the studio's «ייצוא», at its prices: a book not paid for gives its first pages (result.kind: sample) and result.pay_url, the studio's page where it is paid for — the API never takes a payment. The cover is of a book paid for alone (402 with pay_url). A job: follow Location, or a webhook export.ready.

Body

formatstringpdf · proof · cover · idml

Answer: 202 · Idempotency-Key

GET /v1/files/{id} A file made

The address is the job's result (file.url): signed, for a day, no credential needed.

Parameters

exp *string
sig *string

Answer: 200

Webhooks

Endpoints told when a job ends (Standard Webhooks 1.0)

GET /v1/webhooks The endpoints webhooks

Answer: 200

POST /v1/webhooks Add an endpoint webhooks

https, at a public address. Its secret is given this once.

Body

urlstring
eventsarray
descriptionstring

Answer: 201 · Idempotency-Key

GET /v1/webhooks/{id} One endpoint webhooks

Answer: 200

PATCH /v1/webhooks/{id} Change an endpoint webhooks

Body

urlstring
eventsarray
descriptionstring
activeboolean

Answer: 200

DELETE /v1/webhooks/{id} Remove an endpoint webhooks

Answer: 204

POST /v1/webhooks/{id}/test Send a test event webhooks

Answer: 202

GET /v1/webhooks/{id}/deliveries The latest deliveries webhooks

Parameters

limitinteger

Answer: 200