Skip to content

Draw cover fronts

POST
/api/v1/books/{bookId}/cover/draw
curl --request POST \
--url https://digize.com/api/v1/books/example/cover/draw \
--header 'Idempotency-Key: 5f1c2a8e-3b7d-4c55-9a0e-1f2d3c4b5a69' \
--header 'x-api-key: <x-api-key>'

Draws three cover fronts, each a different idea. With OpenAI connected they’re whole designs drawn by GPT Image at the front’s print size on its account, the title, subtitle and author’s name set into each wherever the design places them, and printed as they are. Without it they’re art by Digize’s Flux on the AI meter, with no words (the title and author are set over it at build), which suits the ebook but is too small to print (upload a cover for print). The last round’s fronts that weren’t picked go.

Needs the books:write permission. It can’t be undone.

bookId
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

Done

Media typeapplication/json
object
round
required
Any of:
object
round
required
integer
>= -9007199254740991 <= 9007199254740991
source
required

GPT Image on the workspace’s OpenAI account, or Digize’s Flux on the AI meter when OpenAI isn’t connected (1,024 px: the ebook only).

string
Allowed values: openai flux
change
required

A “Change this” round: what it asked for.

string | null
designed
required

Whether its fronts are whole designs with the title, subtitle and author’s name in them, placed by GPT Image; otherwise they’re art the title and author are set over at build.

boolean
fronts
required
Array<object>
object
variant
required
integer
>= -9007199254740991 <= 9007199254740991
picked
required

Whether it’s the cover now.

boolean
status
required
string
Allowed values: drawing ready failed
widthPx
required
Any of:
integer
>= -9007199254740991 <= 9007199254740991
heightPx
required
Any of:
integer
>= -9007199254740991 <= 9007199254740991
cost
required

US dollars.

number
error
required
string | null
url
required
string | null
thumbUrl
required
string | null
startedAt
required
number
chosen
required
Any of:
object
source
required
string
Allowed values: openai flux upload
designed
required

A whole design with the words in it, printed as it is; otherwise the title and author are set over it at build.

boolean
reads
required

A designed front’s words: title · subtitle · author.

string | null
widthPx
required
Any of:
integer
>= -9007199254740991 <= 9007199254740991
heightPx
required
Any of:
integer
>= -9007199254740991 <= 9007199254740991
dpi
required
number | null
printable
required

Whether it’s big enough for the printed cover; a smaller one does for the ebook.

boolean
url
required
string | null
thumbUrl
required
string | null
wordsChanged
required

The designed front picked reads a title, subtitle or author the book doesn’t have any more: change it or draw new fronts.

boolean
backCopy
required
string
spineText
required
string
suggestedBackCopy
required

The introduction’s opening, as a first draft of the back copy.

string
authorName
required
string
authorBio
required
string
authorImageId
required
string | null
authorImageUrl
required
string | null
openAi
required
boolean
model
required
string
preview
required
Any of:
object
id
required
string
bookId
required
string
status
required

building while the Workflow sets it, then ready or failed.

string
Allowed values: building ready failed
pages
required
Any of:
integer
>= -9007199254740991 <= 9007199254740991
spinePt
required

The spine’s width, in points.

number | null
coverWidthPt
required

The whole cover (back, spine and front, with bleed), in points.

number | null
coverHeightPt
required
number | null
coverRule
required
Any of:
string
Allowed values: lulu kdp
trim
required
string
Allowed values: 5x8 5.5x8.5 6x9 7x10 8.5x11
theme
required
string
Allowed values: classic modern workbook
podPackageId
required
string | null
coverOnly
required

A build of the cover alone, for the Cover tab’s preview: no interior or EPUB, the spine sized for the last build’s pages or the words’.

boolean
warnings
required
Array
One of:
object
kind
required
string
Allowed value: sample
error
required
string | null
startedBy
required
string
createdAt
required
string format: date-time
finishedAt
required
Any of:
string format: date-time
files
required
object
interior
required
Any of:
object
url
required

A signed link to the file, good for 24 hours. No sign-in needed.

string
bytes
required
integer
>= -9007199254740991 <= 9007199254740991
name
required

The name it downloads as.

string
type
required
string
cover
required
Any of:
object
url
required

A signed link to the file, good for 24 hours. No sign-in needed.

string
bytes
required
integer
>= -9007199254740991 <= 9007199254740991
name
required

The name it downloads as.

string
type
required
string
epub
required
Any of:
object
url
required

A signed link to the file, good for 24 hours. No sign-in needed.

string
bytes
required
integer
>= -9007199254740991 <= 9007199254740991
name
required

The name it downloads as.

string
type
required
string
coverImage
required
Any of:
object
url
required

A signed link to the file, good for 24 hours. No sign-in needed.

string
bytes
required
integer
>= -9007199254740991 <= 9007199254740991
name
required

The name it downloads as.

string
type
required
string

Example

{
"round": {
"source": "openai",
"fronts": [
{
"status": "drawing"
}
]
},
"chosen": {
"source": "openai"
},
"preview": {
"status": "building",
"coverRule": "lulu",
"trim": "5x8",
"theme": "classic",
"warnings": [
{
"kind": "sample"
}
]
}
}

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