Documents

Create, review or edit a document (direct, stream or background)

post/documents

Request

  • Base URL: https://api.eu.doconda.com/v1
  • URL: https://api.eu.doconda.com/v1/documents
  • Auth: one of:
    • HTTP bearer
    • HTTP bearer

Query parameters

dry_runboolean

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

Headers

Idempotency-Keystring

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.

Request body

operation'create' | 'review' | 'edit'
namestring

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

format'docx' | 'pdf' | 'pptx' | 'xlsx' | 'artifact'

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.

promptstring

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

stylestring

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.

quality'auto' | 'fast' | 'standard' | 'best'

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

max_quality'fast' | 'standard' | 'best'

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

streamboolean

Answer with text/event-stream on this connection.

backgroundboolean

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

metadataobject
retention'none' | '1d' | '7d' | '30d' | '90d'

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

Response

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

OR

Changes

No recorded changes to this operation across all 1 revision of this API.