Skip to content

Get a chapter

GET
/api/v1/books/{bookId}/chapters/{id}
curl --request GET \
--url https://digize.com/api/v1/books/example/chapters/example \
--header 'x-api-key: <x-api-key>'

One chapter with its blocks, the figures in it, and the people and records it draws on (from its insights and its quotes), with what each is called when the book anonymizes names.

Needs the books:read permission.

bookId
required
string
>= 1 characters <= 64 characters
id
required
string
>= 1 characters <= 64 characters

Done

Media typeapplication/json
object
chapter
required
object
id
required
string
position
required
integer
>= -9007199254740991 <= 9007199254740991
kind
required

A chapter, or front or back matter.

string
Allowed values: chapter front back
matter
required
Any of:
string
Allowed values: title copyright dedication foreword introduction conclusion about acknowledgments
number
required
Any of:
integer
>= -9007199254740991 <= 9007199254740991
title
required
string
promise
required

One line: what the reader gets from it.

string
status
required

planned until it’s written, drafting while the writer writes it, drafted, then edited once the author changed it.

string
Allowed values: planned drafting drafted edited
words
required
integer
>= -9007199254740991 <= 9007199254740991
grade
required

Its reading level as a US school grade (Flesch–Kincaid), or null with too little text or in another language than English.

number | null
version
required
integer
>= -9007199254740991 <= 9007199254740991
generation
required

The run of the writer that last wrote it.

integer
>= -9007199254740991 <= 9007199254740991
updatedAt
required
string format: date-time
summary
required
string
blocks
required

Its content as blocks, each with an id: paragraph, heading, list, quote, pullquote, callout, table, figure, break.

Array
One of:
object
content
required
Array<object>
<= 2000 items
object
text
required
string
<= 20000 characters
marks
Array<string>
<= 5 items
Allowed values: bold italic underline strike code
href
string
>= 1 characters <= 2000 characters
type
required
string
Allowed value: paragraph
id
required
string
/^[\w-]{4,40}$/
insightIds
required
Array<string>
targetWords
required
integer
>= -9007199254740991 <= 9007199254740991
figures
required
Array<object>
object
id
required
string
chapterId
required
string | null
blockId
required
string | null
kind
required
string
Allowed values: illustration chart diagram
caption
required
string
alt
required
string
prompt
required

What it should show.

string
spec
required
Any of:
Any of:
object
kind
required
string
Allowed value: chart
type
required
string
Allowed values: bar line pie area
title
required
string
<= 200 characters
unit
required
string
"" <= 40 characters
series
required
Array<object>
>= 1 items <= 6 items
object
name
required
string
<= 100 characters
points
required
Array<object>
>= 2 items <= 40 items
object
label
required
string
>= 1 characters <= 120 characters
value
required
number
source
required
string
"" <= 300 characters
width
required
string
Allowed values: half full page
status
required
string
Allowed values: planned rendering ready failed
error
required
string | null
imageId
required
string | null
imageUrl
required

What it shows: its drawing, or a picture the author put in, as it shows in the editor.

string | null
thumbUrl
required
string | null
version
required
integer
>= -9007199254740991 <= 9007199254740991
generation
required
integer
>= -9007199254740991 <= 9007199254740991
updatedAt
required
string format: date-time
model
required

The GPT Image model it was drawn with.

string | null
format
required
Any of:
string
Allowed values: png jpg svg
widthPx
required
Any of:
integer
>= -9007199254740991 <= 9007199254740991
heightPx
required
Any of:
integer
>= -9007199254740991 <= 9007199254740991
dpi
required

What a picture prints at in its place; null for an SVG.

number | null
check
required
Any of:
object
missing
required
Array<string>
unreadable
required
boolean
tries
required
integer
>= -9007199254740991 <= 9007199254740991
warnings
required
Array<string>
cost
required

What drawing it has cost on the workspace’s OpenAI account, in US dollars.

number
drawings
required

The drawing it shows, then the last few to go back to.

Array<object>
object
version
required
integer
>= -9007199254740991 <= 9007199254740991
source
required
string
Allowed values: drawn changed upload stand-in
format
required
string
Allowed values: png jpg svg
widthPx
required
Any of:
integer
>= -9007199254740991 <= 9007199254740991
heightPx
required
Any of:
integer
>= -9007199254740991 <= 9007199254740991
model
required
string | null
check
required
Any of:
object
missing
required
Array<string>
unreadable
required
boolean
tries
required
integer
>= -9007199254740991 <= 9007199254740991
cost
required

US dollars, both tries included.

number
note
required

What a “Change this” asked for.

string | null
downsized
required
boolean
at
required

When it was drawn, in ms since the epoch.

number
url
required
string | null
thumbUrl
required
string | null
changing
required

A “Change this” under way: what it asked for.

string | null
drawnAt
required
Any of:
string format: date-time
sources
required
Array<object>
object
type
required
string
id
required
string
label
required
string
alias
required

What the book calls them with names anonymized.

string | null
insights
required
integer
>= -9007199254740991 <= 9007199254740991
quoted
required
boolean
anonymize
required
boolean

Example

{
"chapter": {
"kind": "chapter",
"matter": "title",
"status": "planned",
"blocks": [
{
"content": [
{
"marks": [
"bold"
]
}
],
"type": "paragraph"
}
]
},
"figures": [
{
"kind": "illustration",
"spec": {
"kind": "chart",
"type": "bar",
"unit": "",
"source": ""
},
"width": "half",
"status": "planned",
"format": "png",
"drawings": [
{
"source": "drawn",
"format": "png"
}
]
}
]
}

What was sent isn’t valid (invalid).

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

No key, or one that’s unknown, off or expired.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

The key doesn’t have the permission this needs.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

Nothing has that id (not_found).

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

Over the rate limit; see retry-after.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}