curl --request PATCH \
--url https://api.{environment}.corti.app/v2/documents/{documentID} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Tenant-Name: <tenant-name>' \
--data '
{
"name": "<string>",
"stringDocument": {},
"structuredDocument": {},
"labels": [
{
"key": "<string>",
"value": "<string>"
}
]
}
'const options = {
method: 'PATCH',
headers: {
'Tenant-Name': '<tenant-name>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: '<string>',
stringDocument: {},
structuredDocument: {},
labels: [{key: '<string>', value: '<string>'}]
})
};
fetch('https://api.{environment}.corti.app/v2/documents/{documentID}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));using RestSharp;
var options = new RestClientOptions("https://api.{environment}.corti.app/v2/documents/{documentID}");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Tenant-Name", "<tenant-name>");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{\n \"name\": \"<string>\",\n \"stringDocument\": {},\n \"structuredDocument\": {},\n \"labels\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n}", false);
var response = await client.PatchAsync(request);
Console.WriteLine("{0}", response.Content);
import requests
url = "https://api.{environment}.corti.app/v2/documents/{documentID}"
payload = {
"name": "<string>",
"stringDocument": {},
"structuredDocument": {},
"labels": [
{
"key": "<string>",
"value": "<string>"
}
]
}
headers = {
"Tenant-Name": "<tenant-name>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.{environment}.corti.app/v2/documents/{documentID}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'stringDocument' => [
],
'structuredDocument' => [
],
'labels' => [
[
'key' => '<string>',
'value' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Tenant-Name: <tenant-name>"
],
]);
$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.{environment}.corti.app/v2/documents/{documentID}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"stringDocument\": {},\n \"structuredDocument\": {},\n \"labels\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Tenant-Name", "<tenant-name>")
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.patch("https://api.{environment}.corti.app/v2/documents/{documentID}")
.header("Tenant-Name", "<tenant-name>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"stringDocument\": {},\n \"structuredDocument\": {},\n \"labels\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n}")
.asString();{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"templateId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"templateVersionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"outputLanguage": "<string>",
"stringDocument": {},
"labels": [
{
"key": "<string>",
"value": "<string>"
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"interactionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"structuredDocument": {}
}{
"requestid": "<string>",
"status": 123,
"type": "<string>",
"detail": "<string>",
"validationErrors": [
{}
]
}{
"requestid": "<string>",
"status": 123,
"type": "<string>",
"detail": "<string>",
"validationErrors": [
{}
]
}Update document
Updates the document’s name, labels, or rendered output (stringDocument / structuredDocument).
Use this to persist edits made to a previously generated document.
curl --request PATCH \
--url https://api.{environment}.corti.app/v2/documents/{documentID} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Tenant-Name: <tenant-name>' \
--data '
{
"name": "<string>",
"stringDocument": {},
"structuredDocument": {},
"labels": [
{
"key": "<string>",
"value": "<string>"
}
]
}
'const options = {
method: 'PATCH',
headers: {
'Tenant-Name': '<tenant-name>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: '<string>',
stringDocument: {},
structuredDocument: {},
labels: [{key: '<string>', value: '<string>'}]
})
};
fetch('https://api.{environment}.corti.app/v2/documents/{documentID}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));using RestSharp;
var options = new RestClientOptions("https://api.{environment}.corti.app/v2/documents/{documentID}");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Tenant-Name", "<tenant-name>");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{\n \"name\": \"<string>\",\n \"stringDocument\": {},\n \"structuredDocument\": {},\n \"labels\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n}", false);
var response = await client.PatchAsync(request);
Console.WriteLine("{0}", response.Content);
import requests
url = "https://api.{environment}.corti.app/v2/documents/{documentID}"
payload = {
"name": "<string>",
"stringDocument": {},
"structuredDocument": {},
"labels": [
{
"key": "<string>",
"value": "<string>"
}
]
}
headers = {
"Tenant-Name": "<tenant-name>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.{environment}.corti.app/v2/documents/{documentID}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'stringDocument' => [
],
'structuredDocument' => [
],
'labels' => [
[
'key' => '<string>',
'value' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Tenant-Name: <tenant-name>"
],
]);
$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.{environment}.corti.app/v2/documents/{documentID}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"stringDocument\": {},\n \"structuredDocument\": {},\n \"labels\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Tenant-Name", "<tenant-name>")
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.patch("https://api.{environment}.corti.app/v2/documents/{documentID}")
.header("Tenant-Name", "<tenant-name>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"stringDocument\": {},\n \"structuredDocument\": {},\n \"labels\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n}")
.asString();{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"templateId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"templateVersionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"outputLanguage": "<string>",
"stringDocument": {},
"labels": [
{
"key": "<string>",
"value": "<string>"
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"interactionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"structuredDocument": {}
}{
"requestid": "<string>",
"status": 123,
"type": "<string>",
"detail": "<string>",
"validationErrors": [
{}
]
}{
"requestid": "<string>",
"status": 123,
"type": "<string>",
"detail": "<string>",
"validationErrors": [
{}
]
}Authorizations
Input your token
Headers
Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request.
"base"
Path Parameters
Body
Response
OK
A generated document saved to the database.
The template ID used for generation. For a plain templateRef with no overrides this is the referenced template. For other paths it is the newly saved auto-generated template aggregate.
The specific template version that was used for generation.
The BCP 47 language tag of the generated output.
The generated document as a map of section key to rendered string output.
Show child attributes
Show child attributes
Key/value labels attached to this document.
Show child attributes
Show child attributes
The interaction whose context was used to generate this document, if supplied.
The generated document as a structured object keyed by section.
Was this page helpful?