curl --request POST \
--url https://api.eu.doconda.com/v1/documents/{document_id}/versions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"file": "<string>"
}
'import requests
url = "https://api.eu.doconda.com/v1/documents/{document_id}/versions"
payload = { "file": "<string>" }
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({file: '<string>'})
};
fetch('https://api.eu.doconda.com/v1/documents/{document_id}/versions', 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/{document_id}/versions",
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([
'file' => '<string>'
]),
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/{document_id}/versions"
payload := strings.NewReader("{\n \"file\": \"<string>\"\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/{document_id}/versions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"file\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eu.doconda.com/v1/documents/{document_id}/versions")
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 \"file\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"object": "document",
"name": "<string>",
"operation": "create",
"format": "docx",
"type": "report",
"mode": "prompt",
"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": {},
"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",
"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": {},
"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>"
}
]
}Save a version
A new document from a file edited by hand; a Word file is also reviewed.
curl --request POST \
--url https://api.eu.doconda.com/v1/documents/{document_id}/versions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"file": "<string>"
}
'import requests
url = "https://api.eu.doconda.com/v1/documents/{document_id}/versions"
payload = { "file": "<string>" }
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({file: '<string>'})
};
fetch('https://api.eu.doconda.com/v1/documents/{document_id}/versions', 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/{document_id}/versions",
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([
'file' => '<string>'
]),
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/{document_id}/versions"
payload := strings.NewReader("{\n \"file\": \"<string>\"\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/{document_id}/versions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"file\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eu.doconda.com/v1/documents/{document_id}/versions")
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 \"file\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"object": "document",
"name": "<string>",
"operation": "create",
"format": "docx",
"type": "report",
"mode": "prompt",
"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": {},
"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",
"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": {},
"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>"
}
]
}Authorizations
Authorization: Bearer ak_eu_…, a key from the dashboard (API keys).
Path Parameters
Body
The edited file: same format as the document (Word, Excel, PowerPoint or PDF).
^file_Response
The new document (mode: manual, parent_id). Free: no AI.
^doc_[0-9A-HJKMNP-TV-Z]{26}$"document"The name you gave it (name when creating it).
create, review, edit 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.
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 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
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).
none, 1d, 7d, 30d, 90d When its content will be deleted (set once it finishes, from retention).
^(?:(?:\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)))$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).
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 content was deleted: its retention ended, or it was deleted.
^(?:(?:\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