cURL
curl --request PATCH \
--url https://api.{environment}.corti.app/v2/interactions/{id}/documents/{documentId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Tenant-Name: <tenant-name>' \
--data '
{
"name": "<string>",
"sections": [
{
"key": "<string>",
"name": "<string>",
"text": "<string>",
"sort": 123
}
]
}
'import { CortiClient, CortiEnvironment } from "@corti/sdk";
const client = new CortiClient({
environment: CortiEnvironment.Eu,
auth: {
clientId: "YOUR_CLIENT_ID",
clientSecret: "YOUR_CLIENT_SECRET"
},
tenantName: "YOUR_TENANT_NAME"
});
await client.documents.classic.update("f47ac10b-58cc-4372-a567-0e02b2c3d479", "f47ac10b-58cc-4372-a567-0e02b2c3d479");
using Corti.Documents;
using Corti;
var client = new CortiClient(
"TENANT_NAME",
CortiClientEnvironment.Eu,
new CortiClientAuth.ClientCredentials("client_id", "client_secret")
);
await client.Documents.Classic.UpdateAsync(
"f47ac10b-58cc-4372-a567-0e02b2c3d479",
"f47ac10b-58cc-4372-a567-0e02b2c3d479",
new DocumentsUpdateRequest()
);
import requests
url = "https://api.{environment}.corti.app/v2/interactions/{id}/documents/{documentId}"
payload = {
"name": "<string>",
"sections": [
{
"key": "<string>",
"name": "<string>",
"text": "<string>",
"sort": 123
}
]
}
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/interactions/{id}/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>',
'sections' => [
[
'key' => '<string>',
'name' => '<string>',
'text' => '<string>',
'sort' => 123
]
]
]),
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/interactions/{id}/documents/{documentId}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"sections\": [\n {\n \"key\": \"<string>\",\n \"name\": \"<string>\",\n \"text\": \"<string>\",\n \"sort\": 123\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/interactions/{id}/documents/{documentId}")
.header("Tenant-Name", "<tenant-name>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"sections\": [\n {\n \"key\": \"<string>\",\n \"name\": \"<string>\",\n \"text\": \"<string>\",\n \"sort\": 123\n }\n ]\n}")
.asString();{
"id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"name": "<string>",
"templateRef": "<string>",
"isStream": true,
"sections": [
{
"key": "<string>",
"name": "<string>",
"text": "<string>",
"sort": 123,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"outputLanguage": "<string>",
"usageInfo": {
"creditsConsumed": 123
}
}{
"requestid": "<string>",
"status": 123,
"type": "<string>",
"detail": "<string>",
"validationErrors": [
{}
]
}{
"requestid": "<string>",
"status": 123,
"type": "<string>",
"detail": "<string>",
"validationErrors": [
{}
]
}{
"requestid": "<string>",
"status": 123,
"type": "<string>",
"detail": "<string>",
"validationErrors": [
{}
]
}{
"requestid": "<string>",
"status": 123,
"type": "<string>",
"detail": "<string>",
"validationErrors": [
{}
]
}Documents (Classic)
Update Document
deprecated
This endpoint is deprecated in favour of the corresponding GUIDED endpoint. See the deprecation notice for more details and migration guidance.
PATCH
/
interactions
/
{id}
/
documents
/
{documentId}
cURL
curl --request PATCH \
--url https://api.{environment}.corti.app/v2/interactions/{id}/documents/{documentId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Tenant-Name: <tenant-name>' \
--data '
{
"name": "<string>",
"sections": [
{
"key": "<string>",
"name": "<string>",
"text": "<string>",
"sort": 123
}
]
}
'import { CortiClient, CortiEnvironment } from "@corti/sdk";
const client = new CortiClient({
environment: CortiEnvironment.Eu,
auth: {
clientId: "YOUR_CLIENT_ID",
clientSecret: "YOUR_CLIENT_SECRET"
},
tenantName: "YOUR_TENANT_NAME"
});
await client.documents.classic.update("f47ac10b-58cc-4372-a567-0e02b2c3d479", "f47ac10b-58cc-4372-a567-0e02b2c3d479");
using Corti.Documents;
using Corti;
var client = new CortiClient(
"TENANT_NAME",
CortiClientEnvironment.Eu,
new CortiClientAuth.ClientCredentials("client_id", "client_secret")
);
await client.Documents.Classic.UpdateAsync(
"f47ac10b-58cc-4372-a567-0e02b2c3d479",
"f47ac10b-58cc-4372-a567-0e02b2c3d479",
new DocumentsUpdateRequest()
);
import requests
url = "https://api.{environment}.corti.app/v2/interactions/{id}/documents/{documentId}"
payload = {
"name": "<string>",
"sections": [
{
"key": "<string>",
"name": "<string>",
"text": "<string>",
"sort": 123
}
]
}
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/interactions/{id}/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>',
'sections' => [
[
'key' => '<string>',
'name' => '<string>',
'text' => '<string>',
'sort' => 123
]
]
]),
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/interactions/{id}/documents/{documentId}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"sections\": [\n {\n \"key\": \"<string>\",\n \"name\": \"<string>\",\n \"text\": \"<string>\",\n \"sort\": 123\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/interactions/{id}/documents/{documentId}")
.header("Tenant-Name", "<tenant-name>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"sections\": [\n {\n \"key\": \"<string>\",\n \"name\": \"<string>\",\n \"text\": \"<string>\",\n \"sort\": 123\n }\n ]\n}")
.asString();{
"id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"name": "<string>",
"templateRef": "<string>",
"isStream": true,
"sections": [
{
"key": "<string>",
"name": "<string>",
"text": "<string>",
"sort": 123,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"outputLanguage": "<string>",
"usageInfo": {
"creditsConsumed": 123
}
}{
"requestid": "<string>",
"status": 123,
"type": "<string>",
"detail": "<string>",
"validationErrors": [
{}
]
}{
"requestid": "<string>",
"status": 123,
"type": "<string>",
"detail": "<string>",
"validationErrors": [
{}
]
}{
"requestid": "<string>",
"status": 123,
"type": "<string>",
"detail": "<string>",
"validationErrors": [
{}
]
}{
"requestid": "<string>",
"status": 123,
"type": "<string>",
"detail": "<string>",
"validationErrors": [
{}
]
}Headers
Path Parameters
Body
application/json
Response
The language in which the document will be generated. Check https://docs.corti.ai/stt/languages for more.
Was this page helpful?