Change a book's brief
const url = 'https://digize.com/api/v1/books/example';const options = { method: 'PATCH', headers: { 'Idempotency-Key': '5f1c2a8e-3b7d-4c55-9a0e-1f2d3c4b5a69', 'x-api-key': '<x-api-key>', 'Content-Type': 'application/json' }, body: '{"title":"example","subtitle":"example","authorName":"example","authorBio":"example","topic":"example","audience":"example","promise":"example","tone":"example","language":"example","chaptersWanted":1,"chapterLength":"short","trim":"5x8","theme":"classic","figures":{"illustrations":true,"charts":true,"diagrams":true,"style":"example"},"sources":{"website":true,"products":true,"reviews":true,"customers":true,"conversations":true,"newsletter":true,"services":["stripe"]},"anonymize":true}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url https://digize.com/api/v1/books/example \ --header 'Content-Type: application/json' \ --header 'Idempotency-Key: 5f1c2a8e-3b7d-4c55-9a0e-1f2d3c4b5a69' \ --header 'x-api-key: <x-api-key>' \ --data '{ "title": "example", "subtitle": "example", "authorName": "example", "authorBio": "example", "topic": "example", "audience": "example", "promise": "example", "tone": "example", "language": "example", "chaptersWanted": 1, "chapterLength": "short", "trim": "5x8", "theme": "classic", "figures": { "illustrations": true, "charts": true, "diagrams": true, "style": "example" }, "sources": { "website": true, "products": true, "reviews": true, "customers": true, "conversations": true, "newsletter": true, "services": [ "stripe" ] }, "anonymize": true }'Changes some of a book’s brief, or renames it; what’s left out stays as it is. Its slug follows the title until it’s published.
Needs the books:write permission.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Header Parameters
Section titled “Header Parameters”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-1f2d3c4b5a69Request Bodyrequired
Section titled “Request Bodyrequired”object
What the book is about, in the author’s words.
Who it’s for.
What the reader walks away with.
How it sounds, such as Warm and personal.
A BCP 47 tag, such as en or pt-BR.
About 2,000, 3,500 or 6,000 words a chapter.
The page size, in inches.
The layout.
Whether it has illustrations, charts and diagrams, and one style line every drawing follows. They’re drawn on the workspace’s OpenAI account.
object
What the interview may read: the workspace’s own sources, and connected services by id (books.setup.get lists them).
object
Rename people, consistently, in what’s written.
Responses
Section titled “Responses”Done
object
object
object
Made from the title and unique, for the book’s page on a site.
Its stage: brief while the brief isn’t finished, then briefing, interviewing, generating, editing, ready once a build exists, and published once a listing is live.
The author’s photo, from Books › Settings when the book began.
Why reading the sources for the interview failed, when it did; the book is back at brief until it’s started again.
How many runs of the writer it has had; 0 before the first.
Words in its chapters.
The model the author picked to write it, preselected for the next run (books.writers.list).
What writing it with a GPT model has cost on the workspace’s own OpenAI account, in US dollars.
How many things the interview learned, which the writer writes from.
Whether it has something to write from: an outline or an insight (books.generate.start).
B5: the cover front picked, in Images (books.cover.get has the rest).
The cover front picked, as the shelf shows it; unless it’s coverDesigned, the title and author are set over it at build.
Whether the cover front picked is a whole design with the title, subtitle and author in it (GPT Image’s), printed as it is.
Example
{ "chapterLength": "short", "trim": "5x8", "theme": "classic", "sources": { "services": [ "stripe" ] }, "status": "brief"}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" }}A request with the same Idempotency-Key is still running (conflict).
object
object
object
Example
{ "error": { "code": "invalid" }}The Idempotency-Key was used with a different request.
object
object
object
Example
{ "error": { "code": "invalid" }}Over the rate limit; see retry-after.
object
object
object
Example
{ "error": { "code": "invalid" }}