{
 "openapi": "3.1.1",
 "jsonSchemaDialect": "https://json-schema.org/draft/2020-12/schema",
 "info": {
  "title": "ariach API",
  "version": "1.0.0",
  "summary": "Hebrew books typeset for print — the studio's own work, for programs",
  "description": "ariach (אריח) typesets Hebrew books — Torah literature, with notes and commentaries around the text — into print-ready PDFs. This API does what the studio does, as the user: their books, new ones (blank, from the library, from a Word file), the studio assistant's actions on a book, its versions and pages, its files at the studio's prices.\n\nEvery request is authenticated with `Authorization: Bearer <key>` — a key the user makes in the studio («החשבון» → «חיבורים ומפתחות», `ark_live_…`), or an OAuth 2.1 access token. Errors are RFC 9457 problems; every POST that creates takes an `Idempotency-Key`; every answer carries `RateLimit` and `RateLimit-Policy`; a long job answers 202 with the job, told at its end to the account's webhooks. The MCP server is at https://mcp.ariach.com/mcp.",
  "contact": {
   "name": "ariach",
   "url": "https://ariach.com"
  },
  "termsOfService": "https://ariach.com/terms",
  "license": {
   "name": "Proprietary",
   "url": "https://ariach.com/terms"
  }
 },
 "servers": [
  {
   "url": "https://api.ariach.com"
  }
 ],
 "tags": [
  {
   "name": "Account",
   "x-he": "החשבון",
   "description": "Who the caller is, and their jobs"
  },
  {
   "name": "Books",
   "x-he": "ספרים",
   "description": "The user's books, and new ones"
  },
  {
   "name": "Library",
   "x-he": "הספרייה",
   "description": "The library a book is made of (Otzaria)"
  },
  {
   "name": "Actions",
   "x-he": "פעולות בספר",
   "description": "The studio assistant's tools on a book: read it, change it — written into the book at once as the user's own, a version saved before each series of changes"
  },
  {
   "name": "Versions",
   "x-he": "גרסאות והגהה",
   "description": "The book's saved versions, and its proofreading link"
  },
  {
   "name": "Pages",
   "x-he": "עמודים",
   "description": "Pictures of the book's pages as typeset"
  },
  {
   "name": "Exports",
   "x-he": "ייצוא",
   "description": "The book's files — the PDF for print, a proof copy, the cover, InDesign"
  },
  {
   "name": "Webhooks",
   "x-he": "Webhooks",
   "description": "Endpoints told when a job ends (Standard Webhooks 1.0)"
  }
 ],
 "security": [
  {
   "bearer": []
  },
  {
   "oauth2": []
  }
 ],
 "paths": {
  "/v1/me": {
   "get": {
    "operationId": "getMe",
    "tags": [
     "Account"
    ],
    "summary": "Who the caller is",
    "x-summary-he": "מי המתקשר: המשתמש, ההרשאות, מכסת ה-AI",
    "responses": {
     "200": {
      "description": "The user, how they are connected, the scopes, the week's AI allowance",
      "headers": {
       "RateLimit": {
        "$ref": "#/components/headers/RateLimit"
       },
       "RateLimit-Policy": {
        "$ref": "#/components/headers/RateLimitPolicy"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Me"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "429": {
      "description": "rate-limited",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "default": {
      "description": "internal · unavailable",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     }
    }
   }
  },
  "/v1/jobs": {
   "get": {
    "operationId": "listJobs",
    "tags": [
     "Account"
    ],
    "summary": "The caller's jobs",
    "x-summary-he": "המשימות של החשבון, החדשות קודם",
    "parameters": [
     {
      "name": "limit",
      "in": "query",
      "schema": {
       "type": "integer",
       "description": "1–100",
       "minimum": 1,
       "maximum": 100,
       "default": 20
      }
     },
     {
      "name": "before",
      "in": "query",
      "schema": {
       "type": "string",
       "description": "Jobs created before this time (the `next` link gives it)",
       "format": "date-time"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Newest first",
      "headers": {
       "RateLimit": {
        "$ref": "#/components/headers/RateLimit"
       },
       "RateLimit-Policy": {
        "$ref": "#/components/headers/RateLimitPolicy"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/JobList"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "429": {
      "description": "rate-limited",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "default": {
      "description": "internal · unavailable",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     }
    }
   }
  },
  "/v1/jobs/{id}": {
   "get": {
    "operationId": "getJob",
    "tags": [
     "Account"
    ],
    "summary": "One job",
    "x-summary-he": "משימה אחת: מצבה, התקדמותה, מה יצא ממנה",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "description": "A record's id: 15 lowercase letters and digits",
       "pattern": "^[a-z0-9]{15}$",
       "examples": [
        "k3x9q2m7b1v8c4z"
       ]
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Its state; when ended, its result or its problem",
      "headers": {
       "RateLimit": {
        "$ref": "#/components/headers/RateLimit"
       },
       "RateLimit-Policy": {
        "$ref": "#/components/headers/RateLimitPolicy"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Job"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "404": {
      "description": "not-found",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "429": {
      "description": "rate-limited",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "default": {
      "description": "internal · unavailable",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     }
    }
   }
  },
  "/v1/books": {
   "get": {
    "operationId": "listBooks",
    "tags": [
     "Books"
    ],
    "summary": "The user's books",
    "x-summary-he": "הספרים של המשתמש, וגם אלה ששותפו איתו",
    "x-scope": "books:read",
    "security": [
     {
      "bearer": []
     },
     {
      "oauth2": [
       "books:read"
      ]
     }
    ],
    "parameters": [
     {
      "name": "q",
      "in": "query",
      "schema": {
       "type": "string",
       "description": "Words of the title"
      }
     },
     {
      "name": "shared",
      "in": "query",
      "schema": {
       "type": "string",
       "description": "only: books shared with the user · none: their own alone",
       "enum": [
        "only",
        "none"
       ]
      }
     },
     {
      "name": "limit",
      "in": "query",
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 100,
       "default": 30
      }
     },
     {
      "name": "page",
      "in": "query",
      "schema": {
       "type": "integer",
       "minimum": 1,
       "default": 1
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The latest changed first",
      "headers": {
       "RateLimit": {
        "$ref": "#/components/headers/RateLimit"
       },
       "RateLimit-Policy": {
        "$ref": "#/components/headers/RateLimitPolicy"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/BookList"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "403": {
      "description": "insufficient-scope",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "429": {
      "description": "rate-limited",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "default": {
      "description": "internal · unavailable",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     }
    }
   },
   "post": {
    "operationId": "createBook",
    "tags": [
     "Books"
    ],
    "summary": "A new book",
    "x-summary-he": "ספר חדש: ריק, מהספרייה, או מקובץ וורד — כמו בסטודיו",
    "description": "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`.",
    "x-scope": "books:write",
    "security": [
     {
      "bearer": []
     },
     {
      "oauth2": [
       "books:write"
      ]
     }
    ],
    "parameters": [
     {
      "$ref": "#/components/parameters/IdempotencyKey"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/NewBook"
       }
      },
      "multipart/form-data": {
       "schema": {
        "type": "object",
        "properties": {
         "file": {
          "type": "string",
          "contentMediaType": "application/octet-stream",
          "description": "A .docx or .rtf file, 60 MB at most"
         },
         "title": {
          "type": "string"
         },
         "making": {
          "type": "string",
          "enum": [
           "book",
           "booklet"
          ]
         },
         "ai": {
          "type": "string",
          "enum": [
           "true",
           "false"
          ]
         }
        },
        "required": [
         "file"
        ]
       }
      }
     }
    },
    "responses": {
     "202": {
      "description": "The job (`book.create`); its result a NewBookResult",
      "headers": {
       "RateLimit": {
        "$ref": "#/components/headers/RateLimit"
       },
       "RateLimit-Policy": {
        "$ref": "#/components/headers/RateLimitPolicy"
       },
       "Location": {
        "$ref": "#/components/headers/Location"
       },
       "Idempotent-Replayed": {
        "$ref": "#/components/headers/IdempotentReplayed"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Job"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "403": {
      "description": "insufficient-scope · unverified",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "409": {
      "description": "book-quota",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "413": {
      "description": "too-large",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "415": {
      "description": "unsupported-media-type",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "422": {
      "description": "validation",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "429": {
      "description": "busy · rate-limited",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "default": {
      "description": "internal · unavailable",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     }
    }
   }
  },
  "/v1/books/{id}": {
   "get": {
    "operationId": "getBook",
    "tags": [
     "Books"
    ],
    "summary": "One book",
    "x-summary-he": "ספר אחד",
    "x-scope": "books:read",
    "security": [
     {
      "bearer": []
     },
     {
      "oauth2": [
       "books:read"
      ]
     }
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "The book's id",
      "schema": {
       "type": "string",
       "description": "A record's id: 15 lowercase letters and digits",
       "pattern": "^[a-z0-9]{15}$",
       "examples": [
        "k3x9q2m7b1v8c4z"
       ]
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The book",
      "headers": {
       "RateLimit": {
        "$ref": "#/components/headers/RateLimit"
       },
       "RateLimit-Policy": {
        "$ref": "#/components/headers/RateLimitPolicy"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Book"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "403": {
      "description": "insufficient-scope",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "404": {
      "description": "not-found",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "429": {
      "description": "rate-limited",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "default": {
      "description": "internal · unavailable",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     }
    }
   },
   "patch": {
    "operationId": "renameBook",
    "tags": [
     "Books"
    ],
    "summary": "Rename a book",
    "x-summary-he": "שינוי שם הספר",
    "x-scope": "books:write",
    "security": [
     {
      "bearer": []
     },
     {
      "oauth2": [
       "books:write"
      ]
     }
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "The book's id",
      "schema": {
       "type": "string",
       "description": "A record's id: 15 lowercase letters and digits",
       "pattern": "^[a-z0-9]{15}$",
       "examples": [
        "k3x9q2m7b1v8c4z"
       ]
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "title": {
          "type": "string",
          "minLength": 1,
          "maxLength": 200
         }
        },
        "required": [
         "title"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The book",
      "headers": {
       "RateLimit": {
        "$ref": "#/components/headers/RateLimit"
       },
       "RateLimit-Policy": {
        "$ref": "#/components/headers/RateLimitPolicy"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Book"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "403": {
      "description": "insufficient-scope · forbidden",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "404": {
      "description": "not-found",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "422": {
      "description": "validation",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "429": {
      "description": "rate-limited",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "default": {
      "description": "internal · unavailable",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     }
    }
   },
   "delete": {
    "operationId": "trashBook",
    "tags": [
     "Books"
    ],
    "summary": "Put a book in the trash",
    "x-summary-he": "העברת ספר לסל (אפשר לשחזר בסטודיו 30 יום)",
    "description": "The owner alone. The studio's trash gives it back for 30 days.",
    "x-scope": "books:write",
    "security": [
     {
      "bearer": []
     },
     {
      "oauth2": [
       "books:write"
      ]
     }
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "The book's id",
      "schema": {
       "type": "string",
       "description": "A record's id: 15 lowercase letters and digits",
       "pattern": "^[a-z0-9]{15}$",
       "examples": [
        "k3x9q2m7b1v8c4z"
       ]
      }
     }
    ],
    "responses": {
     "204": {
      "description": "In the trash",
      "headers": {
       "RateLimit": {
        "$ref": "#/components/headers/RateLimit"
       },
       "RateLimit-Policy": {
        "$ref": "#/components/headers/RateLimitPolicy"
       }
      }
     },
     "401": {
      "description": "unauthorized",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "403": {
      "description": "insufficient-scope · forbidden",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "404": {
      "description": "not-found",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "429": {
      "description": "rate-limited",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "default": {
      "description": "internal · unavailable",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     }
    }
   }
  },
  "/v1/library": {
   "get": {
    "operationId": "searchLibrary",
    "tags": [
     "Library"
    ],
    "summary": "Search the library",
    "x-summary-he": "חיפוש ספר בספרייה לפי שם",
    "x-scope": "library:read",
    "security": [
     {
      "bearer": []
     },
     {
      "oauth2": [
       "library:read"
      ]
     }
    ],
    "parameters": [
     {
      "name": "q",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string",
       "description": "Words of the title"
      }
     },
     {
      "name": "limit",
      "in": "query",
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 50,
       "default": 20
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The books found",
      "headers": {
       "RateLimit": {
        "$ref": "#/components/headers/RateLimit"
       },
       "RateLimit-Policy": {
        "$ref": "#/components/headers/RateLimitPolicy"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "items": {
           "type": "array",
           "items": {
            "$ref": "#/components/schemas/LibraryBook"
           }
          }
         },
         "required": [
          "items"
         ]
        }
       }
      }
     },
     "401": {
      "description": "unauthorized",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "403": {
      "description": "insufficient-scope",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "429": {
      "description": "rate-limited",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "default": {
      "description": "internal · unavailable",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     }
    }
   }
  },
  "/v1/library/commentaries": {
   "get": {
    "operationId": "libraryCommentaries",
    "tags": [
     "Library"
    ],
    "summary": "What is linked to a library book",
    "x-summary-he": "המפרשים והמקורות המקושרים לספר מהספרייה",
    "x-scope": "library:read",
    "security": [
     {
      "bearer": []
     },
     {
      "oauth2": [
       "library:read"
      ]
     }
    ],
    "parameters": [
     {
      "name": "book",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string",
       "description": "The library book's id"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Its commentaries and sources, the most linked first",
      "headers": {
       "RateLimit": {
        "$ref": "#/components/headers/RateLimit"
       },
       "RateLimit-Policy": {
        "$ref": "#/components/headers/RateLimitPolicy"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "items": {
           "type": "array",
           "items": {
            "$ref": "#/components/schemas/LinkedBook"
           }
          }
         },
         "required": [
          "items"
         ]
        }
       }
      }
     },
     "401": {
      "description": "unauthorized",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "403": {
      "description": "insufficient-scope",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "422": {
      "description": "validation",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "429": {
      "description": "rate-limited",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "default": {
      "description": "internal · unavailable",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     }
    }
   }
  },
  "/v1/actions": {
   "get": {
    "operationId": "listActions",
    "tags": [
     "Actions"
    ],
    "summary": "The actions there are",
    "x-summary-he": "רשימת הפעולות: מה כל אחת עושה ומה היא מקבלת",
    "responses": {
     "200": {
      "description": "Each action's kind, scope, words and input schema",
      "headers": {
       "RateLimit": {
        "$ref": "#/components/headers/RateLimit"
       },
       "RateLimit-Policy": {
        "$ref": "#/components/headers/RateLimitPolicy"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "items": {
           "type": "array",
           "items": {
            "$ref": "#/components/schemas/Action"
           }
          }
         },
         "required": [
          "items"
         ]
        }
       }
      }
     },
     "401": {
      "description": "unauthorized",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "429": {
      "description": "rate-limited",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "default": {
      "description": "internal · unavailable",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     }
    }
   }
  },
  "/v1/books/{id}/versions": {
   "get": {
    "operationId": "listVersions",
    "tags": [
     "Versions"
    ],
    "summary": "The book's versions",
    "x-summary-he": "הגרסאות השמורות של הספר",
    "x-scope": "books:read",
    "security": [
     {
      "bearer": []
     },
     {
      "oauth2": [
       "books:read"
      ]
     }
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "The book's id",
      "schema": {
       "type": "string",
       "description": "A record's id: 15 lowercase letters and digits",
       "pattern": "^[a-z0-9]{15}$",
       "examples": [
        "k3x9q2m7b1v8c4z"
       ]
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The newest first",
      "headers": {
       "RateLimit": {
        "$ref": "#/components/headers/RateLimit"
       },
       "RateLimit-Policy": {
        "$ref": "#/components/headers/RateLimitPolicy"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "items": {
           "type": "array",
           "items": {
            "$ref": "#/components/schemas/Version"
           }
          }
         },
         "required": [
          "items"
         ]
        }
       }
      }
     },
     "401": {
      "description": "unauthorized",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "403": {
      "description": "insufficient-scope",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "404": {
      "description": "not-found",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "429": {
      "description": "rate-limited",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "default": {
      "description": "internal · unavailable",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     }
    }
   },
   "post": {
    "operationId": "saveVersion",
    "tags": [
     "Versions"
    ],
    "summary": "Save a version",
    "x-summary-he": "שמירת הספר כמו שהוא עכשיו כגרסה בשם",
    "x-scope": "books:write",
    "security": [
     {
      "bearer": []
     },
     {
      "oauth2": [
       "books:write"
      ]
     }
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "The book's id",
      "schema": {
       "type": "string",
       "description": "A record's id: 15 lowercase letters and digits",
       "pattern": "^[a-z0-9]{15}$",
       "examples": [
        "k3x9q2m7b1v8c4z"
       ]
      }
     },
     {
      "$ref": "#/components/parameters/IdempotencyKey"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 200
         }
        },
        "required": [
         "name"
        ]
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The version",
      "headers": {
       "RateLimit": {
        "$ref": "#/components/headers/RateLimit"
       },
       "RateLimit-Policy": {
        "$ref": "#/components/headers/RateLimitPolicy"
       },
       "Idempotent-Replayed": {
        "$ref": "#/components/headers/IdempotentReplayed"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Version"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "403": {
      "description": "insufficient-scope",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "404": {
      "description": "not-found",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "422": {
      "description": "validation",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "429": {
      "description": "rate-limited",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "default": {
      "description": "internal · unavailable",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     }
    }
   }
  },
  "/v1/books/{id}/restore": {
   "post": {
    "operationId": "restoreVersion",
    "tags": [
     "Versions"
    ],
    "summary": "Restore a version",
    "x-summary-he": "החזרת הספר לגרסה — בלי גרסה: לפני סדרת השינויים האחרונה של המפתח",
    "description": "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.",
    "x-scope": "books:write",
    "security": [
     {
      "bearer": []
     },
     {
      "oauth2": [
       "books:write"
      ]
     }
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "The book's id",
      "schema": {
       "type": "string",
       "description": "A record's id: 15 lowercase letters and digits",
       "pattern": "^[a-z0-9]{15}$",
       "examples": [
        "k3x9q2m7b1v8c4z"
       ]
      }
     },
     {
      "$ref": "#/components/parameters/IdempotencyKey"
     }
    ],
    "requestBody": {
     "required": false,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "version": {
          "type": "string",
          "description": "A record's id: 15 lowercase letters and digits",
          "pattern": "^[a-z0-9]{15}$",
          "examples": [
           "k3x9q2m7b1v8c4z"
          ]
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Restored",
      "headers": {
       "RateLimit": {
        "$ref": "#/components/headers/RateLimit"
       },
       "RateLimit-Policy": {
        "$ref": "#/components/headers/RateLimitPolicy"
       },
       "Idempotent-Replayed": {
        "$ref": "#/components/headers/IdempotentReplayed"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Restored"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "403": {
      "description": "insufficient-scope",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "404": {
      "description": "not-found",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "422": {
      "description": "validation",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "429": {
      "description": "rate-limited",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "default": {
      "description": "internal · unavailable",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     }
    }
   }
  },
  "/v1/books/{id}/proof-link": {
   "get": {
    "operationId": "getProofLink",
    "tags": [
     "Versions"
    ],
    "summary": "The proofreading link",
    "x-summary-he": "קישור ההגהה של הספר (אם יש)",
    "description": "The book's writers alone.",
    "x-scope": "books:read",
    "security": [
     {
      "bearer": []
     },
     {
      "oauth2": [
       "books:read"
      ]
     }
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "The book's id",
      "schema": {
       "type": "string",
       "description": "A record's id: 15 lowercase letters and digits",
       "pattern": "^[a-z0-9]{15}$",
       "examples": [
        "k3x9q2m7b1v8c4z"
       ]
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The link in force; url null: none",
      "headers": {
       "RateLimit": {
        "$ref": "#/components/headers/RateLimit"
       },
       "RateLimit-Policy": {
        "$ref": "#/components/headers/RateLimitPolicy"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ProofLink"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "403": {
      "description": "insufficient-scope · forbidden",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "404": {
      "description": "not-found",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "429": {
      "description": "rate-limited",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "default": {
      "description": "internal · unavailable",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     }
    }
   },
   "post": {
    "operationId": "makeProofLink",
    "tags": [
     "Versions"
    ],
    "summary": "Make a proofreading link",
    "x-summary-he": "שליחה להגהה: הקישור הקיים, או חדש",
    "description": "As the studio's «שליחה להגהה»: whoever opens it proofreads this book alone, with no account, and their remarks come to the book. The link in force, or a new one; in force until cancelled. The book's writers alone, with a verified address.",
    "x-scope": "books:write",
    "security": [
     {
      "bearer": []
     },
     {
      "oauth2": [
       "books:write"
      ]
     }
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "The book's id",
      "schema": {
       "type": "string",
       "description": "A record's id: 15 lowercase letters and digits",
       "pattern": "^[a-z0-9]{15}$",
       "examples": [
        "k3x9q2m7b1v8c4z"
       ]
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The link",
      "headers": {
       "RateLimit": {
        "$ref": "#/components/headers/RateLimit"
       },
       "RateLimit-Policy": {
        "$ref": "#/components/headers/RateLimitPolicy"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ProofLink"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "403": {
      "description": "insufficient-scope · forbidden · unverified",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "404": {
      "description": "not-found",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "429": {
      "description": "rate-limited",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "default": {
      "description": "internal · unavailable",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     }
    }
   },
   "delete": {
    "operationId": "cancelProofLink",
    "tags": [
     "Versions"
    ],
    "summary": "Cancel the proofreading link",
    "x-summary-he": "ביטול קישור ההגהה",
    "description": "Whoever holds it is turned away (an open page too); the next POST makes another.",
    "x-scope": "books:write",
    "security": [
     {
      "bearer": []
     },
     {
      "oauth2": [
       "books:write"
      ]
     }
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "The book's id",
      "schema": {
       "type": "string",
       "description": "A record's id: 15 lowercase letters and digits",
       "pattern": "^[a-z0-9]{15}$",
       "examples": [
        "k3x9q2m7b1v8c4z"
       ]
      }
     }
    ],
    "responses": {
     "204": {
      "description": "Cancelled",
      "headers": {
       "RateLimit": {
        "$ref": "#/components/headers/RateLimit"
       },
       "RateLimit-Policy": {
        "$ref": "#/components/headers/RateLimitPolicy"
       }
      }
     },
     "401": {
      "description": "unauthorized",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "403": {
      "description": "insufficient-scope · forbidden",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "404": {
      "description": "not-found",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "429": {
      "description": "rate-limited",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "default": {
      "description": "internal · unavailable",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     }
    }
   }
  },
  "/v1/books/{id}/pages": {
   "get": {
    "operationId": "getPages",
    "tags": [
     "Pages"
    ],
    "summary": "Pictures of pages",
    "x-summary-he": "תמונות של עד 4 עמודים, כמו שהם מסודרים",
    "description": "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.",
    "x-scope": "books:read",
    "security": [
     {
      "bearer": []
     },
     {
      "oauth2": [
       "books:read"
      ]
     }
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "The book's id",
      "schema": {
       "type": "string",
       "description": "A record's id: 15 lowercase letters and digits",
       "pattern": "^[a-z0-9]{15}$",
       "examples": [
        "k3x9q2m7b1v8c4z"
       ]
      }
     },
     {
      "name": "from",
      "in": "query",
      "schema": {
       "type": "integer",
       "minimum": 1,
       "default": 1
      }
     },
     {
      "name": "count",
      "in": "query",
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 4,
       "default": 1
      }
     },
     {
      "name": "width",
      "in": "query",
      "schema": {
       "type": "integer",
       "description": "Pixels",
       "minimum": 200,
       "maximum": 1200,
       "default": 800
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The pictures (webp, base64)",
      "headers": {
       "RateLimit": {
        "$ref": "#/components/headers/RateLimit"
       },
       "RateLimit-Policy": {
        "$ref": "#/components/headers/RateLimitPolicy"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Pages"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "403": {
      "description": "insufficient-scope",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "404": {
      "description": "not-found",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "409": {
      "description": "conflict",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "422": {
      "description": "validation",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "429": {
      "description": "rate-limited",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "default": {
      "description": "internal · unavailable",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     }
    }
   }
  },
  "/v1/books/{id}/pages/{page}.webp": {
   "get": {
    "operationId": "getPagePicture",
    "tags": [
     "Pages"
    ],
    "summary": "One page's picture",
    "x-summary-he": "תמונה של עמוד אחד",
    "x-scope": "books:read",
    "security": [
     {
      "bearer": []
     },
     {
      "oauth2": [
       "books:read"
      ]
     }
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "The book's id",
      "schema": {
       "type": "string",
       "description": "A record's id: 15 lowercase letters and digits",
       "pattern": "^[a-z0-9]{15}$",
       "examples": [
        "k3x9q2m7b1v8c4z"
       ]
      }
     },
     {
      "name": "page",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer",
       "minimum": 1
      }
     },
     {
      "name": "width",
      "in": "query",
      "schema": {
       "type": "integer",
       "description": "Pixels",
       "minimum": 200,
       "maximum": 1200,
       "default": 800
      }
     }
    ],
    "responses": {
     "200": {
      "description": "image/webp; X-Ariach-Pages: the book's pages; under a watermark X-Ariach-Watermark and X-Ariach-Pay-Url",
      "headers": {
       "RateLimit": {
        "$ref": "#/components/headers/RateLimit"
       },
       "RateLimit-Policy": {
        "$ref": "#/components/headers/RateLimitPolicy"
       }
      },
      "content": {
       "image/webp": {
        "schema": {}
       }
      }
     },
     "401": {
      "description": "unauthorized",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "403": {
      "description": "insufficient-scope",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "404": {
      "description": "not-found",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "409": {
      "description": "conflict",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "429": {
      "description": "rate-limited",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "default": {
      "description": "internal · unavailable",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     }
    }
   }
  },
  "/v1/books/{id}/exports": {
   "post": {
    "operationId": "exportBook",
    "tags": [
     "Exports"
    ],
    "summary": "Make a file of the book",
    "x-summary-he": "ייצוא: PDF לדפוס, עותק הגהה, כריכה, InDesign",
    "description": "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`.",
    "x-scope": "export",
    "security": [
     {
      "bearer": []
     },
     {
      "oauth2": [
       "export"
      ]
     }
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "The book's id",
      "schema": {
       "type": "string",
       "description": "A record's id: 15 lowercase letters and digits",
       "pattern": "^[a-z0-9]{15}$",
       "examples": [
        "k3x9q2m7b1v8c4z"
       ]
      }
     },
     {
      "$ref": "#/components/parameters/IdempotencyKey"
     }
    ],
    "requestBody": {
     "required": false,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "format": {
          "type": "string",
          "enum": [
           "pdf",
           "proof",
           "cover",
           "idml"
          ],
          "default": "pdf"
         }
        }
       }
      }
     }
    },
    "responses": {
     "202": {
      "description": "The job (`export`); its result an Export",
      "headers": {
       "RateLimit": {
        "$ref": "#/components/headers/RateLimit"
       },
       "RateLimit-Policy": {
        "$ref": "#/components/headers/RateLimitPolicy"
       },
       "Location": {
        "$ref": "#/components/headers/Location"
       },
       "Idempotent-Replayed": {
        "$ref": "#/components/headers/IdempotentReplayed"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Job"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "402": {
      "description": "payment-required",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "403": {
      "description": "insufficient-scope",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "404": {
      "description": "not-found",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "409": {
      "description": "computer-fonts",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "422": {
      "description": "validation",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "429": {
      "description": "busy · rate-limited",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "default": {
      "description": "internal · unavailable",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     }
    }
   }
  },
  "/v1/files/{id}": {
   "get": {
    "operationId": "getFile",
    "tags": [
     "Exports"
    ],
    "summary": "A file made",
    "x-summary-he": "הורדת קובץ שנעשה (הכתובת בתוצאת המשימה, ליום)",
    "description": "The address is the job's result (`file.url`): signed, for a day, no credential needed.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "description": "A record's id: 15 lowercase letters and digits",
       "pattern": "^[a-z0-9]{15}$",
       "examples": [
        "k3x9q2m7b1v8c4z"
       ]
      }
     },
     {
      "name": "exp",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "sig",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The file",
      "headers": {
       "RateLimit": {
        "$ref": "#/components/headers/RateLimit"
       },
       "RateLimit-Policy": {
        "$ref": "#/components/headers/RateLimitPolicy"
       }
      },
      "content": {
       "application/octet-stream": {
        "schema": {}
       }
      }
     },
     "401": {
      "description": "unauthorized",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "404": {
      "description": "not-found",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "429": {
      "description": "rate-limited",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "default": {
      "description": "internal · unavailable",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     }
    }
   }
  },
  "/v1/webhooks": {
   "get": {
    "operationId": "listWebhooks",
    "tags": [
     "Webhooks"
    ],
    "summary": "The endpoints",
    "x-summary-he": "נקודות הקבלה של החשבון",
    "x-scope": "webhooks",
    "security": [
     {
      "bearer": []
     },
     {
      "oauth2": [
       "webhooks"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Up to 10",
      "headers": {
       "RateLimit": {
        "$ref": "#/components/headers/RateLimit"
       },
       "RateLimit-Policy": {
        "$ref": "#/components/headers/RateLimitPolicy"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "items": {
           "type": "array",
           "items": {
            "$ref": "#/components/schemas/Webhook"
           }
          }
         },
         "required": [
          "items"
         ]
        }
       }
      }
     },
     "401": {
      "description": "unauthorized",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "403": {
      "description": "insufficient-scope",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "429": {
      "description": "rate-limited",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "default": {
      "description": "internal · unavailable",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     }
    }
   },
   "post": {
    "operationId": "createWebhook",
    "tags": [
     "Webhooks"
    ],
    "summary": "Add an endpoint",
    "x-summary-he": "הוספת נקודת קבלה (הסוד ניתן פעם אחת)",
    "description": "https, at a public address. Its secret is given this once.",
    "x-scope": "webhooks",
    "security": [
     {
      "bearer": []
     },
     {
      "oauth2": [
       "webhooks"
      ]
     }
    ],
    "parameters": [
     {
      "$ref": "#/components/parameters/IdempotencyKey"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "url": {
          "type": "string",
          "format": "uri"
         },
         "events": {
          "type": "array",
          "items": {
           "type": "string",
           "enum": [
            "job.succeeded",
            "job.failed",
            "book.created",
            "export.ready"
           ]
          }
         },
         "description": {
          "type": "string",
          "maxLength": 200
         }
        },
        "required": [
         "url"
        ]
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The endpoint and its secret",
      "headers": {
       "RateLimit": {
        "$ref": "#/components/headers/RateLimit"
       },
       "RateLimit-Policy": {
        "$ref": "#/components/headers/RateLimitPolicy"
       },
       "Location": {
        "$ref": "#/components/headers/Location"
       },
       "Idempotent-Replayed": {
        "$ref": "#/components/headers/IdempotentReplayed"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/WebhookCreated"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "403": {
      "description": "insufficient-scope",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "409": {
      "description": "conflict",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "422": {
      "description": "validation",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "429": {
      "description": "rate-limited",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "default": {
      "description": "internal · unavailable",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     }
    }
   }
  },
  "/v1/webhooks/{id}": {
   "get": {
    "operationId": "getWebhook",
    "tags": [
     "Webhooks"
    ],
    "summary": "One endpoint",
    "x-summary-he": "נקודת קבלה אחת",
    "x-scope": "webhooks",
    "security": [
     {
      "bearer": []
     },
     {
      "oauth2": [
       "webhooks"
      ]
     }
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "description": "A record's id: 15 lowercase letters and digits",
       "pattern": "^[a-z0-9]{15}$",
       "examples": [
        "k3x9q2m7b1v8c4z"
       ]
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The endpoint",
      "headers": {
       "RateLimit": {
        "$ref": "#/components/headers/RateLimit"
       },
       "RateLimit-Policy": {
        "$ref": "#/components/headers/RateLimitPolicy"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Webhook"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "403": {
      "description": "insufficient-scope",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "404": {
      "description": "not-found",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "429": {
      "description": "rate-limited",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "default": {
      "description": "internal · unavailable",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     }
    }
   },
   "patch": {
    "operationId": "updateWebhook",
    "tags": [
     "Webhooks"
    ],
    "summary": "Change an endpoint",
    "x-summary-he": "שינוי נקודת קבלה; active: true מפעיל מחדש",
    "x-scope": "webhooks",
    "security": [
     {
      "bearer": []
     },
     {
      "oauth2": [
       "webhooks"
      ]
     }
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "description": "A record's id: 15 lowercase letters and digits",
       "pattern": "^[a-z0-9]{15}$",
       "examples": [
        "k3x9q2m7b1v8c4z"
       ]
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "url": {
          "type": "string",
          "format": "uri"
         },
         "events": {
          "type": "array",
          "items": {
           "type": "string",
           "enum": [
            "job.succeeded",
            "job.failed",
            "book.created",
            "export.ready"
           ]
          }
         },
         "description": {
          "type": "string"
         },
         "active": {
          "type": "boolean"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The endpoint",
      "headers": {
       "RateLimit": {
        "$ref": "#/components/headers/RateLimit"
       },
       "RateLimit-Policy": {
        "$ref": "#/components/headers/RateLimitPolicy"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Webhook"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "403": {
      "description": "insufficient-scope",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "404": {
      "description": "not-found",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "422": {
      "description": "validation",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "429": {
      "description": "rate-limited",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "default": {
      "description": "internal · unavailable",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     }
    }
   },
   "delete": {
    "operationId": "deleteWebhook",
    "tags": [
     "Webhooks"
    ],
    "summary": "Remove an endpoint",
    "x-summary-he": "מחיקת נקודת קבלה",
    "x-scope": "webhooks",
    "security": [
     {
      "bearer": []
     },
     {
      "oauth2": [
       "webhooks"
      ]
     }
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "description": "A record's id: 15 lowercase letters and digits",
       "pattern": "^[a-z0-9]{15}$",
       "examples": [
        "k3x9q2m7b1v8c4z"
       ]
      }
     }
    ],
    "responses": {
     "204": {
      "description": "Removed",
      "headers": {
       "RateLimit": {
        "$ref": "#/components/headers/RateLimit"
       },
       "RateLimit-Policy": {
        "$ref": "#/components/headers/RateLimitPolicy"
       }
      }
     },
     "401": {
      "description": "unauthorized",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "403": {
      "description": "insufficient-scope",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "404": {
      "description": "not-found",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "429": {
      "description": "rate-limited",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "default": {
      "description": "internal · unavailable",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     }
    }
   }
  },
  "/v1/webhooks/{id}/test": {
   "post": {
    "operationId": "testWebhook",
    "tags": [
     "Webhooks"
    ],
    "summary": "Send a test event",
    "x-summary-he": "שליחת אירוע בדיקה",
    "x-scope": "webhooks",
    "security": [
     {
      "bearer": []
     },
     {
      "oauth2": [
       "webhooks"
      ]
     }
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "description": "A record's id: 15 lowercase letters and digits",
       "pattern": "^[a-z0-9]{15}$",
       "examples": [
        "k3x9q2m7b1v8c4z"
       ]
      }
     }
    ],
    "responses": {
     "202": {
      "description": "A webhook.test event on its way",
      "headers": {
       "RateLimit": {
        "$ref": "#/components/headers/RateLimit"
       },
       "RateLimit-Policy": {
        "$ref": "#/components/headers/RateLimitPolicy"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "sent": {
           "type": "integer"
          }
         },
         "required": [
          "sent"
         ]
        }
       }
      }
     },
     "401": {
      "description": "unauthorized",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "403": {
      "description": "insufficient-scope",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "404": {
      "description": "not-found",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "409": {
      "description": "conflict",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "429": {
      "description": "rate-limited",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "default": {
      "description": "internal · unavailable",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     }
    }
   }
  },
  "/v1/webhooks/{id}/deliveries": {
   "get": {
    "operationId": "listDeliveries",
    "tags": [
     "Webhooks"
    ],
    "summary": "The latest deliveries",
    "x-summary-he": "השליחות האחרונות: מצבן, ניסיונות, התשובה",
    "x-scope": "webhooks",
    "security": [
     {
      "bearer": []
     },
     {
      "oauth2": [
       "webhooks"
      ]
     }
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "description": "A record's id: 15 lowercase letters and digits",
       "pattern": "^[a-z0-9]{15}$",
       "examples": [
        "k3x9q2m7b1v8c4z"
       ]
      }
     },
     {
      "name": "limit",
      "in": "query",
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 100,
       "default": 20
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Newest first",
      "headers": {
       "RateLimit": {
        "$ref": "#/components/headers/RateLimit"
       },
       "RateLimit-Policy": {
        "$ref": "#/components/headers/RateLimitPolicy"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "items": {
           "type": "array",
           "items": {
            "$ref": "#/components/schemas/Delivery"
           }
          }
         },
         "required": [
          "items"
         ]
        }
       }
      }
     },
     "401": {
      "description": "unauthorized",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "403": {
      "description": "insufficient-scope",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "404": {
      "description": "not-found",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "429": {
      "description": "rate-limited",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "default": {
      "description": "internal · unavailable",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     }
    }
   }
  },
  "/v1/books/{id}/actions/book_overview": {
   "post": {
    "operationId": "actionBookOverview",
    "tags": [
     "Actions"
    ],
    "summary": "book overview",
    "x-summary-he": "קריאה בלבד",
    "description": "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.\n\nChanges nothing.",
    "x-scope": "books:read",
    "security": [
     {
      "bearer": []
     },
     {
      "oauth2": [
       "books:read"
      ]
     }
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "The book's id",
      "schema": {
       "type": "string",
       "description": "A record's id: 15 lowercase letters and digits",
       "pattern": "^[a-z0-9]{15}$",
       "examples": [
        "k3x9q2m7b1v8c4z"
       ]
      }
     }
    ],
    "requestBody": {
     "required": false,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {},
        "required": []
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Done",
      "headers": {
       "RateLimit": {
        "$ref": "#/components/headers/RateLimit"
       },
       "RateLimit-Policy": {
        "$ref": "#/components/headers/RateLimitPolicy"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ActionResult"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "403": {
      "description": "insufficient-scope",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "404": {
      "description": "not-found",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "422": {
      "description": "validation · action-refused",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "429": {
      "description": "rate-limited",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "default": {
      "description": "internal · unavailable",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     }
    }
   }
  },
  "/v1/books/{id}/actions/read_settings": {
   "post": {
    "operationId": "actionReadSettings",
    "tags": [
     "Actions"
    ],
    "summary": "read settings",
    "x-summary-he": "קריאה בלבד",
    "description": "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.\n\nChanges nothing.",
    "x-scope": "books:read",
    "security": [
     {
      "bearer": []
     },
     {
      "oauth2": [
       "books:read"
      ]
     }
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "The book's id",
      "schema": {
       "type": "string",
       "description": "A record's id: 15 lowercase letters and digits",
       "pattern": "^[a-z0-9]{15}$",
       "examples": [
        "k3x9q2m7b1v8c4z"
       ]
      }
     }
    ],
    "requestBody": {
     "required": false,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "paths": {
          "type": "array",
          "items": {
           "type": "string"
          }
         },
         "sections": {
          "type": "array",
          "items": {
           "type": "string",
           "enum": [
            "page",
            "main",
            "notes",
            "headings",
            "column_style",
            "note_sep",
            "furniture",
            "styles",
            "para_styles"
           ]
          }
         }
        },
        "required": []
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Done",
      "headers": {
       "RateLimit": {
        "$ref": "#/components/headers/RateLimit"
       },
       "RateLimit-Policy": {
        "$ref": "#/components/headers/RateLimitPolicy"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ActionResult"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "403": {
      "description": "insufficient-scope",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "404": {
      "description": "not-found",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "422": {
      "description": "validation · action-refused",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "429": {
      "description": "rate-limited",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "default": {
      "description": "internal · unavailable",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     }
    }
   }
  },
  "/v1/books/{id}/actions/list_fonts": {
   "post": {
    "operationId": "actionListFonts",
    "tags": [
     "Actions"
    ],
    "summary": "list fonts",
    "x-summary-he": "קריאה בלבד",
    "description": "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).\n\nChanges nothing.",
    "x-scope": "books:read",
    "security": [
     {
      "bearer": []
     },
     {
      "oauth2": [
       "books:read"
      ]
     }
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "The book's id",
      "schema": {
       "type": "string",
       "description": "A record's id: 15 lowercase letters and digits",
       "pattern": "^[a-z0-9]{15}$",
       "examples": [
        "k3x9q2m7b1v8c4z"
       ]
      }
     }
    ],
    "requestBody": {
     "required": false,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {},
        "required": []
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Done",
      "headers": {
       "RateLimit": {
        "$ref": "#/components/headers/RateLimit"
       },
       "RateLimit-Policy": {
        "$ref": "#/components/headers/RateLimitPolicy"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ActionResult"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "403": {
      "description": "insufficient-scope",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "404": {
      "description": "not-found",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "422": {
      "description": "validation · action-refused",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "429": {
      "description": "rate-limited",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "default": {
      "description": "internal · unavailable",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     }
    }
   }
  },
  "/v1/books/{id}/actions/change_settings": {
   "post": {
    "operationId": "actionChangeSettings",
    "tags": [
     "Actions"
    ],
    "summary": "change settings",
    "x-summary-he": "משנה את הספר",
    "description": "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.\n\nWritten into the book at once, as the user's own; before the first change of a series, a version (`version_saved_before`).",
    "x-scope": "books:write",
    "security": [
     {
      "bearer": []
     },
     {
      "oauth2": [
       "books:write"
      ]
     }
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "The book's id",
      "schema": {
       "type": "string",
       "description": "A record's id: 15 lowercase letters and digits",
       "pattern": "^[a-z0-9]{15}$",
       "examples": [
        "k3x9q2m7b1v8c4z"
       ]
      }
     },
     {
      "$ref": "#/components/parameters/IdempotencyKey"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "changes": {
          "type": "array",
          "items": {
           "type": "object",
           "properties": {
            "path": {
             "type": "string"
            },
            "value": {
             "description": "the new value: number, true/false, text, null (where it has a meaning), {\"pt\": n} / {\"rel\": n} / \"auto\", or an object / a list for a whole structure"
            }
           },
           "required": [
            "path",
            "value"
           ],
           "additionalProperties": false
          }
         }
        },
        "required": [
         "changes"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Done",
      "headers": {
       "RateLimit": {
        "$ref": "#/components/headers/RateLimit"
       },
       "RateLimit-Policy": {
        "$ref": "#/components/headers/RateLimitPolicy"
       },
       "Idempotent-Replayed": {
        "$ref": "#/components/headers/IdempotentReplayed"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ActionResult"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "403": {
      "description": "insufficient-scope",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "404": {
      "description": "not-found",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "422": {
      "description": "validation · action-refused",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "429": {
      "description": "rate-limited",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "default": {
      "description": "internal · unavailable",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     }
    }
   }
  },
  "/v1/books/{id}/actions/edit_list": {
   "post": {
    "operationId": "actionEditList",
    "tags": [
     "Actions"
    ],
    "summary": "edit list",
    "x-summary-he": "משנה את הספר",
    "description": "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.\n\nWritten into the book at once, as the user's own; before the first change of a series, a version (`version_saved_before`).",
    "x-scope": "books:write",
    "security": [
     {
      "bearer": []
     },
     {
      "oauth2": [
       "books:write"
      ]
     }
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "The book's id",
      "schema": {
       "type": "string",
       "description": "A record's id: 15 lowercase letters and digits",
       "pattern": "^[a-z0-9]{15}$",
       "examples": [
        "k3x9q2m7b1v8c4z"
       ]
      }
     },
     {
      "$ref": "#/components/parameters/IdempotencyKey"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "list": {
          "type": "string"
         },
         "op": {
          "type": "string",
          "enum": [
           "add",
           "remove",
           "move",
           "duplicate"
          ]
         },
         "index": {
          "type": "integer"
         },
         "to": {
          "type": "integer"
         },
         "value": {
          "description": "add: the new item (an object; for a list of plain values, the value)"
         }
        },
        "required": [
         "list",
         "op"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Done",
      "headers": {
       "RateLimit": {
        "$ref": "#/components/headers/RateLimit"
       },
       "RateLimit-Policy": {
        "$ref": "#/components/headers/RateLimitPolicy"
       },
       "Idempotent-Replayed": {
        "$ref": "#/components/headers/IdempotentReplayed"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ActionResult"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "403": {
      "description": "insufficient-scope",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "404": {
      "description": "not-found",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "422": {
      "description": "validation · action-refused",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "429": {
      "description": "rate-limited",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "default": {
      "description": "internal · unavailable",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     }
    }
   }
  },
  "/v1/books/{id}/actions/describe_settings": {
   "post": {
    "operationId": "actionDescribeSettings",
    "tags": [
     "Actions"
    ],
    "summary": "describe settings",
    "x-summary-he": "קריאה בלבד",
    "description": "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.\n\nChanges nothing.",
    "x-scope": "books:read",
    "security": [
     {
      "bearer": []
     },
     {
      "oauth2": [
       "books:read"
      ]
     }
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "The book's id",
      "schema": {
       "type": "string",
       "description": "A record's id: 15 lowercase letters and digits",
       "pattern": "^[a-z0-9]{15}$",
       "examples": [
        "k3x9q2m7b1v8c4z"
       ]
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "path": {
          "type": "string"
         }
        },
        "required": [
         "path"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Done",
      "headers": {
       "RateLimit": {
        "$ref": "#/components/headers/RateLimit"
       },
       "RateLimit-Policy": {
        "$ref": "#/components/headers/RateLimitPolicy"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ActionResult"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "403": {
      "description": "insufficient-scope",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "404": {
      "description": "not-found",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "422": {
      "description": "validation · action-refused",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "429": {
      "description": "rate-limited",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "default": {
      "description": "internal · unavailable",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     }
    }
   }
  },
  "/v1/books/{id}/actions/add_style": {
   "post": {
    "operationId": "actionAddStyle",
    "tags": [
     "Actions"
    ],
    "summary": "add style",
    "x-summary-he": "משנה את הספר",
    "description": "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…).\n\nWritten into the book at once, as the user's own; before the first change of a series, a version (`version_saved_before`).",
    "x-scope": "books:write",
    "security": [
     {
      "bearer": []
     },
     {
      "oauth2": [
       "books:write"
      ]
     }
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "The book's id",
      "schema": {
       "type": "string",
       "description": "A record's id: 15 lowercase letters and digits",
       "pattern": "^[a-z0-9]{15}$",
       "examples": [
        "k3x9q2m7b1v8c4z"
       ]
      }
     },
     {
      "$ref": "#/components/parameters/IdempotencyKey"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "kind": {
          "type": "string",
          "enum": [
           "character",
           "paragraph"
          ]
         },
         "name": {
          "type": "string",
          "description": "its Hebrew name, as the user would call it (up to 40 characters)"
         },
         "font": {
          "type": "integer"
         },
         "size": {
          "description": "{\"pt\": n} or {\"rel\": n}"
         },
         "weight": {
          "type": "integer",
          "description": "400 regular, 700 bold: a weight the font has (omit: the font as it is)"
         },
         "color": {
          "type": "string"
         },
         "heading_level": {
          "type": "integer"
         },
         "like": {
          "type": "string",
          "description": "kind paragraph: the name of a paragraph style of the book to copy"
         }
        },
        "required": [
         "kind",
         "name"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Done",
      "headers": {
       "RateLimit": {
        "$ref": "#/components/headers/RateLimit"
       },
       "RateLimit-Policy": {
        "$ref": "#/components/headers/RateLimitPolicy"
       },
       "Idempotent-Replayed": {
        "$ref": "#/components/headers/IdempotentReplayed"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ActionResult"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "403": {
      "description": "insufficient-scope",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "404": {
      "description": "not-found",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "422": {
      "description": "validation · action-refused",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "429": {
      "description": "rate-limited",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "default": {
      "description": "internal · unavailable",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     }
    }
   }
  },
  "/v1/books/{id}/actions/list_templates": {
   "post": {
    "operationId": "actionListTemplates",
    "tags": [
     "Actions"
    ],
    "summary": "list templates",
    "x-summary-he": "קריאה בלבד",
    "description": "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.\n\nChanges nothing.",
    "x-scope": "books:read",
    "security": [
     {
      "bearer": []
     },
     {
      "oauth2": [
       "books:read"
      ]
     }
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "The book's id",
      "schema": {
       "type": "string",
       "description": "A record's id: 15 lowercase letters and digits",
       "pattern": "^[a-z0-9]{15}$",
       "examples": [
        "k3x9q2m7b1v8c4z"
       ]
      }
     }
    ],
    "requestBody": {
     "required": false,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {},
        "required": []
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Done",
      "headers": {
       "RateLimit": {
        "$ref": "#/components/headers/RateLimit"
       },
       "RateLimit-Policy": {
        "$ref": "#/components/headers/RateLimitPolicy"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ActionResult"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "403": {
      "description": "insufficient-scope",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "404": {
      "description": "not-found",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "422": {
      "description": "validation · action-refused",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "429": {
      "description": "rate-limited",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "default": {
      "description": "internal · unavailable",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     }
    }
   }
  },
  "/v1/books/{id}/actions/apply_template": {
   "post": {
    "operationId": "actionApplyTemplate",
    "tags": [
     "Actions"
    ],
    "summary": "apply template",
    "x-summary-he": "משנה את הספר",
    "description": "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.\n\nWritten into the book at once, as the user's own; before the first change of a series, a version (`version_saved_before`).",
    "x-scope": "books:write",
    "security": [
     {
      "bearer": []
     },
     {
      "oauth2": [
       "books:write"
      ]
     }
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "The book's id",
      "schema": {
       "type": "string",
       "description": "A record's id: 15 lowercase letters and digits",
       "pattern": "^[a-z0-9]{15}$",
       "examples": [
        "k3x9q2m7b1v8c4z"
       ]
      }
     },
     {
      "$ref": "#/components/parameters/IdempotencyKey"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "parts": {
          "type": "array",
          "items": {
           "type": "object",
           "properties": {
            "part": {
             "type": "string"
            },
            "design": {
             "type": "string"
            }
           },
           "required": [
            "part",
            "design"
           ],
           "additionalProperties": false
          }
         },
         "changes": {
          "type": "array",
          "items": {
           "type": "object",
           "properties": {
            "path": {
             "type": "string"
            },
            "value": {}
           },
           "required": [
            "path",
            "value"
           ],
           "additionalProperties": false
          }
         }
        },
        "required": [
         "parts"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Done",
      "headers": {
       "RateLimit": {
        "$ref": "#/components/headers/RateLimit"
       },
       "RateLimit-Policy": {
        "$ref": "#/components/headers/RateLimitPolicy"
       },
       "Idempotent-Replayed": {
        "$ref": "#/components/headers/IdempotentReplayed"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ActionResult"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "403": {
      "description": "insufficient-scope",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "404": {
      "description": "not-found",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "422": {
      "description": "validation · action-refused",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "429": {
      "description": "rate-limited",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "default": {
      "description": "internal · unavailable",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     }
    }
   }
  },
  "/v1/books/{id}/actions/find_blocks": {
   "post": {
    "operationId": "actionFindBlocks",
    "tags": [
     "Actions"
    ],
    "summary": "find blocks",
    "x-summary-he": "קריאה בלבד",
    "description": "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`.\n\nChanges nothing.",
    "x-scope": "books:read",
    "security": [
     {
      "bearer": []
     },
     {
      "oauth2": [
       "books:read"
      ]
     }
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "The book's id",
      "schema": {
       "type": "string",
       "description": "A record's id: 15 lowercase letters and digits",
       "pattern": "^[a-z0-9]{15}$",
       "examples": [
        "k3x9q2m7b1v8c4z"
       ]
      }
     }
    ],
    "requestBody": {
     "required": false,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "text": {
          "type": "string"
         },
         "kind": {
          "type": "string"
         },
         "from": {
          "type": "integer"
         },
         "to": {
          "type": "integer"
         },
         "block": {
          "type": "integer"
         },
         "full": {
          "type": "boolean"
         },
         "bold": {
          "type": "string",
          "enum": [
           "all",
           "most",
           "opening",
           "some",
           "none"
          ],
          "description": "by 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"
         }
        },
        "required": []
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Done",
      "headers": {
       "RateLimit": {
        "$ref": "#/components/headers/RateLimit"
       },
       "RateLimit-Policy": {
        "$ref": "#/components/headers/RateLimitPolicy"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ActionResult"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "403": {
      "description": "insufficient-scope",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "404": {
      "description": "not-found",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "422": {
      "description": "validation · action-refused",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "429": {
      "description": "rate-limited",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "default": {
      "description": "internal · unavailable",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     }
    }
   }
  },
  "/v1/books/{id}/actions/set_block_kind": {
   "post": {
    "operationId": "actionSetBlockKind",
    "tags": [
     "Actions"
    ],
    "summary": "set block kind",
    "x-summary-he": "משנה את הספר",
    "description": "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.\n\nWritten into the book at once, as the user's own; before the first change of a series, a version (`version_saved_before`).",
    "x-scope": "books:write",
    "security": [
     {
      "bearer": []
     },
     {
      "oauth2": [
       "books:write"
      ]
     }
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "The book's id",
      "schema": {
       "type": "string",
       "description": "A record's id: 15 lowercase letters and digits",
       "pattern": "^[a-z0-9]{15}$",
       "examples": [
        "k3x9q2m7b1v8c4z"
       ]
      }
     },
     {
      "$ref": "#/components/parameters/IdempotencyKey"
     }
    ],
    "requestBody": {
     "required": false,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "block": {
          "type": "integer",
          "description": "the paragraph's number from find_blocks (1 = the book's first)"
         },
         "starts_with": {
          "type": "string",
          "description": "the paragraph's opening words, as find_blocks gave them — checked, so a paragraph that moved is not the one changed"
         },
         "kind": {
          "type": "string",
          "enum": [
           "h1",
           "h2",
           "h3",
           "h4",
           "h5",
           "h6",
           "p",
           "style"
          ],
          "description": "h1…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)"
         },
         "style": {
          "type": "string",
          "description": "with kind \"style\": the paragraph style's name (book_overview: paragraph_styles)"
         },
         "items": {
          "type": "array",
          "items": {
           "type": "object",
           "properties": {
            "block": {
             "type": "integer",
             "description": "the paragraph's number from find_blocks (1 = the book's first)"
            },
            "starts_with": {
             "type": "string",
             "description": "the paragraph's opening words, as find_blocks gave them — checked, so a paragraph that moved is not the one changed"
            },
            "kind": {
             "type": "string",
             "enum": [
              "h1",
              "h2",
              "h3",
              "h4",
              "h5",
              "h6",
              "p",
              "style"
             ],
             "description": "h1…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)"
            },
            "style": {
             "type": "string",
             "description": "with kind \"style\": the paragraph style's name (book_overview: paragraph_styles)"
            }
           },
           "required": [
            "block",
            "starts_with",
            "kind"
           ],
           "additionalProperties": false
          }
         }
        },
        "required": []
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Done",
      "headers": {
       "RateLimit": {
        "$ref": "#/components/headers/RateLimit"
       },
       "RateLimit-Policy": {
        "$ref": "#/components/headers/RateLimitPolicy"
       },
       "Idempotent-Replayed": {
        "$ref": "#/components/headers/IdempotentReplayed"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ActionResult"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "403": {
      "description": "insufficient-scope",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "404": {
      "description": "not-found",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "422": {
      "description": "validation · action-refused",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "429": {
      "description": "rate-limited",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "default": {
      "description": "internal · unavailable",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     }
    }
   }
  },
  "/v1/books/{id}/actions/add_title_page": {
   "post": {
    "operationId": "actionAddTitlePage",
    "tags": [
     "Actions"
    ],
    "summary": "add title page",
    "x-summary-he": "משנה את הספר",
    "description": "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.\n\nWritten into the book at once, as the user's own; before the first change of a series, a version (`version_saved_before`).",
    "x-scope": "books:write",
    "security": [
     {
      "bearer": []
     },
     {
      "oauth2": [
       "books:write"
      ]
     }
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "The book's id",
      "schema": {
       "type": "string",
       "description": "A record's id: 15 lowercase letters and digits",
       "pattern": "^[a-z0-9]{15}$",
       "examples": [
        "k3x9q2m7b1v8c4z"
       ]
      }
     },
     {
      "$ref": "#/components/parameters/IdempotencyKey"
     }
    ],
    "requestBody": {
     "required": false,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "name": {
          "type": "string",
          "description": "only for a second title page: its name"
         }
        },
        "required": []
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Done",
      "headers": {
       "RateLimit": {
        "$ref": "#/components/headers/RateLimit"
       },
       "RateLimit-Policy": {
        "$ref": "#/components/headers/RateLimitPolicy"
       },
       "Idempotent-Replayed": {
        "$ref": "#/components/headers/IdempotentReplayed"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ActionResult"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "403": {
      "description": "insufficient-scope",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "404": {
      "description": "not-found",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "422": {
      "description": "validation · action-refused",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "429": {
      "description": "rate-limited",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "default": {
      "description": "internal · unavailable",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     }
    }
   }
  },
  "/v1/books/{id}/actions/bold_title_words": {
   "post": {
    "operationId": "actionBoldTitleWords",
    "tags": [
     "Actions"
    ],
    "summary": "bold title words",
    "x-summary-he": "משנה את הספר",
    "description": "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.\n\nWritten into the book at once, as the user's own; before the first change of a series, a version (`version_saved_before`).",
    "x-scope": "books:write",
    "security": [
     {
      "bearer": []
     },
     {
      "oauth2": [
       "books:write"
      ]
     }
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "The book's id",
      "schema": {
       "type": "string",
       "description": "A record's id: 15 lowercase letters and digits",
       "pattern": "^[a-z0-9]{15}$",
       "examples": [
        "k3x9q2m7b1v8c4z"
       ]
      }
     },
     {
      "$ref": "#/components/parameters/IdempotencyKey"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "words": {
          "type": "array",
          "items": {
           "type": "string"
          },
          "description": "the words to make bold (or plain), each stretch as the line has it"
         },
         "line": {
          "type": "integer",
          "description": "the line's index in templates[i].title.lines"
         },
         "part": {
          "type": "string",
          "description": "the title page's name (templates[i].name), when the book has more than one"
         },
         "bold": {
          "type": "boolean",
          "description": "false: make them plain again (default true)"
         },
         "only": {
          "type": "boolean",
          "description": "these words alone bold in the line"
         },
         "size": {
          "type": "number",
          "description": "the 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"
         }
        },
        "required": [
         "words"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Done",
      "headers": {
       "RateLimit": {
        "$ref": "#/components/headers/RateLimit"
       },
       "RateLimit-Policy": {
        "$ref": "#/components/headers/RateLimitPolicy"
       },
       "Idempotent-Replayed": {
        "$ref": "#/components/headers/IdempotentReplayed"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ActionResult"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "403": {
      "description": "insufficient-scope",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "404": {
      "description": "not-found",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "422": {
      "description": "validation · action-refused",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "429": {
      "description": "rate-limited",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "default": {
      "description": "internal · unavailable",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     }
    }
   }
  },
  "/v1/books/{id}/actions/insert_heading": {
   "post": {
    "operationId": "actionInsertHeading",
    "tags": [
     "Actions"
    ],
    "summary": "insert heading",
    "x-summary-he": "משנה את הספר",
    "description": "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.\n\nWritten into the book at once, as the user's own; before the first change of a series, a version (`version_saved_before`).",
    "x-scope": "books:write",
    "security": [
     {
      "bearer": []
     },
     {
      "oauth2": [
       "books:write"
      ]
     }
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "The book's id",
      "schema": {
       "type": "string",
       "description": "A record's id: 15 lowercase letters and digits",
       "pattern": "^[a-z0-9]{15}$",
       "examples": [
        "k3x9q2m7b1v8c4z"
       ]
      }
     },
     {
      "$ref": "#/components/parameters/IdempotencyKey"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "before": {
          "type": "integer",
          "description": "the paragraph's number from find_blocks (1 = the book's first)"
         },
         "starts_with": {
          "type": "string",
          "description": "the paragraph's opening words, as find_blocks gave them — checked, so a paragraph that moved is not the one changed"
         },
         "text": {
          "type": "string",
          "description": "the heading's words (↵: a line break inside it)"
         },
         "kind": {
          "type": "string",
          "enum": [
           "h1",
           "h2",
           "h3",
           "h4",
           "h5",
           "h6"
          ],
          "description": "the heading's level: h1…h6"
         }
        },
        "required": [
         "before",
         "text",
         "kind"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Done",
      "headers": {
       "RateLimit": {
        "$ref": "#/components/headers/RateLimit"
       },
       "RateLimit-Policy": {
        "$ref": "#/components/headers/RateLimitPolicy"
       },
       "Idempotent-Replayed": {
        "$ref": "#/components/headers/IdempotentReplayed"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ActionResult"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "403": {
      "description": "insufficient-scope",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "404": {
      "description": "not-found",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "422": {
      "description": "validation · action-refused",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "429": {
      "description": "rate-limited",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "default": {
      "description": "internal · unavailable",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     }
    }
   }
  },
  "/v1/books/{id}/actions/add_part": {
   "post": {
    "operationId": "actionAddPart",
    "tags": [
     "Actions"
    ],
    "summary": "add part",
    "x-summary-he": "משנה את הספר",
    "description": "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).\n\nWritten into the book at once, as the user's own; before the first change of a series, a version (`version_saved_before`).",
    "x-scope": "books:write",
    "security": [
     {
      "bearer": []
     },
     {
      "oauth2": [
       "books:write"
      ]
     }
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "The book's id",
      "schema": {
       "type": "string",
       "description": "A record's id: 15 lowercase letters and digits",
       "pattern": "^[a-z0-9]{15}$",
       "examples": [
        "k3x9q2m7b1v8c4z"
       ]
      }
     },
     {
      "$ref": "#/components/parameters/IdempotencyKey"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "name": {
          "type": "string",
          "description": "the part's name (a new part: the name it is given)"
         },
         "part": {
          "type": "object",
          "description": "a 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"
         },
         "before": {
          "type": "integer",
          "description": "not for a title page: the paragraph the part opens before (find_blocks); with blank, left out: at the book's end"
         },
         "starts_with": {
          "type": "string",
          "description": "the paragraph's opening words, as find_blocks gave them — checked, so a paragraph that moved is not the one changed"
         },
         "blank": {
          "type": "boolean",
          "description": "a 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)"
         }
        },
        "required": [
         "name"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Done",
      "headers": {
       "RateLimit": {
        "$ref": "#/components/headers/RateLimit"
       },
       "RateLimit-Policy": {
        "$ref": "#/components/headers/RateLimitPolicy"
       },
       "Idempotent-Replayed": {
        "$ref": "#/components/headers/IdempotentReplayed"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ActionResult"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "403": {
      "description": "insufficient-scope",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "404": {
      "description": "not-found",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "422": {
      "description": "validation · action-refused",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "429": {
      "description": "rate-limited",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "default": {
      "description": "internal · unavailable",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     }
    }
   }
  },
  "/v1/books/{id}/actions/edit_heading_text": {
   "post": {
    "operationId": "actionEditHeadingText",
    "tags": [
     "Actions"
    ],
    "summary": "edit heading text",
    "x-summary-he": "משנה את הספר",
    "description": "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).\n\nWritten into the book at once, as the user's own; before the first change of a series, a version (`version_saved_before`).",
    "x-scope": "books:write",
    "security": [
     {
      "bearer": []
     },
     {
      "oauth2": [
       "books:write"
      ]
     }
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "The book's id",
      "schema": {
       "type": "string",
       "description": "A record's id: 15 lowercase letters and digits",
       "pattern": "^[a-z0-9]{15}$",
       "examples": [
        "k3x9q2m7b1v8c4z"
       ]
      }
     },
     {
      "$ref": "#/components/parameters/IdempotencyKey"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "block": {
          "type": "integer",
          "description": "the paragraph's number from find_blocks (1 = the book's first)"
         },
         "starts_with": {
          "type": "string",
          "description": "the paragraph's opening words, as find_blocks gave them — checked, so a paragraph that moved is not the one changed"
         },
         "text": {
          "type": "string",
          "description": "the heading's new words (↵: a line break inside it — a heading in two lines)"
         }
        },
        "required": [
         "block",
         "starts_with",
         "text"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Done",
      "headers": {
       "RateLimit": {
        "$ref": "#/components/headers/RateLimit"
       },
       "RateLimit-Policy": {
        "$ref": "#/components/headers/RateLimitPolicy"
       },
       "Idempotent-Replayed": {
        "$ref": "#/components/headers/IdempotentReplayed"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ActionResult"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "403": {
      "description": "insufficient-scope",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "404": {
      "description": "not-found",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "422": {
      "description": "validation · action-refused",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "429": {
      "description": "rate-limited",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "default": {
      "description": "internal · unavailable",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     }
    }
   }
  },
  "/v1/books/{id}/actions/set_paragraphs": {
   "post": {
    "operationId": "actionSetParagraphs",
    "tags": [
     "Actions"
    ],
    "summary": "set paragraphs",
    "x-summary-he": "משנה את הספר",
    "description": "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.\n\nWritten into the book at once, as the user's own; before the first change of a series, a version (`version_saved_before`).",
    "x-scope": "books:write",
    "security": [
     {
      "bearer": []
     },
     {
      "oauth2": [
       "books:write"
      ]
     }
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "The book's id",
      "schema": {
       "type": "string",
       "description": "A record's id: 15 lowercase letters and digits",
       "pattern": "^[a-z0-9]{15}$",
       "examples": [
        "k3x9q2m7b1v8c4z"
       ]
      }
     },
     {
      "$ref": "#/components/parameters/IdempotencyKey"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "title": {
          "type": "string"
         },
         "kind": {
          "type": "string",
          "enum": [
           "h1",
           "h2",
           "h3",
           "h4",
           "h5",
           "h6",
           "p",
           "style"
          ],
          "description": "h1…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)"
         },
         "style": {
          "type": "string",
          "description": "with kind \"style\": the paragraph style's name (book_overview: paragraph_styles)"
         },
         "where": {
          "type": "object",
          "properties": {
           "match": {
            "type": "string",
            "enum": [
             "exact",
             "spelling",
             "pattern"
            ]
           },
           "text": {
            "type": "string"
           },
           "whole_word": {
            "type": "boolean"
           },
           "prefixes": {
            "type": "boolean"
           },
           "wildcards": {
            "type": "boolean"
           },
           "ignore": {
            "type": "object",
            "properties": {
             "niqqud": {
              "type": "boolean"
             },
             "cantillation": {
              "type": "boolean"
             },
             "finals": {
              "type": "boolean"
             },
             "quotes": {
              "type": "boolean"
             },
             "dashes": {
              "type": "boolean"
             },
             "spaces": {
              "type": "boolean"
             },
             "ktiv": {
              "type": "boolean"
             },
             "case": {
              "type": "boolean"
             }
            },
            "required": [],
            "additionalProperties": false
           },
           "streams": {
            "type": "array",
            "items": {
             "type": "integer"
            }
           },
           "blocks": {
            "type": "array",
            "items": {
             "type": "string"
            }
           },
           "paragraphs": {
            "type": "object",
            "properties": {
             "from": {
              "type": "integer"
             },
             "to": {
              "type": "integer"
             }
            },
            "required": [
             "from",
             "to"
            ],
            "additionalProperties": false
           },
           "in_selection": {
            "type": "boolean"
           },
           "looks": {
            "type": "object",
            "properties": {
             "bold": {
              "type": [
               "boolean",
               "null"
              ]
             },
             "style": {
              "type": [
               "integer",
               "null"
              ],
              "description": "a character style's code (book_overview: character_styles)"
             }
            },
            "required": [],
            "additionalProperties": false
           },
           "examples": {
            "type": "array",
            "items": {
             "type": "object",
             "properties": {
              "text": {
               "type": "string"
              },
              "matches": {
               "type": "boolean"
              },
              "after": {
               "type": [
                "string",
                "null"
               ],
               "description": "with a replacement: the whole example after it"
              }
             },
             "required": [
              "text",
              "matches"
             ],
             "additionalProperties": false
            }
           },
           "paragraph_style": {
            "type": "string"
           },
           "bold": {
            "type": "string",
            "enum": [
             "all",
             "most",
             "opening",
             "some",
             "none"
            ],
            "description": "by 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"
           },
           "first_after": {
            "type": "array",
            "items": {
             "type": "string"
            },
            "description": "heading levels (\"h1\"…\"h6\") or \"heading\": the first paragraph under each"
           },
           "every": {
            "type": "integer",
            "description": "of the paragraphs found, only every so many: 2 is every second paragraph"
           },
           "every_from": {
            "type": "integer",
            "description": "with every: which of those found is the first taken (from 1; left out: the first)"
           },
           "starts_with": {
            "type": "string",
            "description": "with `paragraphs` alone (no text, no blocks): the first paragraph's opening words, as find_blocks gave them — a few paragraphs (up to 20) acted on by their numbers"
           }
          },
          "required": [],
          "additionalProperties": false
         }
        },
        "required": [
         "title",
         "kind",
         "where"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Done",
      "headers": {
       "RateLimit": {
        "$ref": "#/components/headers/RateLimit"
       },
       "RateLimit-Policy": {
        "$ref": "#/components/headers/RateLimitPolicy"
       },
       "Idempotent-Replayed": {
        "$ref": "#/components/headers/IdempotentReplayed"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ActionResult"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "403": {
      "description": "insufficient-scope",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "404": {
      "description": "not-found",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "422": {
      "description": "validation · action-refused",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "429": {
      "description": "rate-limited",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "default": {
      "description": "internal · unavailable",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     }
    }
   }
  },
  "/v1/books/{id}/actions/remove_paragraphs": {
   "post": {
    "operationId": "actionRemoveParagraphs",
    "tags": [
     "Actions"
    ],
    "summary": "remove paragraphs",
    "x-summary-he": "מוחקת מהספר",
    "description": "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.\n\nWritten into the book at once, as the user's own; before the first change of a series, a version (`version_saved_before`).",
    "x-scope": "books:write",
    "security": [
     {
      "bearer": []
     },
     {
      "oauth2": [
       "books:write"
      ]
     }
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "The book's id",
      "schema": {
       "type": "string",
       "description": "A record's id: 15 lowercase letters and digits",
       "pattern": "^[a-z0-9]{15}$",
       "examples": [
        "k3x9q2m7b1v8c4z"
       ]
      }
     },
     {
      "$ref": "#/components/parameters/IdempotencyKey"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "title": {
          "type": "string"
         },
         "where": {
          "type": "object",
          "properties": {
           "match": {
            "type": "string",
            "enum": [
             "exact",
             "spelling",
             "pattern"
            ]
           },
           "text": {
            "type": "string"
           },
           "whole_word": {
            "type": "boolean"
           },
           "prefixes": {
            "type": "boolean"
           },
           "wildcards": {
            "type": "boolean"
           },
           "ignore": {
            "type": "object",
            "properties": {
             "niqqud": {
              "type": "boolean"
             },
             "cantillation": {
              "type": "boolean"
             },
             "finals": {
              "type": "boolean"
             },
             "quotes": {
              "type": "boolean"
             },
             "dashes": {
              "type": "boolean"
             },
             "spaces": {
              "type": "boolean"
             },
             "ktiv": {
              "type": "boolean"
             },
             "case": {
              "type": "boolean"
             }
            },
            "required": [],
            "additionalProperties": false
           },
           "streams": {
            "type": "array",
            "items": {
             "type": "integer"
            }
           },
           "blocks": {
            "type": "array",
            "items": {
             "type": "string"
            }
           },
           "paragraphs": {
            "type": "object",
            "properties": {
             "from": {
              "type": "integer"
             },
             "to": {
              "type": "integer"
             }
            },
            "required": [
             "from",
             "to"
            ],
            "additionalProperties": false
           },
           "in_selection": {
            "type": "boolean"
           },
           "looks": {
            "type": "object",
            "properties": {
             "bold": {
              "type": [
               "boolean",
               "null"
              ]
             },
             "style": {
              "type": [
               "integer",
               "null"
              ],
              "description": "a character style's code (book_overview: character_styles)"
             }
            },
            "required": [],
            "additionalProperties": false
           },
           "examples": {
            "type": "array",
            "items": {
             "type": "object",
             "properties": {
              "text": {
               "type": "string"
              },
              "matches": {
               "type": "boolean"
              },
              "after": {
               "type": [
                "string",
                "null"
               ],
               "description": "with a replacement: the whole example after it"
              }
             },
             "required": [
              "text",
              "matches"
             ],
             "additionalProperties": false
            }
           },
           "paragraph_style": {
            "type": "string"
           },
           "empty": {
            "type": "boolean"
           },
           "first_after": {
            "type": "array",
            "items": {
             "type": "string"
            },
            "description": "heading levels (\"h1\"…\"h6\") or \"heading\": the first paragraph under each"
           },
           "starts_with": {
            "type": "string",
            "description": "with `paragraphs` alone (no text, no blocks): the first paragraph's opening words, as find_blocks gave them — a few paragraphs (up to 20) acted on by their numbers"
           }
          },
          "required": [],
          "additionalProperties": false
         }
        },
        "required": [
         "title",
         "where"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Done",
      "headers": {
       "RateLimit": {
        "$ref": "#/components/headers/RateLimit"
       },
       "RateLimit-Policy": {
        "$ref": "#/components/headers/RateLimitPolicy"
       },
       "Idempotent-Replayed": {
        "$ref": "#/components/headers/IdempotentReplayed"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ActionResult"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "403": {
      "description": "insufficient-scope",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "404": {
      "description": "not-found",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "422": {
      "description": "validation · action-refused",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "429": {
      "description": "rate-limited",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "default": {
      "description": "internal · unavailable",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     }
    }
   }
  },
  "/v1/books/{id}/actions/find_text": {
   "post": {
    "operationId": "actionFindText",
    "tags": [
     "Actions"
    ],
    "summary": "find text",
    "x-summary-he": "קריאה בלבד",
    "description": "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.\n\nChanges nothing.",
    "x-scope": "books:read",
    "security": [
     {
      "bearer": []
     },
     {
      "oauth2": [
       "books:read"
      ]
     }
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "The book's id",
      "schema": {
       "type": "string",
       "description": "A record's id: 15 lowercase letters and digits",
       "pattern": "^[a-z0-9]{15}$",
       "examples": [
        "k3x9q2m7b1v8c4z"
       ]
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "match": {
          "type": "string",
          "enum": [
           "exact",
           "spelling",
           "pattern"
          ]
         },
         "text": {
          "type": "string",
          "description": "the words (exact / spelling) or the expression (pattern); empty with `looks` alone"
         },
         "whole_word": {
          "type": "boolean"
         },
         "prefixes": {
          "type": "boolean",
          "description": "left out with whole_word true (not in a pattern): true — the word with its prefix letters; false only for the exact letters"
         },
         "wildcards": {
          "type": "boolean"
         },
         "ignore": {
          "type": "object",
          "properties": {
           "niqqud": {
            "type": "boolean"
           },
           "cantillation": {
            "type": "boolean"
           },
           "finals": {
            "type": "boolean"
           },
           "quotes": {
            "type": "boolean"
           },
           "dashes": {
            "type": "boolean"
           },
           "spaces": {
            "type": "boolean"
           },
           "ktiv": {
            "type": "boolean"
           },
           "case": {
            "type": "boolean"
           }
          },
          "required": [],
          "additionalProperties": false
         },
         "streams": {
          "type": "array",
          "items": {
           "type": "integer"
          },
          "description": "the texts searched, by code (book_overview: texts; 0 the main text); left out: all"
         },
         "blocks": {
          "type": "array",
          "items": {
           "type": "string",
           "enum": [
            "p",
            "h1",
            "h2",
            "h3"
           ]
          },
          "description": "kinds 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"
         },
         "paragraphs": {
          "type": "object",
          "properties": {
           "from": {
            "type": "integer"
           },
           "to": {
            "type": "integer"
           }
          },
          "required": [
           "from",
           "to"
          ],
          "additionalProperties": false
         },
         "looks": {
          "type": "object",
          "properties": {
           "bold": {
            "type": [
             "boolean",
             "null"
            ]
           },
           "style": {
            "type": [
             "integer",
             "null"
            ],
            "description": "a character style's code (book_overview: character_styles)"
           }
          },
          "required": [],
          "additionalProperties": false
         },
         "examples": {
          "type": "array",
          "description": "3–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",
          "items": {
           "type": "object",
           "properties": {
            "text": {
             "type": "string"
            },
            "matches": {
             "type": "boolean"
            },
            "after": {
             "type": [
              "string",
              "null"
             ],
             "description": "with a replacement: the whole example after it"
            }
           },
           "required": [
            "text",
            "matches"
           ],
           "additionalProperties": false
          }
         },
         "replace": {
          "type": [
           "string",
           "null"
          ],
          "description": "the 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_looks": {
          "type": "object",
          "properties": {
           "bold": {
            "type": [
             "boolean",
             "null"
            ]
           },
           "add_style": {
            "type": [
             "integer",
             "null"
            ],
            "description": "a character style's code (book_overview: character_styles)"
           },
           "remove_style": {
            "type": [
             "integer",
             "null"
            ],
            "description": "a character style's code (book_overview: character_styles)"
           }
          },
          "required": [],
          "additionalProperties": false
         },
         "paragraph_list": {
          "type": "array",
          "items": {
           "type": "object",
           "properties": {
            "from": {
             "type": "integer"
            },
            "to": {
             "type": "integer"
            }
           },
           "required": [
            "from",
            "to"
           ],
           "additionalProperties": false
          },
          "description": "several stretches of paragraphs (numbers from find_blocks) in ONE search — in place of `paragraphs`; never a call per paragraph"
         },
         "more": {
          "type": "array",
          "items": {
           "type": "object",
           "properties": {
            "text": {
             "type": "string"
            },
            "replace": {
             "type": [
              "string",
              "null"
             ]
            }
           },
           "required": [
            "text"
           ],
           "additionalProperties": false
          },
          "description": "more 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"
         },
         "title": {
          "type": "string",
          "description": "with show_user: the card's title, one short Hebrew line"
         }
        },
        "required": [
         "match",
         "text"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Done",
      "headers": {
       "RateLimit": {
        "$ref": "#/components/headers/RateLimit"
       },
       "RateLimit-Policy": {
        "$ref": "#/components/headers/RateLimitPolicy"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ActionResult"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "403": {
      "description": "insufficient-scope",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "404": {
      "description": "not-found",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "422": {
      "description": "validation · action-refused",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "429": {
      "description": "rate-limited",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "default": {
      "description": "internal · unavailable",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     }
    }
   }
  },
  "/v1/books/{id}/actions/change_text": {
   "post": {
    "operationId": "actionChangeText",
    "tags": [
     "Actions"
    ],
    "summary": "change text",
    "x-summary-he": "משנה את הספר",
    "description": "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.\n\nWritten into the book at once, as the user's own; before the first change of a series, a version (`version_saved_before`).",
    "x-scope": "books:write",
    "security": [
     {
      "bearer": []
     },
     {
      "oauth2": [
       "books:write"
      ]
     }
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "The book's id",
      "schema": {
       "type": "string",
       "description": "A record's id: 15 lowercase letters and digits",
       "pattern": "^[a-z0-9]{15}$",
       "examples": [
        "k3x9q2m7b1v8c4z"
       ]
      }
     },
     {
      "$ref": "#/components/parameters/IdempotencyKey"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "title": {
          "type": "string"
         },
         "match": {
          "type": "string",
          "enum": [
           "exact",
           "spelling",
           "pattern"
          ]
         },
         "text": {
          "type": "string"
         },
         "whole_word": {
          "type": "boolean"
         },
         "prefixes": {
          "type": "boolean"
         },
         "wildcards": {
          "type": "boolean"
         },
         "ignore": {
          "type": "object",
          "properties": {
           "niqqud": {
            "type": "boolean"
           },
           "cantillation": {
            "type": "boolean"
           },
           "finals": {
            "type": "boolean"
           },
           "quotes": {
            "type": "boolean"
           },
           "dashes": {
            "type": "boolean"
           },
           "spaces": {
            "type": "boolean"
           },
           "ktiv": {
            "type": "boolean"
           },
           "case": {
            "type": "boolean"
           }
          },
          "required": [],
          "additionalProperties": false
         },
         "streams": {
          "type": "array",
          "items": {
           "type": "integer"
          }
         },
         "blocks": {
          "type": "array",
          "items": {
           "type": "string",
           "enum": [
            "p",
            "h1",
            "h2",
            "h3"
           ]
          }
         },
         "paragraphs": {
          "type": "object",
          "properties": {
           "from": {
            "type": "integer"
           },
           "to": {
            "type": "integer"
           }
          },
          "required": [
           "from",
           "to"
          ],
          "additionalProperties": false
         },
         "looks": {
          "type": "object",
          "properties": {
           "bold": {
            "type": [
             "boolean",
             "null"
            ]
           },
           "style": {
            "type": [
             "integer",
             "null"
            ],
            "description": "a character style's code (book_overview: character_styles)"
           }
          },
          "required": [],
          "additionalProperties": false
         },
         "examples": {
          "type": "array",
          "items": {
           "type": "object",
           "properties": {
            "text": {
             "type": "string"
            },
            "matches": {
             "type": "boolean"
            },
            "after": {
             "type": [
              "string",
              "null"
             ],
             "description": "with a replacement: the whole example after it"
            }
           },
           "required": [
            "text",
            "matches"
           ],
           "additionalProperties": false
          }
         },
         "replace": {
          "type": [
           "string",
           "null"
          ],
          "description": "the 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_looks": {
          "type": "object",
          "properties": {
           "bold": {
            "type": [
             "boolean",
             "null"
            ]
           },
           "add_style": {
            "type": [
             "integer",
             "null"
            ],
            "description": "a character style's code (book_overview: character_styles)"
           },
           "remove_style": {
            "type": [
             "integer",
             "null"
            ],
            "description": "a character style's code (book_overview: character_styles)"
           }
          },
          "required": [],
          "additionalProperties": false
         },
         "paragraph_list": {
          "type": "array",
          "items": {
           "type": "object",
           "properties": {
            "from": {
             "type": "integer"
            },
            "to": {
             "type": "integer"
            }
           },
           "required": [
            "from",
            "to"
           ],
           "additionalProperties": false
          }
         },
         "more": {
          "type": "array",
          "items": {
           "type": "object",
           "properties": {
            "text": {
             "type": "string"
            },
            "replace": {
             "type": [
              "string",
              "null"
             ]
            }
           },
           "required": [
            "text"
           ],
           "additionalProperties": false
          }
         }
        },
        "required": [
         "title",
         "match",
         "text"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Done",
      "headers": {
       "RateLimit": {
        "$ref": "#/components/headers/RateLimit"
       },
       "RateLimit-Policy": {
        "$ref": "#/components/headers/RateLimitPolicy"
       },
       "Idempotent-Replayed": {
        "$ref": "#/components/headers/IdempotentReplayed"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ActionResult"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "403": {
      "description": "insufficient-scope",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "404": {
      "description": "not-found",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "422": {
      "description": "validation · action-refused",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "429": {
      "description": "rate-limited",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "default": {
      "description": "internal · unavailable",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     }
    }
   }
  },
  "/v1/books/{id}/actions/insert_text": {
   "post": {
    "operationId": "actionInsertText",
    "tags": [
     "Actions"
    ],
    "summary": "insert text",
    "x-summary-he": "משנה את הספר",
    "description": "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.\n\nWritten into the book at once, as the user's own; before the first change of a series, a version (`version_saved_before`).",
    "x-scope": "books:write",
    "security": [
     {
      "bearer": []
     },
     {
      "oauth2": [
       "books:write"
      ]
     }
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "The book's id",
      "schema": {
       "type": "string",
       "description": "A record's id: 15 lowercase letters and digits",
       "pattern": "^[a-z0-9]{15}$",
       "examples": [
        "k3x9q2m7b1v8c4z"
       ]
      }
     },
     {
      "$ref": "#/components/parameters/IdempotencyKey"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "text": {
          "type": "string"
         },
         "before": {
          "type": "integer"
         },
         "starts_with": {
          "type": "string",
          "description": "with `before`: the words that open that paragraph, as find_blocks gave them — checked, so a paragraph that moved is not the one written before"
         },
         "part": {
          "type": "string"
         },
         "title": {
          "type": "string"
         }
        },
        "required": [
         "text",
         "title"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Done",
      "headers": {
       "RateLimit": {
        "$ref": "#/components/headers/RateLimit"
       },
       "RateLimit-Policy": {
        "$ref": "#/components/headers/RateLimitPolicy"
       },
       "Idempotent-Replayed": {
        "$ref": "#/components/headers/IdempotentReplayed"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ActionResult"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "403": {
      "description": "insufficient-scope",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "404": {
      "description": "not-found",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "422": {
      "description": "validation · action-refused",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "429": {
      "description": "rate-limited",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "default": {
      "description": "internal · unavailable",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     }
    }
   }
  },
  "/v1/books/{id}/actions/format_paragraphs": {
   "post": {
    "operationId": "actionFormatParagraphs",
    "tags": [
     "Actions"
    ],
    "summary": "format paragraphs",
    "x-summary-he": "משנה את הספר",
    "description": "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.\n\nWritten into the book at once, as the user's own; before the first change of a series, a version (`version_saved_before`).",
    "x-scope": "books:write",
    "security": [
     {
      "bearer": []
     },
     {
      "oauth2": [
       "books:write"
      ]
     }
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "The book's id",
      "schema": {
       "type": "string",
       "description": "A record's id: 15 lowercase letters and digits",
       "pattern": "^[a-z0-9]{15}$",
       "examples": [
        "k3x9q2m7b1v8c4z"
       ]
      }
     },
     {
      "$ref": "#/components/parameters/IdempotencyKey"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "title": {
          "type": "string",
          "description": "one short Hebrew line saying what changes, for the turn's list and a card"
         },
         "where": {
          "type": "object",
          "properties": {
           "selection": {
            "type": "boolean"
           },
           "match": {
            "type": "string",
            "enum": [
             "exact",
             "spelling",
             "pattern"
            ]
           },
           "text": {
            "type": "string"
           },
           "whole_word": {
            "type": "boolean"
           },
           "prefixes": {
            "type": "boolean"
           },
           "wildcards": {
            "type": "boolean"
           },
           "ignore": {
            "type": "object"
           },
           "examples": {
            "type": "array",
            "items": {
             "type": "object"
            }
           },
           "streams": {
            "type": "array",
            "items": {
             "type": "integer"
            }
           },
           "in_selection": {
            "type": "boolean"
           },
           "paragraphs": {
            "type": "object",
            "properties": {
             "from": {
              "type": "integer"
             },
             "to": {
              "type": "integer"
             }
            },
            "required": [
             "from",
             "to"
            ],
            "additionalProperties": false
           },
           "starts_with": {
            "type": "string",
            "description": "with `paragraphs` (beside it in `where`, not inside it): the words that open paragraph `from`, as find_blocks gave them — required with paragraphs; checked, so a paragraph that moved is not the one changed. An empty paragraph (no words: a line of space) is named by its number alone — `paragraphs` {from: n, to: n}, starts_with \"\""
           },
           "blocks": {
            "type": "array",
            "items": {
             "type": "string"
            }
           },
           "paragraph_style": {
            "type": "string"
           },
           "bold": {
            "type": "string",
            "enum": [
             "all",
             "most",
             "opening",
             "some",
             "none"
            ],
            "description": "by 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"
           },
           "first_after": {
            "type": "array",
            "items": {
             "type": "string"
            }
           }
          },
          "required": [],
          "additionalProperties": false
         },
         "set": {
          "type": "object",
          "description": "field → value (null: back to the style)"
         },
         "clear": {
          "type": "boolean"
         }
        },
        "required": [
         "title",
         "where"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Done",
      "headers": {
       "RateLimit": {
        "$ref": "#/components/headers/RateLimit"
       },
       "RateLimit-Policy": {
        "$ref": "#/components/headers/RateLimitPolicy"
       },
       "Idempotent-Replayed": {
        "$ref": "#/components/headers/IdempotentReplayed"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ActionResult"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "403": {
      "description": "insufficient-scope",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "404": {
      "description": "not-found",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "422": {
      "description": "validation · action-refused",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "429": {
      "description": "rate-limited",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "default": {
      "description": "internal · unavailable",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     }
    }
   }
  },
  "/v1/books/{id}/actions/read_looks": {
   "post": {
    "operationId": "actionReadLooks",
    "tags": [
     "Actions"
    ],
    "summary": "read looks",
    "x-summary-he": "קריאה בלבד",
    "description": "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.\n\nChanges nothing.",
    "x-scope": "books:read",
    "security": [
     {
      "bearer": []
     },
     {
      "oauth2": [
       "books:read"
      ]
     }
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "The book's id",
      "schema": {
       "type": "string",
       "description": "A record's id: 15 lowercase letters and digits",
       "pattern": "^[a-z0-9]{15}$",
       "examples": [
        "k3x9q2m7b1v8c4z"
       ]
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "where": {
          "type": "object",
          "properties": {
           "selection": {
            "type": "boolean"
           },
           "match": {
            "type": "string",
            "enum": [
             "exact",
             "spelling",
             "pattern"
            ]
           },
           "text": {
            "type": "string"
           },
           "whole_word": {
            "type": "boolean"
           },
           "prefixes": {
            "type": "boolean"
           },
           "streams": {
            "type": "array",
            "items": {
             "type": "integer"
            }
           },
           "in_selection": {
            "type": "boolean"
           },
           "paragraphs": {
            "type": "object",
            "properties": {
             "from": {
              "type": "integer"
             },
             "to": {
              "type": "integer"
             }
            },
            "required": [
             "from",
             "to"
            ],
            "additionalProperties": false
           },
           "starts_with": {
            "type": "string",
            "description": "with `paragraphs` (beside it in `where`, not inside it): the words that open paragraph `from`, as find_blocks gave them — required with paragraphs; checked, so a paragraph that moved is not the one changed. An empty paragraph (no words: a line of space) is named by its number alone — `paragraphs` {from: n, to: n}, starts_with \"\""
           },
           "blocks": {
            "type": "array",
            "items": {
             "type": "string"
            }
           },
           "paragraph_style": {
            "type": "string"
           },
           "bold": {
            "type": "string",
            "enum": [
             "all",
             "most",
             "opening",
             "some",
             "none"
            ],
            "description": "by 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"
           }
          },
          "required": [],
          "additionalProperties": false
         }
        },
        "required": [
         "where"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Done",
      "headers": {
       "RateLimit": {
        "$ref": "#/components/headers/RateLimit"
       },
       "RateLimit-Policy": {
        "$ref": "#/components/headers/RateLimitPolicy"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ActionResult"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "403": {
      "description": "insufficient-scope",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "404": {
      "description": "not-found",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "422": {
      "description": "validation · action-refused",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "429": {
      "description": "rate-limited",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "default": {
      "description": "internal · unavailable",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     }
    }
   }
  },
  "/v1/books/{id}/actions/remove_part": {
   "post": {
    "operationId": "actionRemovePart",
    "tags": [
     "Actions"
    ],
    "summary": "remove part",
    "x-summary-he": "מוחקת מהספר",
    "description": "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.\n\nWritten into the book at once, as the user's own; before the first change of a series, a version (`version_saved_before`).",
    "x-scope": "books:write",
    "security": [
     {
      "bearer": []
     },
     {
      "oauth2": [
       "books:write"
      ]
     }
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "The book's id",
      "schema": {
       "type": "string",
       "description": "A record's id: 15 lowercase letters and digits",
       "pattern": "^[a-z0-9]{15}$",
       "examples": [
        "k3x9q2m7b1v8c4z"
       ]
      }
     },
     {
      "$ref": "#/components/parameters/IdempotencyKey"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "name": {
          "type": "string",
          "description": "the part's name, as its line in the text has it (book_overview: parts)"
         },
         "nth": {
          "type": "integer",
          "description": "only when the text opens a part of that name more than once: which (from 1)"
         },
         "title": {
          "type": "string"
         }
        },
        "required": [
         "name"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Done",
      "headers": {
       "RateLimit": {
        "$ref": "#/components/headers/RateLimit"
       },
       "RateLimit-Policy": {
        "$ref": "#/components/headers/RateLimitPolicy"
       },
       "Idempotent-Replayed": {
        "$ref": "#/components/headers/IdempotentReplayed"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ActionResult"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "403": {
      "description": "insufficient-scope",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "404": {
      "description": "not-found",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "422": {
      "description": "validation · action-refused",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "429": {
      "description": "rate-limited",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "default": {
      "description": "internal · unavailable",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     }
    }
   }
  },
  "/v1/books/{id}/actions/move_part": {
   "post": {
    "operationId": "actionMovePart",
    "tags": [
     "Actions"
    ],
    "summary": "move part",
    "x-summary-he": "משנה את הספר",
    "description": "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.\n\nWritten into the book at once, as the user's own; before the first change of a series, a version (`version_saved_before`).",
    "x-scope": "books:write",
    "security": [
     {
      "bearer": []
     },
     {
      "oauth2": [
       "books:write"
      ]
     }
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "The book's id",
      "schema": {
       "type": "string",
       "description": "A record's id: 15 lowercase letters and digits",
       "pattern": "^[a-z0-9]{15}$",
       "examples": [
        "k3x9q2m7b1v8c4z"
       ]
      }
     },
     {
      "$ref": "#/components/parameters/IdempotencyKey"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "name": {
          "type": "string",
          "description": "the part's name, as its line in the text has it (book_overview: parts)"
         },
         "nth": {
          "type": "integer",
          "description": "only when the text opens a part of that name more than once: which (from 1)"
         },
         "before": {
          "type": "string",
          "description": "the part's name, as its line in the text has it (book_overview: parts)"
         },
         "before_nth": {
          "type": "integer",
          "description": "only when the text opens a part of that name more than once: which (from 1)"
         },
         "title": {
          "type": "string"
         }
        },
        "required": [
         "name"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Done",
      "headers": {
       "RateLimit": {
        "$ref": "#/components/headers/RateLimit"
       },
       "RateLimit-Policy": {
        "$ref": "#/components/headers/RateLimitPolicy"
       },
       "Idempotent-Replayed": {
        "$ref": "#/components/headers/IdempotentReplayed"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ActionResult"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "403": {
      "description": "insufficient-scope",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "404": {
      "description": "not-found",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "422": {
      "description": "validation · action-refused",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "429": {
      "description": "rate-limited",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "default": {
      "description": "internal · unavailable",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     }
    }
   }
  },
  "/v1/books/{id}/actions/move_paragraphs": {
   "post": {
    "operationId": "actionMoveParagraphs",
    "tags": [
     "Actions"
    ],
    "summary": "move paragraphs",
    "x-summary-he": "משנה את הספר",
    "description": "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.\n\nWritten into the book at once, as the user's own; before the first change of a series, a version (`version_saved_before`).",
    "x-scope": "books:write",
    "security": [
     {
      "bearer": []
     },
     {
      "oauth2": [
       "books:write"
      ]
     }
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "The book's id",
      "schema": {
       "type": "string",
       "description": "A record's id: 15 lowercase letters and digits",
       "pattern": "^[a-z0-9]{15}$",
       "examples": [
        "k3x9q2m7b1v8c4z"
       ]
      }
     },
     {
      "$ref": "#/components/parameters/IdempotencyKey"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "paragraphs": {
          "type": "object",
          "properties": {
           "from": {
            "type": "integer"
           },
           "to": {
            "type": "integer"
           }
          },
          "required": [
           "from"
          ],
          "additionalProperties": false
         },
         "starts_with": {
          "type": "string",
          "description": "the paragraph's opening words, as find_blocks gave them — checked, so a paragraph that moved is not the one changed"
         },
         "last_starts_with": {
          "type": "string"
         },
         "before": {
          "type": "integer",
          "description": "the paragraph's number from find_blocks (1 = the book's first)"
         },
         "after": {
          "type": "integer",
          "description": "the paragraph's number from find_blocks (1 = the book's first)"
         },
         "target_starts_with": {
          "type": "string"
         },
         "to_end": {
          "type": "boolean"
         },
         "copy": {
          "type": "boolean"
         },
         "title": {
          "type": "string"
         }
        },
        "required": [
         "paragraphs"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Done",
      "headers": {
       "RateLimit": {
        "$ref": "#/components/headers/RateLimit"
       },
       "RateLimit-Policy": {
        "$ref": "#/components/headers/RateLimitPolicy"
       },
       "Idempotent-Replayed": {
        "$ref": "#/components/headers/IdempotentReplayed"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ActionResult"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "403": {
      "description": "insufficient-scope",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "404": {
      "description": "not-found",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "422": {
      "description": "validation · action-refused",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "429": {
      "description": "rate-limited",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "default": {
      "description": "internal · unavailable",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     }
    }
   }
  },
  "/v1/books/{id}/actions/insert_separator": {
   "post": {
    "operationId": "actionInsertSeparator",
    "tags": [
     "Actions"
    ],
    "summary": "insert separator",
    "x-summary-he": "משנה את הספר",
    "description": "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.\n\nWritten into the book at once, as the user's own; before the first change of a series, a version (`version_saved_before`).",
    "x-scope": "books:write",
    "security": [
     {
      "bearer": []
     },
     {
      "oauth2": [
       "books:write"
      ]
     }
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "The book's id",
      "schema": {
       "type": "string",
       "description": "A record's id: 15 lowercase letters and digits",
       "pattern": "^[a-z0-9]{15}$",
       "examples": [
        "k3x9q2m7b1v8c4z"
       ]
      }
     },
     {
      "$ref": "#/components/parameters/IdempotencyKey"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "before": {
          "type": "integer",
          "description": "the paragraph's number from find_blocks (1 = the book's first)"
         },
         "starts_with": {
          "type": "string",
          "description": "the paragraph's opening words, as find_blocks gave them — checked, so a paragraph that moved is not the one changed"
         }
        },
        "required": [
         "before"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Done",
      "headers": {
       "RateLimit": {
        "$ref": "#/components/headers/RateLimit"
       },
       "RateLimit-Policy": {
        "$ref": "#/components/headers/RateLimitPolicy"
       },
       "Idempotent-Replayed": {
        "$ref": "#/components/headers/IdempotentReplayed"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ActionResult"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "403": {
      "description": "insufficient-scope",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "404": {
      "description": "not-found",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "422": {
      "description": "validation · action-refused",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "429": {
      "description": "rate-limited",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "default": {
      "description": "internal · unavailable",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     }
    }
   }
  },
  "/v1/books/{id}/actions/remove_notes": {
   "post": {
    "operationId": "actionRemoveNotes",
    "tags": [
     "Actions"
    ],
    "summary": "remove notes",
    "x-summary-he": "מוחקת מהספר",
    "description": "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.\n\nWritten into the book at once, as the user's own; before the first change of a series, a version (`version_saved_before`).",
    "x-scope": "books:write",
    "security": [
     {
      "bearer": []
     },
     {
      "oauth2": [
       "books:write"
      ]
     }
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "The book's id",
      "schema": {
       "type": "string",
       "description": "A record's id: 15 lowercase letters and digits",
       "pattern": "^[a-z0-9]{15}$",
       "examples": [
        "k3x9q2m7b1v8c4z"
       ]
      }
     },
     {
      "$ref": "#/components/parameters/IdempotencyKey"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "region": {
          "type": "integer"
         },
         "where": {
          "type": "object",
          "properties": {
           "selection": {
            "type": "boolean"
           },
           "paragraphs": {
            "type": "object",
            "properties": {
             "from": {
              "type": "integer"
             },
             "to": {
              "type": "integer"
             }
            },
            "required": [
             "from"
            ],
            "additionalProperties": false
           },
           "starts_with": {
            "type": "string",
            "description": "with `paragraphs` (beside it in `where`, not inside it): the words that open paragraph `from`, as find_blocks gave them — required with paragraphs; checked, so a paragraph that moved is not the one changed. An empty paragraph (no words: a line of space) is named by its number alone — `paragraphs` {from: n, to: n}, starts_with \"\""
           },
           "all": {
            "type": "boolean"
           },
           "empty": {
            "type": "boolean"
           }
          },
          "required": [],
          "additionalProperties": false
         },
         "title": {
          "type": "string"
         }
        },
        "required": [
         "where",
         "title"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Done",
      "headers": {
       "RateLimit": {
        "$ref": "#/components/headers/RateLimit"
       },
       "RateLimit-Policy": {
        "$ref": "#/components/headers/RateLimitPolicy"
       },
       "Idempotent-Replayed": {
        "$ref": "#/components/headers/IdempotentReplayed"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ActionResult"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "403": {
      "description": "insufficient-scope",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "404": {
      "description": "not-found",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "422": {
      "description": "validation · action-refused",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "429": {
      "description": "rate-limited",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "default": {
      "description": "internal · unavailable",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     }
    }
   }
  },
  "/v1/books/{id}/actions/move_notes": {
   "post": {
    "operationId": "actionMoveNotes",
    "tags": [
     "Actions"
    ],
    "summary": "move notes",
    "x-summary-he": "משנה את הספר",
    "description": "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.\n\nWritten into the book at once, as the user's own; before the first change of a series, a version (`version_saved_before`).",
    "x-scope": "books:write",
    "security": [
     {
      "bearer": []
     },
     {
      "oauth2": [
       "books:write"
      ]
     }
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "The book's id",
      "schema": {
       "type": "string",
       "description": "A record's id: 15 lowercase letters and digits",
       "pattern": "^[a-z0-9]{15}$",
       "examples": [
        "k3x9q2m7b1v8c4z"
       ]
      }
     },
     {
      "$ref": "#/components/parameters/IdempotencyKey"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "region": {
          "type": "integer"
         },
         "where": {
          "type": "object",
          "properties": {
           "selection": {
            "type": "boolean"
           },
           "paragraphs": {
            "type": "object",
            "properties": {
             "from": {
              "type": "integer"
             },
             "to": {
              "type": "integer"
             }
            },
            "required": [
             "from"
            ],
            "additionalProperties": false
           },
           "starts_with": {
            "type": "string",
            "description": "with `paragraphs` (beside it in `where`, not inside it): the words that open paragraph `from`, as find_blocks gave them — required with paragraphs; checked, so a paragraph that moved is not the one changed. An empty paragraph (no words: a line of space) is named by its number alone — `paragraphs` {from: n, to: n}, starts_with \"\""
           },
           "all": {
            "type": "boolean"
           },
           "rule": {
            "type": "object",
            "properties": {
             "paragraph_style": {
              "type": "string"
             },
             "mark": {
              "type": "string"
             },
             "opens_with": {
              "type": "string"
             },
             "contains": {
              "type": "string"
             }
            },
            "required": [],
            "additionalProperties": false
           }
          },
          "required": [],
          "additionalProperties": false
         },
         "to": {
          "type": "object",
          "properties": {
           "region": {
            "type": "integer"
           },
           "new": {
            "type": "string",
            "enum": [
             "below",
             "beside"
            ]
           },
           "name": {
            "type": "string"
           }
          },
          "required": [],
          "additionalProperties": false
         },
         "merge": {
          "type": "boolean"
         },
         "title": {
          "type": "string"
         }
        },
        "required": [
         "where",
         "to",
         "title"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Done",
      "headers": {
       "RateLimit": {
        "$ref": "#/components/headers/RateLimit"
       },
       "RateLimit-Policy": {
        "$ref": "#/components/headers/RateLimitPolicy"
       },
       "Idempotent-Replayed": {
        "$ref": "#/components/headers/IdempotentReplayed"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ActionResult"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "403": {
      "description": "insufficient-scope",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "404": {
      "description": "not-found",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "422": {
      "description": "validation · action-refused",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "429": {
      "description": "rate-limited",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "default": {
      "description": "internal · unavailable",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     }
    }
   }
  },
  "/v1/books/{id}/actions/move_to_notes": {
   "post": {
    "operationId": "actionMoveToNotes",
    "tags": [
     "Actions"
    ],
    "summary": "move to notes",
    "x-summary-he": "משנה את הספר",
    "description": "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.\n\nWritten into the book at once, as the user's own; before the first change of a series, a version (`version_saved_before`).",
    "x-scope": "books:write",
    "security": [
     {
      "bearer": []
     },
     {
      "oauth2": [
       "books:write"
      ]
     }
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "The book's id",
      "schema": {
       "type": "string",
       "description": "A record's id: 15 lowercase letters and digits",
       "pattern": "^[a-z0-9]{15}$",
       "examples": [
        "k3x9q2m7b1v8c4z"
       ]
      }
     },
     {
      "$ref": "#/components/parameters/IdempotencyKey"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "title": {
          "type": "string",
          "description": "one short line saying what moves, for the card and the turn's list"
         },
         "where": {
          "type": "object",
          "properties": {
           "selection": {
            "type": "boolean"
           },
           "paragraphs": {
            "type": "object",
            "properties": {
             "from": {
              "type": "integer"
             },
             "to": {
              "type": "integer"
             }
            },
            "required": [
             "from"
            ],
            "additionalProperties": false
           },
           "starts_with": {
            "type": "string",
            "description": "with `paragraphs`: the words that open paragraph `from`, as find_blocks gave them — required with paragraphs; checked, so a paragraph that moved is not the one changed"
           },
           "paragraph_style": {
            "type": "string"
           }
          },
          "required": [],
          "additionalProperties": false
         },
         "to": {
          "type": "object",
          "properties": {
           "region": {
            "type": "integer"
           },
           "new_name": {
            "type": "string"
           }
          },
          "required": [],
          "additionalProperties": false
         },
         "link": {
          "type": "string",
          "enum": [
           "before",
           "headings"
          ]
         }
        },
        "required": [
         "where",
         "to",
         "title"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Done",
      "headers": {
       "RateLimit": {
        "$ref": "#/components/headers/RateLimit"
       },
       "RateLimit-Policy": {
        "$ref": "#/components/headers/RateLimitPolicy"
       },
       "Idempotent-Replayed": {
        "$ref": "#/components/headers/IdempotentReplayed"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ActionResult"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "403": {
      "description": "insufficient-scope",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "404": {
      "description": "not-found",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "422": {
      "description": "validation · action-refused",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "429": {
      "description": "rate-limited",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "default": {
      "description": "internal · unavailable",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     }
    }
   }
  },
  "/v1/books/{id}/actions/read_cover": {
   "post": {
    "operationId": "actionReadCover",
    "tags": [
     "Actions"
    ],
    "summary": "read cover",
    "x-summary-he": "קריאה בלבד",
    "description": "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.\n\nChanges nothing.",
    "x-scope": "books:read",
    "security": [
     {
      "bearer": []
     },
     {
      "oauth2": [
       "books:read"
      ]
     }
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "The book's id",
      "schema": {
       "type": "string",
       "description": "A record's id: 15 lowercase letters and digits",
       "pattern": "^[a-z0-9]{15}$",
       "examples": [
        "k3x9q2m7b1v8c4z"
       ]
      }
     }
    ],
    "requestBody": {
     "required": false,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {},
        "required": []
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Done",
      "headers": {
       "RateLimit": {
        "$ref": "#/components/headers/RateLimit"
       },
       "RateLimit-Policy": {
        "$ref": "#/components/headers/RateLimitPolicy"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ActionResult"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "403": {
      "description": "insufficient-scope",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "404": {
      "description": "not-found",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "422": {
      "description": "validation · action-refused",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "429": {
      "description": "rate-limited",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "default": {
      "description": "internal · unavailable",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     }
    }
   }
  },
  "/v1/books/{id}/actions/change_cover": {
   "post": {
    "operationId": "actionChangeCover",
    "tags": [
     "Actions"
    ],
    "summary": "change cover",
    "x-summary-he": "משנה את הספר",
    "description": "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).\n\nWritten into the book at once, as the user's own; before the first change of a series, a version (`version_saved_before`).",
    "x-scope": "books:write",
    "security": [
     {
      "bearer": []
     },
     {
      "oauth2": [
       "books:write"
      ]
     }
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "The book's id",
      "schema": {
       "type": "string",
       "description": "A record's id: 15 lowercase letters and digits",
       "pattern": "^[a-z0-9]{15}$",
       "examples": [
        "k3x9q2m7b1v8c4z"
       ]
      }
     },
     {
      "$ref": "#/components/parameters/IdempotencyKey"
     }
    ],
    "requestBody": {
     "required": false,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "look": {
          "type": "string",
          "enum": [
           "plain",
           "classic",
           "navy",
           "wine",
           "forest",
           "night",
           "gilt",
           "plate",
           "label",
           "sky",
           "stone",
           "band",
           "sash",
           "bar",
           "ribbon"
          ]
         },
         "lines": {
          "type": "array",
          "items": {
           "type": "object",
           "properties": {
            "panel": {
             "type": "string",
             "enum": [
              "front",
              "spine",
              "back"
             ]
            },
            "op": {
             "type": "string",
             "enum": [
              "add",
              "remove",
              "move",
              "duplicate"
             ]
            },
            "index": {
             "type": "integer"
            },
            "to": {
             "type": "integer"
            },
            "value": {
             "type": "object",
             "description": "a new line's fields (op add)"
            }
           },
           "required": [
            "panel",
            "op"
           ],
           "additionalProperties": false
          }
         },
         "changes": {
          "type": "array",
          "items": {
           "type": "object",
           "properties": {
            "path": {
             "type": "string"
            },
            "value": {
             "description": "the new value: number, true/false, text, null (where it has a meaning), {\"pt\": n} / {\"rel\": n}, or an object for a whole line or a frame"
            }
           },
           "required": [
            "path",
            "value"
           ],
           "additionalProperties": false
          }
         }
        },
        "required": []
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Done",
      "headers": {
       "RateLimit": {
        "$ref": "#/components/headers/RateLimit"
       },
       "RateLimit-Policy": {
        "$ref": "#/components/headers/RateLimitPolicy"
       },
       "Idempotent-Replayed": {
        "$ref": "#/components/headers/IdempotentReplayed"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ActionResult"
        }
       }
      }
     },
     "401": {
      "description": "unauthorized",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "403": {
      "description": "insufficient-scope",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "404": {
      "description": "not-found",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "422": {
      "description": "validation · action-refused",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "429": {
      "description": "rate-limited",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "default": {
      "description": "internal · unavailable",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     }
    }
   }
  }
 },
 "webhooks": {
  "job.succeeded": {
   "post": {
    "operationId": "onJobSucceeded",
    "summary": "job.succeeded",
    "description": "A job ended well; `data.job` is the job, its `result` what came of it",
    "parameters": [
     {
      "name": "webhook-id",
      "in": "header",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "webhook-timestamp",
      "in": "header",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "webhook-signature",
      "in": "header",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/Event"
       }
      }
     }
    },
    "responses": {
     "2XX": {
      "description": "Received (any other answer: tried again, for a day; 410: the endpoint stops)"
     }
    }
   }
  },
  "job.failed": {
   "post": {
    "operationId": "onJobFailed",
    "summary": "job.failed",
    "description": "A job failed; `data.job.problem` says why (a problem body, RFC 9457)",
    "parameters": [
     {
      "name": "webhook-id",
      "in": "header",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "webhook-timestamp",
      "in": "header",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "webhook-signature",
      "in": "header",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/Event"
       }
      }
     }
    },
    "responses": {
     "2XX": {
      "description": "Received (any other answer: tried again, for a day; 410: the endpoint stops)"
     }
    }
   }
  },
  "book.created": {
   "post": {
    "operationId": "onBookCreated",
    "summary": "book.created",
    "description": "A new book was made (a `book.create` job succeeded); `data.book` is the book",
    "parameters": [
     {
      "name": "webhook-id",
      "in": "header",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "webhook-timestamp",
      "in": "header",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "webhook-signature",
      "in": "header",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/Event"
       }
      }
     }
    },
    "responses": {
     "2XX": {
      "description": "Received (any other answer: tried again, for a day; 410: the endpoint stops)"
     }
    }
   }
  },
  "export.ready": {
   "post": {
    "operationId": "onExportReady",
    "summary": "export.ready",
    "description": "A file of a book is ready (an `export` job succeeded); `data.file` is where to download it, for a day",
    "parameters": [
     {
      "name": "webhook-id",
      "in": "header",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "webhook-timestamp",
      "in": "header",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "webhook-signature",
      "in": "header",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/Event"
       }
      }
     }
    },
    "responses": {
     "2XX": {
      "description": "Received (any other answer: tried again, for a day; 410: the endpoint stops)"
     }
    }
   }
  },
  "webhook.test": {
   "post": {
    "operationId": "onWebhookTest",
    "summary": "webhook.test",
    "description": "Sent by hand from POST /v1/webhooks/{id}/test",
    "parameters": [
     {
      "name": "webhook-id",
      "in": "header",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "webhook-timestamp",
      "in": "header",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "webhook-signature",
      "in": "header",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/Event"
       }
      }
     }
    },
    "responses": {
     "2XX": {
      "description": "Received (any other answer: tried again, for a day; 410: the endpoint stops)"
     }
    }
   }
  }
 },
 "components": {
  "schemas": {
   "Problem": {
    "type": "object",
    "properties": {
     "type": {
      "type": "string",
      "description": "The problem's page: https://api.ariach.com/problems/<code>",
      "format": "uri"
     },
     "title": {
      "type": "string",
      "description": "What it is, in the caller's language (Accept-Language, else the account's)"
     },
     "status": {
      "type": "integer",
      "description": "The HTTP status"
     },
     "detail": {
      "type": "string",
      "description": "This occurrence, in words"
     },
     "instance": {
      "type": "string",
      "description": "This request's id (urn:ariach:request:…), as its `X-Request-Id`"
     },
     "errors": {
      "type": "object",
      "additionalProperties": {
       "type": "string"
      },
      "description": "A field's name → what is wrong with it (validation)"
     },
     "required_scope": {
      "type": "string",
      "description": "insufficient-scope: the scope the request needs"
     },
     "pay_url": {
      "type": "string",
      "description": "payment-required: where in the studio the book is paid for",
      "format": "uri"
     }
    },
    "required": [
     "type",
     "title",
     "status"
    ],
    "description": "An error (RFC 9457, `application/problem+json`)",
    "additionalProperties": true
   },
   "Me": {
    "type": "object",
    "properties": {
     "user": {
      "type": "object",
      "properties": {
       "id": {
        "type": "string",
        "description": "A record's id: 15 lowercase letters and digits",
        "pattern": "^[a-z0-9]{15}$",
        "examples": [
         "k3x9q2m7b1v8c4z"
        ]
       },
       "email": {
        "type": "string",
        "format": "email"
       },
       "name": {
        "type": "string"
       },
       "locale": {
        "type": "string",
        "description": "he, en or yi"
       }
      },
      "required": [
       "id",
       "email",
       "name",
       "locale"
      ]
     },
     "via": {
      "type": "object",
      "properties": {
       "kind": {
        "type": "string",
        "description": "key: an API key · oauth: an application the user connected",
        "enum": [
         "key",
         "oauth"
        ]
       },
       "id": {
        "type": "string"
       },
       "name": {
        "type": "string"
       },
       "client_id": {
        "type": "string"
       },
       "client_name": {
        "type": "string"
       }
      },
      "required": [
       "kind"
      ],
      "additionalProperties": true
     },
     "scopes": {
      "type": "array",
      "items": {
       "type": "string",
       "enum": [
        "books:read",
        "books:write",
        "export",
        "library:read",
        "webhooks"
       ]
      }
     },
     "ai_allowance": {
      "anyOf": [
       {
        "type": "object",
        "properties": {
         "usd_week": {
          "type": "number"
         },
         "usd_used": {
          "type": "number"
         },
         "again": {
          "anyOf": [
           {
            "type": "string",
            "description": "When the week's allowance starts again",
            "format": "date-time"
           },
           {
            "type": "null"
           }
          ]
         }
        },
        "required": [
         "usd_week",
         "usd_used",
         "again"
        ],
        "description": "The week's allowance of the model's work (reading a Word file is part of it)"
       },
       {
        "type": "null"
       }
      ]
     }
    },
    "required": [
     "user",
     "via",
     "scopes",
     "ai_allowance"
    ]
   },
   "Book": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string",
      "description": "A record's id: 15 lowercase letters and digits",
      "pattern": "^[a-z0-9]{15}$",
      "examples": [
       "k3x9q2m7b1v8c4z"
      ]
     },
     "title": {
      "type": "string"
     },
     "role": {
      "type": "string",
      "description": "The user's role in the book",
      "enum": [
       "owner",
       "editor",
       "proofreader"
      ]
     },
     "owner_name": {
      "type": "string",
      "description": "Another's book shared with the user: its owner's name"
     },
     "updated": {
      "type": "string",
      "format": "date-time"
     },
     "studio_url": {
      "type": "string",
      "description": "The book in the studio",
      "format": "uri"
     }
    },
    "required": [
     "id",
     "title",
     "role",
     "updated",
     "studio_url"
    ]
   },
   "BookList": {
    "type": "object",
    "properties": {
     "items": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/Book"
      }
     },
     "total": {
      "type": "integer"
     },
     "page": {
      "type": "integer"
     },
     "limit": {
      "type": "integer"
     },
     "next_page": {
      "anyOf": [
       {
        "type": "integer"
       },
       {
        "type": "null"
       }
      ]
     }
    },
    "required": [
     "items",
     "total",
     "page",
     "limit",
     "next_page"
    ]
   },
   "Job": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string",
      "description": "A record's id: 15 lowercase letters and digits",
      "pattern": "^[a-z0-9]{15}$",
      "examples": [
       "k3x9q2m7b1v8c4z"
      ]
     },
     "kind": {
      "type": "string",
      "description": "book.create · export",
      "examples": [
       "book.create",
       "export"
      ]
     },
     "state": {
      "type": "string",
      "enum": [
       "queued",
       "running",
       "input_required",
       "succeeded",
       "failed",
       "canceled"
      ]
     },
     "progress": {
      "type": "number",
      "minimum": 0,
      "maximum": 1
     },
     "step": {
      "anyOf": [
       {
        "type": "string",
        "description": "What it is doing now"
       },
       {
        "type": "null"
       }
      ]
     },
     "book": {
      "anyOf": [
       {
        "type": "string",
        "description": "A record's id: 15 lowercase letters and digits",
        "pattern": "^[a-z0-9]{15}$",
        "examples": [
         "k3x9q2m7b1v8c4z"
        ]
       },
       {
        "type": "null"
       }
      ]
     },
     "result": {
      "anyOf": [
       {
        "$ref": "#/components/schemas/NewBookResult"
       },
       {
        "$ref": "#/components/schemas/Export"
       },
       {
        "type": "null"
       }
      ],
      "description": "When it succeeded: what came of it — a NewBookResult (book.create), an Export (export)"
     },
     "problem": {
      "anyOf": [
       {
        "$ref": "#/components/schemas/Problem"
       },
       {
        "type": "null"
       }
      ]
     },
     "created": {
      "type": "string",
      "format": "date-time"
     },
     "started": {
      "anyOf": [
       {
        "type": "string",
        "format": "date-time"
       },
       {
        "type": "null"
       }
      ]
     },
     "finished": {
      "anyOf": [
       {
        "type": "string",
        "format": "date-time"
       },
       {
        "type": "null"
       }
      ]
     },
     "url": {
      "type": "string",
      "description": "This job",
      "format": "uri"
     }
    },
    "required": [
     "id",
     "kind",
     "state",
     "url"
    ]
   },
   "JobList": {
    "type": "object",
    "properties": {
     "items": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/Job"
      }
     },
     "next": {
      "anyOf": [
       {
        "type": "string",
        "description": "The next page",
        "format": "uri"
       },
       {
        "type": "null"
       }
      ]
     }
    },
    "required": [
     "items",
     "next"
    ]
   },
   "NewBook": {
    "description": "A new book: blank, from the library, or from a Word/RTF file (a form upload takes `file` instead of `source`)",
    "type": "object",
    "properties": {
     "source": {
      "oneOf": [
       {
        "type": "object",
        "properties": {
         "kind": {
          "const": "blank"
         }
        },
        "required": [
         "kind"
        ]
       },
       {
        "type": "object",
        "properties": {
         "kind": {
          "const": "library"
         },
         "book": {
          "type": "string",
          "description": "The library book's id (GET /v1/library)",
          "maxLength": 400
         },
         "commentaries": {
          "type": "array",
          "items": {
           "type": "string"
          },
          "maxItems": 16,
          "description": "Library ids to set around it; left out: those it is printed with; []: none"
         },
         "range": {
          "type": "object",
          "properties": {
           "from": {
            "type": "integer",
            "minimum": 1
           },
           "to": {
            "type": "integer",
            "minimum": 1
           }
          },
          "required": [
           "from",
           "to"
          ],
          "description": "Only these lines of it"
         }
        },
        "required": [
         "kind",
         "book"
        ]
       },
       {
        "type": "object",
        "properties": {
         "kind": {
          "const": "word"
         },
         "url": {
          "type": "string",
          "description": "An https address of the file (60 MB at most)",
          "format": "uri"
         },
         "name": {
          "type": "string"
         }
        },
        "required": [
         "kind",
         "url"
        ]
       },
       {
        "type": "object",
        "properties": {
         "kind": {
          "const": "word"
         },
         "content_base64": {
          "type": "string",
          "description": "The file's bytes",
          "contentEncoding": "base64"
         },
         "name": {
          "type": "string",
          "description": "Its name, as file.docx"
         }
        },
        "required": [
         "kind",
         "content_base64",
         "name"
        ]
       }
      ]
     },
     "title": {
      "type": "string",
      "description": "The book's name (required for a blank book; else the name read of the source)",
      "maxLength": 200
     },
     "making": {
      "type": "string",
      "description": "A book, or a booklet (a few pages)",
      "enum": [
       "book",
       "booklet"
      ],
      "default": "book"
     },
     "ai": {
      "type": "boolean",
      "default": true,
      "description": "A Word file: let the model read its styles, as the studio does (part of the week's allowance); false: by the rules alone"
     }
    },
    "required": [
     "source"
    ]
   },
   "NewBookResult": {
    "type": "object",
    "properties": {
     "book": {
      "type": "object",
      "properties": {
       "id": {
        "type": "string",
        "description": "A record's id: 15 lowercase letters and digits",
        "pattern": "^[a-z0-9]{15}$",
        "examples": [
         "k3x9q2m7b1v8c4z"
        ]
       },
       "title": {
        "type": "string"
       },
       "studio_url": {
        "type": "string",
        "format": "uri"
       },
       "url": {
        "type": "string",
        "description": "The book in this API",
        "format": "uri"
       }
      },
      "required": [
       "id",
       "title",
       "studio_url",
       "url"
      ]
     },
     "found": {
      "type": "object",
      "properties": {
       "paragraphs": {
        "type": "integer"
       },
       "headings": {
        "type": "integer"
       },
       "notes": {
        "type": "integer"
       },
       "pictures": {
        "type": "integer"
       }
      },
      "required": [
       "paragraphs",
       "headings",
       "notes",
       "pictures"
      ],
      "description": "A Word file: what was found in it"
     },
     "read": {
      "type": "boolean",
      "description": "A Word file: whether the model read it in time (else made by the rules alone)"
     },
     "license": {
      "anyOf": [
       {
        "type": "string",
        "description": "A library book: its licence, as the library says it"
       },
       {
        "type": "null"
       }
      ]
     },
     "commentaries": {
      "type": "array",
      "items": {
       "type": "object",
       "properties": {
        "id": {
         "type": "string"
        },
        "title": {
         "type": "string"
        }
       },
       "required": [
        "id",
        "title"
       ]
      },
      "description": "A library book: what was set with it"
     }
    },
    "required": [
     "book"
    ]
   },
   "LibraryBook": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string",
      "description": "Its id in the library (a path)"
     },
     "title": {
      "type": "string"
     },
     "category": {
      "type": "array",
      "items": {
       "type": "string"
      }
     },
     "verdict": {
      "type": "string",
      "description": "Whether it may be printed and sold"
     },
     "basis": {
      "type": "string"
     },
     "year": {
      "type": "integer"
     }
    },
    "required": [
     "id",
     "title",
     "category",
     "verdict",
     "basis"
    ]
   },
   "LinkedBook": {
    "allOf": [
     {
      "$ref": "#/components/schemas/LibraryBook"
     },
     {
      "type": "object",
      "properties": {
       "links": {
        "type": "integer",
        "description": "How many of its lines are linked to the book's"
       },
       "role": {
        "type": "string",
        "description": "What it is to the book",
        "examples": [
         "commentary",
         "source"
        ]
       }
      },
      "required": [
       "links",
       "role"
      ]
     }
    ]
   },
   "Action": {
    "type": "object",
    "properties": {
     "name": {
      "type": "string"
     },
     "kind": {
      "type": "string",
      "description": "read: changes nothing · write · remove",
      "enum": [
       "read",
       "write",
       "remove"
      ]
     },
     "scope": {
      "type": "string",
      "enum": [
       "books:read",
       "books:write"
      ]
     },
     "description": {
      "type": "string",
      "description": "What it does — the words the studio's own assistant is given"
     },
     "input_schema": {
      "type": "object",
      "description": "Its input's JSON Schema (the body of POST …/actions/{name})"
     }
    },
    "required": [
     "name",
     "kind",
     "scope",
     "description",
     "input_schema"
    ]
   },
   "ActionResult": {
    "type": "object",
    "properties": {
     "result": {
      "description": "The action's answer (mostly a JSON object; its fields are the action's own)"
     },
     "changed": {
      "type": "boolean",
      "description": "Whether the book changed"
     },
     "version_saved_before": {
      "$ref": "#/components/schemas/Version"
     },
     "studio_url": {
      "type": "string",
      "format": "uri"
     }
    },
    "required": [
     "result",
     "changed",
     "studio_url"
    ]
   },
   "Version": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string",
      "description": "A record's id: 15 lowercase letters and digits",
      "pattern": "^[a-z0-9]{15}$",
      "examples": [
       "k3x9q2m7b1v8c4z"
      ]
     },
     "name": {
      "type": "string"
     },
     "kind": {
      "type": "string",
      "description": "named · print (a PDF sent to print)",
      "enum": [
       "named",
       "print"
      ]
     },
     "created": {
      "type": "string",
      "format": "date-time"
     },
     "by_name": {
      "type": "string"
     }
    },
    "required": [
     "id",
     "name",
     "kind",
     "created",
     "by_name"
    ]
   },
   "Restored": {
    "type": "object",
    "properties": {
     "restored": {
      "$ref": "#/components/schemas/Version"
     },
     "changed": {
      "type": "boolean"
     },
     "studio_url": {
      "type": "string",
      "format": "uri"
     }
    },
    "required": [
     "restored",
     "changed",
     "studio_url"
    ]
   },
   "ProofLink": {
    "type": "object",
    "properties": {
     "url": {
      "anyOf": [
       {
        "type": "string",
        "description": "The page the proofreader opens — no account needed; null: no link in force",
        "format": "uri"
       },
       {
        "type": "null"
       }
      ]
     },
     "created": {
      "anyOf": [
       {
        "type": "string",
        "format": "date-time"
       },
       {
        "type": "null"
       }
      ]
     },
     "remarks": {
      "type": "integer",
      "description": "Remarks written through it so far"
     }
    },
    "required": [
     "url",
     "created",
     "remarks"
    ]
   },
   "Pages": {
    "type": "object",
    "properties": {
     "total": {
      "type": "integer",
      "description": "The book's pages"
     },
     "from": {
      "type": "integer"
     },
     "pages": {
      "type": "array",
      "items": {
       "type": "object",
       "properties": {
        "page": {
         "type": "integer"
        },
        "width": {
         "type": "integer"
        },
        "height": {
         "type": "integer"
        },
        "webp": {
         "type": "string",
         "description": "The picture, image/webp",
         "contentEncoding": "base64"
        }
       },
       "required": [
        "page",
        "width",
        "height",
        "webp"
       ]
      }
     },
     "watermark": {
      "type": "boolean",
      "description": "Under the words of a preview: the book is not paid for"
     },
     "pay_url": {
      "type": "string",
      "description": "Where it is paid for (under a watermark)",
      "format": "uri"
     },
     "stand_in": {
      "type": "array",
      "items": {
       "type": "string"
      },
      "description": "Fonts from the user's computer the book is set in (their files are never on the server), drawn here in a stand-in font: these pages' letters and lines are not the book's"
     }
    },
    "required": [
     "total",
     "from",
     "pages",
     "watermark"
    ]
   },
   "File": {
    "type": "object",
    "properties": {
     "url": {
      "type": "string",
      "description": "The address to download it from, for a day",
      "format": "uri"
     },
     "name": {
      "type": "string"
     },
     "type": {
      "type": "string"
     },
     "bytes": {
      "type": "integer"
     },
     "expires": {
      "type": "string",
      "format": "date-time"
     }
    },
    "required": [
     "url",
     "name",
     "type",
     "bytes",
     "expires"
    ]
   },
   "Export": {
    "type": "object",
    "properties": {
     "file": {
      "$ref": "#/components/schemas/File"
     },
     "kind": {
      "type": "string",
      "description": "full: the whole book · sample: its first pages (not paid for) · proof · cover",
      "enum": [
       "full",
       "sample",
       "proof",
       "cover"
      ]
     },
     "pages": {
      "type": "integer"
     },
     "total": {
      "type": "integer",
      "description": "The book's pages"
     },
     "pay_url": {
      "type": "string",
      "description": "A sample: where the book is paid for, in the studio (the same prices)",
      "format": "uri"
     }
    },
    "required": [
     "file",
     "kind",
     "pages",
     "total"
    ]
   },
   "Webhook": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string",
      "description": "A record's id: 15 lowercase letters and digits",
      "pattern": "^[a-z0-9]{15}$",
      "examples": [
       "k3x9q2m7b1v8c4z"
      ]
     },
     "url": {
      "type": "string",
      "format": "uri"
     },
     "events": {
      "type": "array",
      "items": {
       "type": "string",
       "enum": [
        "job.succeeded",
        "job.failed",
        "book.created",
        "export.ready"
       ]
      },
      "description": "The events it is sent; []: every one"
     },
     "description": {
      "type": "string"
     },
     "active": {
      "type": "boolean"
     },
     "stopped": {
      "anyOf": [
       {
        "type": "string",
        "description": "Why it stopped: gone (410), failed for a day"
       },
       {
        "type": "null"
       }
      ]
     },
     "last_status": {
      "anyOf": [
       {
        "type": "integer"
       },
       {
        "type": "null"
       }
      ]
     },
     "last_at": {
      "anyOf": [
       {
        "type": "string",
        "format": "date-time"
       },
       {
        "type": "null"
       }
      ]
     },
     "created": {
      "type": "string",
      "format": "date-time"
     }
    },
    "required": [
     "id",
     "url",
     "events",
     "active"
    ]
   },
   "WebhookCreated": {
    "allOf": [
     {
      "$ref": "#/components/schemas/Webhook"
     },
     {
      "type": "object",
      "properties": {
       "secret": {
        "type": "string",
        "description": "Given this once: verify each delivery's webhook-signature with it",
        "pattern": "^whsec_"
       }
      },
      "required": [
       "secret"
      ]
     }
    ]
   },
   "Delivery": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string",
      "description": "A record's id: 15 lowercase letters and digits",
      "pattern": "^[a-z0-9]{15}$",
      "examples": [
       "k3x9q2m7b1v8c4z"
      ]
     },
     "msg_id": {
      "type": "string",
      "description": "Its webhook-id: the same in every try"
     },
     "type": {
      "type": "string"
     },
     "state": {
      "type": "string",
      "enum": [
       "pending",
       "delivered",
       "failed"
      ]
     },
     "attempts": {
      "type": "integer"
     },
     "next_at": {
      "anyOf": [
       {
        "type": "string",
        "format": "date-time"
       },
       {
        "type": "null"
       }
      ]
     },
     "last_status": {
      "anyOf": [
       {
        "type": "integer",
        "description": "The endpoint's status (0: no answer)"
       },
       {
        "type": "null"
       }
      ]
     },
     "created": {
      "type": "string",
      "format": "date-time"
     },
     "updated": {
      "type": "string",
      "format": "date-time"
     }
    },
    "required": [
     "id",
     "msg_id",
     "type",
     "state",
     "attempts",
     "next_at",
     "last_status",
     "created",
     "updated"
    ]
   },
   "Event": {
    "type": "object",
    "properties": {
     "type": {
      "type": "string",
      "enum": [
       "job.succeeded",
       "job.failed",
       "book.created",
       "export.ready",
       "webhook.test"
      ]
     },
     "timestamp": {
      "type": "string",
      "format": "date-time"
     },
     "data": {
      "type": "object",
      "additionalProperties": true
     }
    },
    "required": [
     "type",
     "timestamp",
     "data"
    ],
    "description": "A webhook's body (Standard Webhooks 1.0). Headers: webhook-id, webhook-timestamp, webhook-signature (v1,<base64 HMAC-SHA256 over id.timestamp.body, the key the secret's base64 after whsec_>)"
   }
  },
  "securitySchemes": {
   "bearer": {
    "type": "http",
    "scheme": "bearer",
    "description": "An API key (ark_live_…) the user made in the studio, or an access token"
   },
   "oauth2": {
    "type": "oauth2",
    "description": "OAuth 2.1: authorization code with PKCE (S256), a client's metadata document (CIMD) or dynamic registration; refresh tokens rotate",
    "flows": {
     "authorizationCode": {
      "authorizationUrl": "https://api.ariach.com/oauth/authorize",
      "tokenUrl": "https://api.ariach.com/oauth/token",
      "refreshUrl": "https://api.ariach.com/oauth/token",
      "scopes": {
       "books:read": "Read the user's books, their versions and pages, and run the read-only actions",
       "books:write": "Make, rename and trash books, run the actions that change a book, save and restore versions",
       "export": "Make files of a book: the PDF, a proof copy, the cover, InDesign — as the studio's «ייצוא», at the studio's prices",
       "library:read": "Search the library (Otzaria) a book is made of",
       "webhooks": "Manage the account's webhook endpoints"
      }
     }
    }
   }
  },
  "parameters": {
   "IdempotencyKey": {
    "name": "Idempotency-Key",
    "in": "header",
    "required": false,
    "description": "The same key again within 24 hours: the first answer again (Idempotent-Replayed: true); with another body, 422; while the first runs, 409",
    "schema": {
     "type": "string",
     "maxLength": 255
    }
   }
  },
  "headers": {
   "RateLimit": {
    "description": "What is left: \"<policy>\";a=<left>;w=<seconds> (draft-ietf-httpapi-ratelimit-headers)",
    "schema": {
     "type": "string"
    }
   },
   "RateLimitPolicy": {
    "description": "\"<policy>\";q=<quota>;w=<window seconds>",
    "schema": {
     "type": "string"
    }
   },
   "Location": {
    "description": "The job's (or the created thing's) address",
    "schema": {
     "type": "string",
     "format": "uri"
    }
   },
   "IdempotentReplayed": {
    "description": "true: the first answer to this Idempotency-Key, again",
    "schema": {
     "type": "string"
    }
   }
  }
 }
}