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

Autorizaciones

Authorization
string
header
requerido

Authorization: Bearer ak_eu_…. The prefix is the project's region and must match the server (api.eu / api.us).

Encabezados

Idempotency-Key
string

Strongly recommended on POST (the SDK always sends one). 24 h, per organization.

Parámetros de consulta

dry_run
boolean

Validate without creating anything.

Cuerpo

application/json
operation
enum<string>
predeterminado:create
Opciones disponibles:
create,
review,
edit,
extract
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 store: false, 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; 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 the request asks to copy the look of one of them ("with the design of our template"), Doconda uses it as the design: a PowerPoint for a presentation is its template at any quality; anything else needs best.

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, 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 in a project that stores nothing.

store
boolean
predeterminado:true

false: 15 minutes after it finishes Doconda deletes the files, the request, the report and the events. Only what billing needs stays (status, format, pages, cost).

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,
extract
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 store: false, 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

manual: a version someone edited by hand in the editor (POST /documents/{id}/versions).

Opciones disponibles:
prompt,
content,
manual
sector
string | null
requerido

The professional sector Doconda recognised in the request (legal, healthcare, accounting…). Its guide shapes the structure and conventions; what you say or send always wins.

parent_id
string | null
requerido

The document this version was edited from.

Pattern: ^doc_[0-9A-HJKMNP-TV-Z]{26}$
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
store
boolean
requerido

false: its content is deleted 15 minutes after it finishes.

route
object | null
requerido

The path Doconda chose to make the file, and why. fast: the AI writes the text and Doconda lays it out (seconds). agent: an AI agent writes the program that builds the file, looks at the pages and fixes them (30 s – 2 min; any design, comments, tracked changes, formulas and charts). Doconda always chooses.

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 files, request, report and events were deleted (store: false).

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.