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",
"background": false,
"metadata": {},
"artifact": {}
}
'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",
"background": False,
"metadata": {},
"artifact": {}
}
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',
background: false,
metadata: {},
artifact: {}
})
};
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',
'background' => false,
'metadata' => [
],
'artifact' => [
]
]),
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 \"background\": false,\n \"metadata\": {},\n \"artifact\": {}\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 \"background\": false,\n \"metadata\": {},\n \"artifact\": {}\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 \"background\": false,\n \"metadata\": {},\n \"artifact\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"object": "document",
"name": "<string>",
"operation": "create",
"format": "docx",
"type": "report",
"mode": "prompt",
"revision": 4503599627370496,
"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>"
},
"error": {
"code": "<string>",
"message": "<string>"
},
"versions": {
"engine": "<string>",
"renderer": "<string>",
"model": "<string>"
},
"metadata": {},
"retention": "none",
"expires_at": "2023-11-07T05:31:56Z",
"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",
"revision": 4503599627370496,
"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>"
},
"error": {
"code": "<string>",
"message": "<string>"
},
"versions": {
"engine": "<string>",
"renderer": "<string>",
"model": "<string>"
},
"metadata": {},
"retention": "none",
"expires_at": "2023-11-07T05:31:56Z",
"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>"
}
]
}Crear un documento
Crea o edita un documento, en modo directo 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",
"background": false,
"metadata": {},
"artifact": {}
}
'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",
"background": False,
"metadata": {},
"artifact": {}
}
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',
background: false,
metadata: {},
artifact: {}
})
};
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',
'background' => false,
'metadata' => [
],
'artifact' => [
]
]),
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 \"background\": false,\n \"metadata\": {},\n \"artifact\": {}\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 \"background\": false,\n \"metadata\": {},\n \"artifact\": {}\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 \"background\": false,\n \"metadata\": {},\n \"artifact\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"object": "document",
"name": "<string>",
"operation": "create",
"format": "docx",
"type": "report",
"mode": "prompt",
"revision": 4503599627370496,
"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>"
},
"error": {
"code": "<string>",
"message": "<string>"
},
"versions": {
"engine": "<string>",
"renderer": "<string>",
"model": "<string>"
},
"metadata": {},
"retention": "none",
"expires_at": "2023-11-07T05:31:56Z",
"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",
"revision": 4503599627370496,
"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>"
},
"error": {
"code": "<string>",
"message": "<string>"
},
"versions": {
"engine": "<string>",
"renderer": "<string>",
"model": "<string>"
},
"metadata": {},
"retention": "none",
"expires_at": "2023-11-07T05:31:56Z",
"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
Encabezados
Parámetros de consulta
Cuerpo
El archivo que quieres. docx → Word (y también su PDF), pdf → solo el PDF, pptx → PowerPoint (con su PDF), xlsx → Excel (con su PDF). artifact → una página web que guarda datos (en el navegador de cada visitante, o compartidos por todos), en un enlace firmado; con retention: none, una página para descargar (ver la guía de artifacts). Si no lo pones, Doconda lo deduce de prompt.
docx, pdf, pptx, xlsx, artifact Al crear: tus archivos para el documento. Los documentos (Word, PowerPoint, Excel, PDF, también .doc/.ppt/.xls, TXT, Markdown, HTML; hasta 5) son material para escribir, con prompt. Las imágenes (PNG, JPEG, GIF, WebP; hasta 10) van dentro del documento: con prompt, la IA las coloca donde encajan; con content, apunta a ellas desde el Markdown con  (la primera imagen de sources). Si prompt pide copiar el aspecto de uno de ellos («con el diseño de nuestra plantilla»), Doconda lo usa como diseño en standard y best (un PowerPoint para una presentación es su plantilla); en fast el documento falla con design_needs_quality, y con quality: "auto" copiar un diseño elige al menos standard (best para todo lo que no sea una plantilla de PowerPoint para una presentación). En un artifact, la página se hace con los datos de los documentos y las imágenes van dentro, reducidas (900 KB como mucho para toda la página).
15Un archivo subido con POST /files.
^file_Respuesta
Modo directo: el documento terminado con sus enlaces de descarga. Con dry_run: DryRunResult.
- Option 1
- Option 2
El archivo que quieres. docx → Word (y también su PDF), pdf → solo el PDF, pptx → PowerPoint (con su PDF), xlsx → Excel (con su PDF). artifact → una página web que guarda datos (en el navegador de cada visitante, o compartidos por todos), en un enlace firmado; con retention: none, una página para descargar (ver la guía de artifacts). Si no lo pones, Doconda lo deduce de prompt.
docx, pdf, pptx, xlsx, artifact Qué es el documento, según decidió Doconda. Fija el aspecto por defecto (un contrato: serif, justificado, cláusulas numeradas; una carta: sin números de página). No lo eliges tú: di lo que quieres en prompt, y el aspecto en style.
report, letter, contract, memo, minutes, presentation, spreadsheet, artifact Cuánto tiempo guarda Doconda el contenido de un documento (archivos, petición, informe, eventos; la página y los datos de un artifact) después de que termina. none: 15 minutos. Después solo queda lo que necesita la facturación (estado, formato, páginas, coste).
none, 1d, 7d, 30d, 90d Cuándo se borrará su contenido: la retention contada desde que terminó o desde el último guardado a mano (con retention: none, desde que terminó).
^(?:(?:\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)))$Cuándo se borró su contenido: acabó su retención, o se borró.
^(?:(?:\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)))$