Skip to main content
POST
Create, review or edit a document (direct, stream or background)

Autorizaciones

Authorization
string
header
requerido

Authorization: Bearer ak_eu_…, a key from the dashboard (API keys).

Encabezados

Idempotency-Key
string

Strongly recommended (the SDKs always send one). The same key with the same body within 24 h, in the same project, returns the same document; with another body, 422 idempotency_key_reused.

Parámetros de consulta

dry_run
boolean

Validate the fields, the operation and the files without creating anything. The style and the balance aren't checked.

Cuerpo

application/json
operation
enum<string>
predeterminado:create
Opciones disponibles:
create,
review,
edit
name
string

A name to find it later ("Contrato piso Malasaña"). It also names the downloaded files.

Required string length: 1 - 200
format
enum<string>

The file you want. docx → Word (with a PDF too), pdf → only the PDF, pptx → PowerPoint (with a PDF), xlsx → Excel (with a PDF). artifact → a web page that keeps data (in each visitor's browser, or shared by everyone), on a signed link; with retention: none, a page to download (see the artifacts guide). Without it, Doconda works it out from prompt.

Opciones disponibles:
docx,
pdf,
pptx,
xlsx,
artifact
prompt
string

What to write (create) or what to change (edit). Uses a model.

Required string length: 3 - 8000
content
object

Your own text, in Markdown (create; for an artifact, the content of its page).

style
string

The look, in your own words: "blue centred headings, Lora font, with a cover page and a table of contents". What can't be done is listed in style_unsupported.

Required string length: 1 - 1000
sources
string · string · object · object[]

create: your files for the document. Documents (Word, PowerPoint, Excel, PDF, also .doc/.ppt/.xls, TXT, Markdown, HTML; up to 5) are material to write from, with prompt. Pictures (PNG, JPEG, GIF, WebP; up to 10) go into the document: with prompt the AI places them where they fit; with content, point to them from the Markdown as ![caption](img:1) (the first picture in sources). If prompt asks to copy the look of one of them ("with the design of our template"), Doconda uses it as the design at standard and best (a PowerPoint for a presentation is its template); at fast it is not copied and the report says so (design.not_copied), and with quality: "auto" copying anything other than a PowerPoint template for a presentation picks best. For an artifact, the page is built from the data in the documents and the pictures go inside it, made smaller (900 KB at most for the whole page).

Maximum array length: 15

A file uploaded with POST /files.

Pattern: ^file_
file

review / edit / extract: the file to work on. review and edit take Word, PowerPoint, Excel or PDF (up to 50 pages), also .doc, .ppt and .xls (they come back as .docx, .pptx and .xlsx).

Pattern: ^file_
quality
enum<string>
predeterminado:auto

create / edit: fast, standard or best (see Quality), or auto to let Doconda choose. Each level has its own price.

Opciones disponibles:
auto,
fast,
standard,
best
max_quality
enum<string>

With quality: "auto": the highest level Doconda may choose, to cap the price.

Opciones disponibles:
fast,
standard,
best
stream
boolean
predeterminado:false

Answer with text/event-stream on this connection.

background
boolean
predeterminado:false

Answer 202 at once; follow with GET, /events or webhooks.

metadata
object
artifact
object

Artifacts only. Without it: shared, or local with retention: none.

retention
enum<string>

Without it, the project's retention (30 days unless changed).

Opciones disponibles:
none,
1d,
7d,
30d,
90d

Respuesta

Direct mode: the finished document with its download links. Stream mode: text/event-stream of DocumentEvent. Dry run: DryRunResult.

id
string
requerido
Pattern: ^doc_[0-9A-HJKMNP-TV-Z]{26}$
object
string
requerido
Allowed value: "document"
name
string | null
requerido

The name you gave it (name when creating it).

operation
enum<string>
requerido
Opciones disponibles:
create,
review,
edit
format
enum<string> | null
requerido

The file you want. docx → Word (with a PDF too), pdf → only the PDF, pptx → PowerPoint (with a PDF), xlsx → Excel (with a PDF). artifact → a web page that keeps data (in each visitor's browser, or shared by everyone), on a signed link; with retention: none, a page to download (see the artifacts guide). Without it, Doconda works it out from prompt.

Opciones disponibles:
docx,
pdf,
pptx,
xlsx,
artifact
type
enum<string> | null
requerido

What Doconda decided the document is. It sets the default look (a contract: serif, justified, numbered clauses; a letter: no page numbers). You don't choose it: say what you want in prompt, and the look in style.

Opciones disponibles:
report,
letter,
contract,
memo,
minutes,
presentation,
spreadsheet,
artifact
mode
enum<string> | null
requerido
Opciones disponibles:
prompt,
content
revision
integer
requerido

1 when it's made; +1 every time its file is saved by hand (PUT /documents/{id}/file). Send it back when saving so nobody's changes are overwritten.

Rango requerido: 1 <= x <= 9007199254740991
status
enum<string>
requerido
Opciones disponibles:
queued,
running,
ready,
ready_with_warnings,
needs_review,
failed,
canceled
phase
string | null
requerido
pages
integer | null
requerido
Rango requerido: -9007199254740991 <= x <= 9007199254740991
style_applied
object | null
requerido
style_unsupported
string[]
requerido
validation_summary
object | null
requerido
repair_summary
object | null
requerido
error
object | null
requerido
versions
object
requerido
metadata
object
requerido
retention
enum<string>
requerido

How long Doconda keeps a document's content (files, request, report, events; an artifact's page and data) once it finishes. none: 15 minutes. Then only what billing needs stays (status, format, pages, cost).

Opciones disponibles:
none,
1d,
7d,
30d,
90d
expires_at
string<date-time> | null
requerido

When its content will be deleted: retention counted from when it finished or was last saved by hand (with retention: none, from when it finished).

Pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
route
object | null
requerido

How the file was made, and why. fast: in seconds, with the basic style (quality: "fast"). agent: in minutes, with any design, templates, comments, tracked changes and charts (standard and best).

quality
object | null
requerido

create and edit: the quality level asked for and the one used, which sets the price.

artifact
object | null
requerido

Artifacts only: where the page keeps its data.

content_deleted_at
string<date-time> | null
requerido

When its content was deleted: its retention ended, or it was deleted.

Pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
created_at
string<date-time>
requerido
Pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
completed_at
string<date-time> | null
requerido
Pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
outputs
object[]

Present once finished.