cURL
curl --request GET \
--url https://api.{environment}.corti.app/v2/documents/templates/{templateID} \
--header 'Authorization: Bearer <token>' \
--header 'Tenant-Name: <tenant-name>'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.get("templateID");
using Corti;
var client = new CortiClient(
"TENANT_NAME",
CortiClientEnvironment.Eu,
new CortiClientAuth.ClientCredentials("client_id", "client_secret")
);
await client.Documents.Templates.GetAsync("templateID");
import requests
url = "https://api.{environment}.corti.app/v2/documents/templates/{templateID}"
headers = {
"Tenant-Name": "<tenant-name>",
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.{environment}.corti.app/v2/documents/templates/{templateID}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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"
"net/http"
"io"
)
func main() {
url := "https://api.{environment}.corti.app/v2/documents/templates/{templateID}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Tenant-Name", "<tenant-name>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.{environment}.corti.app/v2/documents/templates/{templateID}")
.header("Tenant-Name", "<tenant-name>")
.header("Authorization", "Bearer <token>")
.asString();{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"languages": [
"<string>"
],
"regions": [
"<string>"
],
"specialties": [
"<string>"
],
"labels": [
{
"key": "<string>",
"value": "<string>"
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"inheritedFromId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"autoGenerated": true,
"source": "user",
"description": "<string>",
"createdBy": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"deletedAt": "2023-11-07T05:31:56Z",
"publishedVersion": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"versionNumber": 123,
"generation": {
"instructions": {
"prompt": "<string>"
},
"sections": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"languages": [
"<string>"
],
"regions": [
"<string>"
],
"specialties": [
"<string>"
],
"labels": [
{
"key": "<string>",
"value": "<string>"
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"inheritedFromId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"autoGenerated": true,
"source": "user",
"description": "<string>",
"createdBy": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"deletedAt": "2023-11-07T05:31:56Z",
"publishedVersion": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"versionNumber": 123,
"generation": {
"heading": "<string>",
"instructions": {
"contentPrompt": "<string>",
"writingStylePrompt": "<string>",
"miscPrompt": "<string>"
},
"outputSchema": {
"type": "string",
"description": "<string>",
"default": "<string>",
"enum": [
"<string>"
],
"pattern": "<string>"
}
},
"deletedAt": "2023-11-07T05:31:56Z"
}
}
]
},
"deletedAt": "2023-11-07T05:31:56Z"
}
}{
"requestid": "<string>",
"status": 123,
"type": "<string>",
"detail": "<string>",
"validationErrors": [
{}
]
}Guided Templates
Get template
Returns the template with its published version fully resolved (inheritance walked, sections expanded with their own inheritance applied). To see raw authored values without inheritance, use GET /documents/templates/:id/versions/:id .
GET
/
documents
/
templates
/
{templateID}
cURL
curl --request GET \
--url https://api.{environment}.corti.app/v2/documents/templates/{templateID} \
--header 'Authorization: Bearer <token>' \
--header 'Tenant-Name: <tenant-name>'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.get("templateID");
using Corti;
var client = new CortiClient(
"TENANT_NAME",
CortiClientEnvironment.Eu,
new CortiClientAuth.ClientCredentials("client_id", "client_secret")
);
await client.Documents.Templates.GetAsync("templateID");
import requests
url = "https://api.{environment}.corti.app/v2/documents/templates/{templateID}"
headers = {
"Tenant-Name": "<tenant-name>",
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.{environment}.corti.app/v2/documents/templates/{templateID}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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"
"net/http"
"io"
)
func main() {
url := "https://api.{environment}.corti.app/v2/documents/templates/{templateID}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Tenant-Name", "<tenant-name>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.{environment}.corti.app/v2/documents/templates/{templateID}")
.header("Tenant-Name", "<tenant-name>")
.header("Authorization", "Bearer <token>")
.asString();{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"languages": [
"<string>"
],
"regions": [
"<string>"
],
"specialties": [
"<string>"
],
"labels": [
{
"key": "<string>",
"value": "<string>"
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"inheritedFromId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"autoGenerated": true,
"source": "user",
"description": "<string>",
"createdBy": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"deletedAt": "2023-11-07T05:31:56Z",
"publishedVersion": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"versionNumber": 123,
"generation": {
"instructions": {
"prompt": "<string>"
},
"sections": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"languages": [
"<string>"
],
"regions": [
"<string>"
],
"specialties": [
"<string>"
],
"labels": [
{
"key": "<string>",
"value": "<string>"
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"inheritedFromId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"autoGenerated": true,
"source": "user",
"description": "<string>",
"createdBy": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"deletedAt": "2023-11-07T05:31:56Z",
"publishedVersion": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"versionNumber": 123,
"generation": {
"heading": "<string>",
"instructions": {
"contentPrompt": "<string>",
"writingStylePrompt": "<string>",
"miscPrompt": "<string>"
},
"outputSchema": {
"type": "string",
"description": "<string>",
"default": "<string>",
"enum": [
"<string>"
],
"pattern": "<string>"
}
},
"deletedAt": "2023-11-07T05:31:56Z"
}
}
]
},
"deletedAt": "2023-11-07T05:31:56Z"
}
}{
"requestid": "<string>",
"status": 123,
"type": "<string>",
"detail": "<string>",
"validationErrors": [
{}
]
}Headers
Response
OK
Template as returned by single-resource endpoints (GET, POST, PATCH on
/documents/templates/{templateID}). Extends GuidedTemplateListItem with the resolved
publishedVersion.
Was this page helpful?