cURL
curl --request POST \
--url https://api.{environment}.corti.app/v2/documents/templates/{templateID}/versions/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Tenant-Name: <tenant-name>' \
--data '
{
"generation": {
"instructions": {
"prompt": "<string>"
},
"sections": [
{
"sectionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"orderIndex": 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.templates.versions.create("templateID", {
generation: {}
});
using Corti.Documents.Templates;
using Corti;
var client = new CortiClient(
"TENANT_NAME",
CortiClientEnvironment.Eu,
new CortiClientAuth.ClientCredentials("client_id", "client_secret")
);
await client.Documents.Templates.Versions.CreateAsync(
"templateID",
new GuidedTemplatesCreateVersionRequest { Generation = new GuidedTemplatesVersionGeneration() }
);
import requests
url = "https://api.{environment}.corti.app/v2/documents/templates/{templateID}/versions/"
payload = { "generation": {
"instructions": { "prompt": "<string>" },
"sections": [
{
"sectionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"orderIndex": 123
}
]
} }
headers = {
"Tenant-Name": "<tenant-name>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(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/templates/{templateID}/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([
'generation' => [
'instructions' => [
'prompt' => '<string>'
],
'sections' => [
[
'sectionId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'orderIndex' => 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/documents/templates/{templateID}/versions/"
payload := strings.NewReader("{\n \"generation\": {\n \"instructions\": {\n \"prompt\": \"<string>\"\n },\n \"sections\": [\n {\n \"sectionId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"orderIndex\": 123\n }\n ]\n }\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.{environment}.corti.app/v2/documents/templates/{templateID}/versions/")
.header("Tenant-Name", "<tenant-name>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"generation\": {\n \"instructions\": {\n \"prompt\": \"<string>\"\n },\n \"sections\": [\n {\n \"sectionId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"orderIndex\": 123\n }\n ]\n }\n}")
.asString();{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"versionNumber": 123,
"generation": {
"instructions": {
"prompt": "<string>"
},
"sections": [
{
"sectionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"orderIndex": 123
}
]
},
"deletedAt": "2023-11-07T05:31:56Z"
}{
"requestid": "<string>",
"status": 123,
"type": "<string>",
"detail": "<string>",
"validationErrors": [
{}
]
}{
"requestid": "<string>",
"status": 123,
"type": "<string>",
"detail": "<string>",
"validationErrors": [
{}
]
}Guided Templates
Create template version
Creates a new template version. Returns raw authored values without inheritance resolution or section expansion.
POST
/
documents
/
templates
/
{templateID}
/
versions
/
cURL
curl --request POST \
--url https://api.{environment}.corti.app/v2/documents/templates/{templateID}/versions/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Tenant-Name: <tenant-name>' \
--data '
{
"generation": {
"instructions": {
"prompt": "<string>"
},
"sections": [
{
"sectionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"orderIndex": 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.templates.versions.create("templateID", {
generation: {}
});
using Corti.Documents.Templates;
using Corti;
var client = new CortiClient(
"TENANT_NAME",
CortiClientEnvironment.Eu,
new CortiClientAuth.ClientCredentials("client_id", "client_secret")
);
await client.Documents.Templates.Versions.CreateAsync(
"templateID",
new GuidedTemplatesCreateVersionRequest { Generation = new GuidedTemplatesVersionGeneration() }
);
import requests
url = "https://api.{environment}.corti.app/v2/documents/templates/{templateID}/versions/"
payload = { "generation": {
"instructions": { "prompt": "<string>" },
"sections": [
{
"sectionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"orderIndex": 123
}
]
} }
headers = {
"Tenant-Name": "<tenant-name>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(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/templates/{templateID}/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([
'generation' => [
'instructions' => [
'prompt' => '<string>'
],
'sections' => [
[
'sectionId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'orderIndex' => 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/documents/templates/{templateID}/versions/"
payload := strings.NewReader("{\n \"generation\": {\n \"instructions\": {\n \"prompt\": \"<string>\"\n },\n \"sections\": [\n {\n \"sectionId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"orderIndex\": 123\n }\n ]\n }\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.{environment}.corti.app/v2/documents/templates/{templateID}/versions/")
.header("Tenant-Name", "<tenant-name>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"generation\": {\n \"instructions\": {\n \"prompt\": \"<string>\"\n },\n \"sections\": [\n {\n \"sectionId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"orderIndex\": 123\n }\n ]\n }\n}")
.asString();{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"versionNumber": 123,
"generation": {
"instructions": {
"prompt": "<string>"
},
"sections": [
{
"sectionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"orderIndex": 123
}
]
},
"deletedAt": "2023-11-07T05:31:56Z"
}{
"requestid": "<string>",
"status": 123,
"type": "<string>",
"detail": "<string>",
"validationErrors": [
{}
]
}{
"requestid": "<string>",
"status": 123,
"type": "<string>",
"detail": "<string>",
"validationErrors": [
{}
]
}Headers
Body
application/json
Response
Created — returns shallow (unresolved) template version
Template version with raw authored values — no inheritance resolution applied. Sections are returned as references (IDs), not fully resolved objects. Use this to inspect what was explicitly set on this version versus inherited. Returned by GET, LIST, and POST version endpoints.
Was this page helpful?