Skip to content

Put a figure in a chapter

POST
/api/v1/books/{bookId}/figures/{id}/place
curl --request POST \
--url https://digize.com/api/v1/books/example/figures/example/place \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: 5f1c2a8e-3b7d-4c55-9a0e-1f2d3c4b5a69' \
--header 'x-api-key: <x-api-key>' \
--data '{ "chapterId": "example" }'

Puts a figure no chapter shows (inBook: false in books.figures.list), such as one just added with an upload, at the end of a chapter. The chapter’s last version is kept, as with books.chapters.update; move the figure along the text by editing the chapter’s blocks.

Needs the books:write permission.

bookId
required
string
>= 1 characters <= 64 characters
id
required
string
>= 1 characters <= 64 characters
Idempotency-Key
string
>= 1 characters <= 255 characters

Makes the request safe to send again: for 24 hours the same key and request answer the first response without repeating the change.

Example

5f1c2a8e-3b7d-4c55-9a0e-1f2d3c4b5a69
Media typeapplication/json
object
chapterId
required
string
>= 1 characters <= 64 characters

Example generated

{
"chapterId": "example"
}

Done

Media typeapplication/json
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

Example

{
"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"
}
}

A request with the same Idempotency-Key is still running (conflict).

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 Idempotency-Key was used with a different request.

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"
}
}