Crear un documento
Crea, revisa o edita un documento, en modo directo, stream o background.
curl --request POST \
--url https://api.eu.doconda.com/v1/documents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"operation": "create",
"name": "<string>",
"prompt": "<string>",
"style": "<string>",
"sources": [
"<string>"
],
"file": "<string>",
"quality": "auto",
"stream": false,
"background": false,
"metadata": {},
"artifact": {},
"store": true
}
'import requests
url = "https://api.eu.doconda.com/v1/documents"
payload = {
"operation": "create",
"name": "<string>",
"prompt": "<string>",
"style": "<string>",
"sources": ["<string>"],
"file": "<string>",
"quality": "auto",
"stream": False,
"background": False,
"metadata": {},
"artifact": {},
"store": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
operation: 'create',
name: '<string>',
prompt: '<string>',
style: '<string>',
sources: ['<string>'],
file: '<string>',
quality: 'auto',
stream: false,
background: false,
metadata: {},
artifact: {},
store: true
})
};
fetch('https://api.eu.doconda.com/v1/documents', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.eu.doconda.com/v1/documents",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'operation' => 'create',
'name' => '<string>',
'prompt' => '<string>',
'style' => '<string>',
'sources' => [
'<string>'
],
'file' => '<string>',
'quality' => 'auto',
'stream' => false,
'background' => false,
'metadata' => [
],
'artifact' => [
],
'store' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.eu.doconda.com/v1/documents"
payload := strings.NewReader("{\n \"operation\": \"create\",\n \"name\": \"<string>\",\n \"prompt\": \"<string>\",\n \"style\": \"<string>\",\n \"sources\": [\n \"<string>\"\n ],\n \"file\": \"<string>\",\n \"quality\": \"auto\",\n \"stream\": false,\n \"background\": false,\n \"metadata\": {},\n \"artifact\": {},\n \"store\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.eu.doconda.com/v1/documents")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"operation\": \"create\",\n \"name\": \"<string>\",\n \"prompt\": \"<string>\",\n \"style\": \"<string>\",\n \"sources\": [\n \"<string>\"\n ],\n \"file\": \"<string>\",\n \"quality\": \"auto\",\n \"stream\": false,\n \"background\": false,\n \"metadata\": {},\n \"artifact\": {},\n \"store\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eu.doconda.com/v1/documents")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"operation\": \"create\",\n \"name\": \"<string>\",\n \"prompt\": \"<string>\",\n \"style\": \"<string>\",\n \"sources\": [\n \"<string>\"\n ],\n \"file\": \"<string>\",\n \"quality\": \"auto\",\n \"stream\": false,\n \"background\": false,\n \"metadata\": {},\n \"artifact\": {},\n \"store\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"object": "document",
"name": "<string>",
"operation": "create",
"format": "docx",
"type": "report",
"mode": "prompt",
"sector": "<string>",
"parent_id": "<string>",
"status": "queued",
"phase": "<string>",
"pages": 0,
"style_applied": {
"font": "<string>",
"font_size": 123,
"line_spacing": 123,
"colors": {
"title": "<string>",
"headings": "<string>",
"text": "<string>",
"accent": "<string>"
},
"align": {
"title": "left",
"headings": "left",
"body": "left"
},
"margins_cm": 123,
"orientation": "portrait",
"cover_page": true,
"table_of_contents": true,
"page_numbers": true,
"header": "<string>",
"footer": "<string>"
},
"style_unsupported": [
"<string>"
],
"validation_summary": {
"errors": 0,
"warnings": 0,
"info": 0
},
"repair_summary": {
"iterations": 0,
"applied": 0,
"rejected": 0
},
"error": {
"code": "<string>",
"message": "<string>"
},
"versions": {
"engine": "<string>",
"renderer": "<string>",
"model": "<string>"
},
"metadata": {},
"store": true,
"route": {
"path": "fast",
"reason": "<string>"
},
"quality": {
"requested": "auto",
"level": "fast",
"reason": "<string>"
},
"artifact": {
"storage": "local"
},
"content_deleted_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z",
"outputs": [
{
"id": "<string>",
"kind": "docx",
"content_type": "<string>",
"bytes": 0,
"url": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"page": 0,
"width": 0,
"height": 0
}
]
}{
"id": "<string>",
"object": "document",
"name": "<string>",
"operation": "create",
"format": "docx",
"type": "report",
"mode": "prompt",
"sector": "<string>",
"parent_id": "<string>",
"status": "queued",
"phase": "<string>",
"pages": 0,
"style_applied": {
"font": "<string>",
"font_size": 123,
"line_spacing": 123,
"colors": {
"title": "<string>",
"headings": "<string>",
"text": "<string>",
"accent": "<string>"
},
"align": {
"title": "left",
"headings": "left",
"body": "left"
},
"margins_cm": 123,
"orientation": "portrait",
"cover_page": true,
"table_of_contents": true,
"page_numbers": true,
"header": "<string>",
"footer": "<string>"
},
"style_unsupported": [
"<string>"
],
"validation_summary": {
"errors": 0,
"warnings": 0,
"info": 0
},
"repair_summary": {
"iterations": 0,
"applied": 0,
"rejected": 0
},
"error": {
"code": "<string>",
"message": "<string>"
},
"versions": {
"engine": "<string>",
"renderer": "<string>",
"model": "<string>"
},
"metadata": {},
"store": true,
"route": {
"path": "fast",
"reason": "<string>"
},
"quality": {
"requested": "auto",
"level": "fast",
"reason": "<string>"
},
"artifact": {
"storage": "local"
},
"content_deleted_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z",
"outputs": [
{
"id": "<string>",
"kind": "docx",
"content_type": "<string>",
"bytes": 0,
"url": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"page": 0,
"width": 0,
"height": 0
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 0,
"code": "<string>",
"request_id": "<string>",
"errors": [
{
"path": "<string>",
"message": "<string>"
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 0,
"code": "<string>",
"request_id": "<string>",
"errors": [
{
"path": "<string>",
"message": "<string>"
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 0,
"code": "<string>",
"request_id": "<string>",
"errors": [
{
"path": "<string>",
"message": "<string>"
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 0,
"code": "<string>",
"request_id": "<string>",
"errors": [
{
"path": "<string>",
"message": "<string>"
}
]
}Autorizaciones
Authorization: Bearer ak_eu_…. The prefix is the project's region and must match the server (api.eu / api.us).
Encabezados
Strongly recommended on POST (the SDK always sends one). 24 h, per organization.
Parámetros de consulta
Validate without creating anything.
Cuerpo
create, review, edit, extract A name to find it later ("Contrato piso Malasaña"). It also names the downloaded files.
1 - 200The 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.
docx, pdf, pptx, xlsx, artifact What to write (create) or what to change (edit). Uses a model.
3 - 8000Your own text, in Markdown (create; for an artifact, the content of its page).
Show child attributes
Show child attributes
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.
1 - 1000create: 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  (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.
15A file uploaded with POST /files.
^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).
^file_create / edit: fast, standard or best (see Quality), or auto to let Doconda choose. Each level has its own price.
auto, fast, standard, best With quality: "auto": the highest level Doconda may choose, to cap the price.
fast, standard, best Answer with text/event-stream on this connection.
Answer 202 at once; follow with GET, /events or webhooks.
Show child attributes
Show child attributes
Artifacts only. Without it: shared, or local in a project that stores nothing.
Show child attributes
Show child attributes
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.
- Option 1
- Option 2
^doc_[0-9A-HJKMNP-TV-Z]{26}$"document"The name you gave it (name when creating it).
create, review, edit, extract 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.
docx, pdf, pptx, xlsx, artifact 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.
report, letter, contract, memo, minutes, presentation, spreadsheet, artifact manual: a version someone edited by hand in the editor (POST /documents/{id}/versions).
prompt, content, manual 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.
The document this version was edited from.
^doc_[0-9A-HJKMNP-TV-Z]{26}$queued, running, ready, ready_with_warnings, needs_review, failed, canceled -9007199254740991 <= x <= 9007199254740991Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
false: its content is deleted 15 minutes after it finishes.
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.
Show child attributes
Show child attributes
create and edit: the quality level asked for and the one used, which sets the price.
Show child attributes
Show child attributes
Artifacts only: where the page keeps its data.
Show child attributes
Show child attributes
When its files, request, report and events were deleted (store: false).
^(?:(?:\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)))$^(?:(?:\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)))$^(?:(?:\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)))$Present once finished.
Show child attributes
Show child attributes
curl --request POST \
--url https://api.eu.doconda.com/v1/documents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"operation": "create",
"name": "<string>",
"prompt": "<string>",
"style": "<string>",
"sources": [
"<string>"
],
"file": "<string>",
"quality": "auto",
"stream": false,
"background": false,
"metadata": {},
"artifact": {},
"store": true
}
'import requests
url = "https://api.eu.doconda.com/v1/documents"
payload = {
"operation": "create",
"name": "<string>",
"prompt": "<string>",
"style": "<string>",
"sources": ["<string>"],
"file": "<string>",
"quality": "auto",
"stream": False,
"background": False,
"metadata": {},
"artifact": {},
"store": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
operation: 'create',
name: '<string>',
prompt: '<string>',
style: '<string>',
sources: ['<string>'],
file: '<string>',
quality: 'auto',
stream: false,
background: false,
metadata: {},
artifact: {},
store: true
})
};
fetch('https://api.eu.doconda.com/v1/documents', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.eu.doconda.com/v1/documents",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'operation' => 'create',
'name' => '<string>',
'prompt' => '<string>',
'style' => '<string>',
'sources' => [
'<string>'
],
'file' => '<string>',
'quality' => 'auto',
'stream' => false,
'background' => false,
'metadata' => [
],
'artifact' => [
],
'store' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.eu.doconda.com/v1/documents"
payload := strings.NewReader("{\n \"operation\": \"create\",\n \"name\": \"<string>\",\n \"prompt\": \"<string>\",\n \"style\": \"<string>\",\n \"sources\": [\n \"<string>\"\n ],\n \"file\": \"<string>\",\n \"quality\": \"auto\",\n \"stream\": false,\n \"background\": false,\n \"metadata\": {},\n \"artifact\": {},\n \"store\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.eu.doconda.com/v1/documents")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"operation\": \"create\",\n \"name\": \"<string>\",\n \"prompt\": \"<string>\",\n \"style\": \"<string>\",\n \"sources\": [\n \"<string>\"\n ],\n \"file\": \"<string>\",\n \"quality\": \"auto\",\n \"stream\": false,\n \"background\": false,\n \"metadata\": {},\n \"artifact\": {},\n \"store\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eu.doconda.com/v1/documents")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"operation\": \"create\",\n \"name\": \"<string>\",\n \"prompt\": \"<string>\",\n \"style\": \"<string>\",\n \"sources\": [\n \"<string>\"\n ],\n \"file\": \"<string>\",\n \"quality\": \"auto\",\n \"stream\": false,\n \"background\": false,\n \"metadata\": {},\n \"artifact\": {},\n \"store\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"object": "document",
"name": "<string>",
"operation": "create",
"format": "docx",
"type": "report",
"mode": "prompt",
"sector": "<string>",
"parent_id": "<string>",
"status": "queued",
"phase": "<string>",
"pages": 0,
"style_applied": {
"font": "<string>",
"font_size": 123,
"line_spacing": 123,
"colors": {
"title": "<string>",
"headings": "<string>",
"text": "<string>",
"accent": "<string>"
},
"align": {
"title": "left",
"headings": "left",
"body": "left"
},
"margins_cm": 123,
"orientation": "portrait",
"cover_page": true,
"table_of_contents": true,
"page_numbers": true,
"header": "<string>",
"footer": "<string>"
},
"style_unsupported": [
"<string>"
],
"validation_summary": {
"errors": 0,
"warnings": 0,
"info": 0
},
"repair_summary": {
"iterations": 0,
"applied": 0,
"rejected": 0
},
"error": {
"code": "<string>",
"message": "<string>"
},
"versions": {
"engine": "<string>",
"renderer": "<string>",
"model": "<string>"
},
"metadata": {},
"store": true,
"route": {
"path": "fast",
"reason": "<string>"
},
"quality": {
"requested": "auto",
"level": "fast",
"reason": "<string>"
},
"artifact": {
"storage": "local"
},
"content_deleted_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z",
"outputs": [
{
"id": "<string>",
"kind": "docx",
"content_type": "<string>",
"bytes": 0,
"url": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"page": 0,
"width": 0,
"height": 0
}
]
}{
"id": "<string>",
"object": "document",
"name": "<string>",
"operation": "create",
"format": "docx",
"type": "report",
"mode": "prompt",
"sector": "<string>",
"parent_id": "<string>",
"status": "queued",
"phase": "<string>",
"pages": 0,
"style_applied": {
"font": "<string>",
"font_size": 123,
"line_spacing": 123,
"colors": {
"title": "<string>",
"headings": "<string>",
"text": "<string>",
"accent": "<string>"
},
"align": {
"title": "left",
"headings": "left",
"body": "left"
},
"margins_cm": 123,
"orientation": "portrait",
"cover_page": true,
"table_of_contents": true,
"page_numbers": true,
"header": "<string>",
"footer": "<string>"
},
"style_unsupported": [
"<string>"
],
"validation_summary": {
"errors": 0,
"warnings": 0,
"info": 0
},
"repair_summary": {
"iterations": 0,
"applied": 0,
"rejected": 0
},
"error": {
"code": "<string>",
"message": "<string>"
},
"versions": {
"engine": "<string>",
"renderer": "<string>",
"model": "<string>"
},
"metadata": {},
"store": true,
"route": {
"path": "fast",
"reason": "<string>"
},
"quality": {
"requested": "auto",
"level": "fast",
"reason": "<string>"
},
"artifact": {
"storage": "local"
},
"content_deleted_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z",
"outputs": [
{
"id": "<string>",
"kind": "docx",
"content_type": "<string>",
"bytes": 0,
"url": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"page": 0,
"width": 0,
"height": 0
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 0,
"code": "<string>",
"request_id": "<string>",
"errors": [
{
"path": "<string>",
"message": "<string>"
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 0,
"code": "<string>",
"request_id": "<string>",
"errors": [
{
"path": "<string>",
"message": "<string>"
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 0,
"code": "<string>",
"request_id": "<string>",
"errors": [
{
"path": "<string>",
"message": "<string>"
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 0,
"code": "<string>",
"request_id": "<string>",
"errors": [
{
"path": "<string>",
"message": "<string>"
}
]
}