List a book's chapters
const url = 'https://digize.com/api/v1/books/example/chapters';const options = {method: 'GET', headers: {'x-api-key': '<x-api-key>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://digize.com/api/v1/books/example/chapters \ --header 'x-api-key: <x-api-key>'A book’s chapters and its front and back matter in order, each with its status, words and reading level; the book’s words and reading level; its figures; and the writer’s latest run, which fills the chapters in as it goes.
Needs the books:read permission.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Responses
Section titled “Responses”Done
object
object
A chapter, or front or back matter.
One line: what the reader gets from it.
planned until it’s written, drafting while the writer writes it, drafted, then edited once the author changed it.
Its reading level as a US school grade (Flesch–Kincaid), or null with too little text or in another language than English.
The run of the writer that last wrote it.
object
What it should show.
object
object
object
object
object
object
object
What it shows: its drawing, or a picture the author put in, as it shows in the editor.
The GPT Image model it was drawn with.
What a picture prints at in its place; null for an SVG.
What drawing it has cost on the workspace’s OpenAI account, in US dollars.
The drawing it shows, then the last few to go back to.
object
US dollars, both tries included.
What a “Change this” asked for.
When it was drawn, in ms since the epoch.
A “Change this” under way: what it asked for.
object
The one chapter it writes again; null for the whole book.
The model the author picked.
What writes: the pick, or GLM-4.7 Flash for Claude while Anthropic isn’t connected.
digize: on the AI meter under the daily cap. openai and anthropic: on the workspace’s own OpenAI or Anthropic account.
What its model calls cost so far, in US dollars.
Example
{ "data": [ { "kind": "chapter", "matter": "title", "status": "planned" } ], "figures": [ { "kind": "illustration", "spec": { "kind": "chart", "type": "bar", "unit": "", "source": "" }, "width": "half", "status": "planned", "format": "png", "drawings": [ { "source": "drawn", "format": "png" } ] } ], "generation": { "billing": "digize", "status": "running", "phase": "outline", "stopped": "cap" }}What was sent isn’t valid (invalid).
object
object
object
Example
{ "error": { "code": "invalid" }}No key, or one that’s unknown, off or expired.
object
object
object
Example
{ "error": { "code": "invalid" }}The key doesn’t have the permission this needs.
object
object
object
Example
{ "error": { "code": "invalid" }}Nothing has that id (not_found).
object
object
object
Example
{ "error": { "code": "invalid" }}Over the rate limit; see retry-after.
object
object
object
Example
{ "error": { "code": "invalid" }}