POST
/
interactions
/
{id}
/
documents
curl --request POST \
  --url https://api.{environment}.corti.app/v2/interactions/{id}/documents \
  --header 'Content-Type: application/json' \
  --data '{
  "context": [
    {
      "type": "facts",
      "data": [
        {
          "text": "<string>",
          "group": "Others",
          "source": "core"
        }
      ]
    }
  ],
  "templateId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "templateKey": "<string>",
  "template": {
    "sectionIds": [
      "3c90c3cc-0d44-4b50-8888-8dd25736052a"
    ],
    "sectionKeys": [
      "<string>"
    ],
    "documentName": "<string>",
    "additionalInstructions": "<string>"
  },
  "name": "<string>",
  "modelName": "\"model_name (Latest)\" | \"model_name_version\"",
  "outputLanguage": "<string>"
}'

Headers

Tenant-Name
string

Path Parameters

id
string
required

The interaction ID representing the context for the request.

Query Parameters

stream
boolean

If true the response happens via SSE sending back a full valid JSON always, however, the content within text may be incomplete.

Body

application/json
context
object[]
required

An array of context objects.

templateId
string
required

The ID of the template that informs on what kind of document is to be generated.

templateKey
string
required

The key of the template that informs on what kind of document is to be generated.

outputLanguage
string
required

The language in which the document will be generated. (BCP-47)

template
object

Template details if the template should be generated during the request. Overrides templateId.

name
string

An optional name for the document.

modelName
string

Response

201 - application/json
id
string

Unique ID of the generated document

name
string

Name of the generated document

templateRef
string

Reference for the used template

isStream
boolean
sections
object[]

Individual document sections