Skip to main content
POST
/
documents
cURL
curl --request POST \
  --url https://api.{environment}.corti.app/v2/documents/ \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'Tenant-Name: <tenant-name>' \
  --data '
{
  "outputLanguage": "<string>",
  "templateRef": {
    "templateId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "templateVersionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "overrides": {
      "sections": [
        {
          "sectionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "generation": {
            "heading": "<string>",
            "instructions": {
              "contentPrompt": "<string>",
              "writingStylePrompt": "<string>",
              "miscPrompt": "<string>"
            },
            "outputSchema": {
              "description": "<string>",
              "default": "<string>",
              "enum": [
                "<string>"
              ],
              "pattern": "<string>"
            }
          }
        }
      ]
    }
  },
  "context": [
    {
      "text": "<string>"
    }
  ],
  "interactionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'
{
  "document": {
    "name": "<string>",
    "templateId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "templateVersionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "language": "<string>",
    "stringDocument": {},
    "structuredDocument": {}
  },
  "usageInfo": {
    "creditsConsumed": 123
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.corti.ai/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

Input your token

Headers

Tenant-Name
string
required

Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request.

Example:

"base"

X-Corti-Retention-Policy
enum<string>

Pass the optional X-Corti-Retention-Policy: none header to generate and return the document without saving it to the database. The response will be 200 with EphemeralDocumentResponse. Without the header the document is saved and the response is 201 with CreateDocumentResponse.

Available options:
none

Body

application/json

Generate a document using a stored template. Optionally supply runtime overrides to patch instructions or sections without mutating the base template. At least one of context or interactionId must be supplied as input context for the model.

outputLanguage
string
required

The language in which the document will be generated as a BCP 47 tag.

templateRef
object
required

Reference an existing stored template, optionally with overrides.

context
(ContextText · object | ContextTranscript · object | ContextFacts · object)[]

Ordered list of context items the model reasons over. Each item is one of text, a transcript (with optional metadata and segments), or a single fact. Items are interleaved by timestamps where present on transcript segments; otherwise array order is preserved.

A freeform text snippet provided as input context to the model.

interactionId
string<uuid>

When supplied, all facts and transcripts already attached to the referenced interaction are passed implicitly as input context. Facts with isDiscarded: true are not passed on.

Response

OK — document was generated but not saved (retention policy none).

Response when a document is generated but not saved (retention policy none).

document
object
required

A generated document that was not saved to the database.

usageInfo
object
required

Credits consumed for this request.