> ## 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.

# Create template version

> Creates a new template version. Returns raw authored values without inheritance resolution or section expansion.



## OpenAPI

````yaml /api-reference/auto-generated-openapi.yml post /documents/templates/{templateID}/versions/
openapi: 3.0.0
info:
  title: Corti API
  version: 2.0.0
servers:
  - url: https://api.{environment}.corti.app/v2/
    variables:
      environment:
        default: eu
        enum:
          - us
          - eu
security:
  - AuthorizationHeader:
      - bearer
tags:
  - name: Interactions
  - name: Recordings
  - name: Transcripts
  - name: Facts
  - name: Codes
  - name: Languages
  - name: Guided Documents
  - name: Guided Templates
  - name: Guided Sections
  - name: Documents (Classic)
  - name: Templates (Classic)
paths:
  /documents/templates/{templateID}/versions/:
    parameters:
      - $ref: '#/components/parameters/Tenant-Name'
      - $ref: '#/components/parameters/GuidedTemplateId'
    post:
      tags:
        - Guided Templates
      summary: Create template version
      description: >-
        Creates a new template version. Returns raw authored values without
        inheritance resolution or section expansion.
      operationId: guided_templates_versions_create
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GuidedTemplatesCreateVersionRequest'
      responses:
        '201':
          description: Created — returns shallow (unresolved) template version
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GuidedShallowTemplateVersionResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/NotFound'
      x-codeSamples:
        - lang: csharp
          label: C# .NET SDK
          source: |
            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() }
            );
        - lang: javascript
          label: JavaScript SDK
          source: |
            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: {}
            });
components:
  parameters:
    Tenant-Name:
      name: Tenant-Name
      in: header
      description: >-
        Identifies a distinct entity within Corti's multi-tenant system. Ensures
        correct routing and authentication of the request.
      required: true
      example: base
      schema:
        type: string
        description: >-
          Identifies a distinct entity within Corti's multi-tenant system.
          Ensures correct routing and authentication of the request.
        example: base
    GuidedTemplateId:
      name: templateID
      in: path
      required: true
      schema:
        type: string
        format: uuid
  schemas:
    GuidedTemplatesCreateVersionRequest:
      type: object
      required:
        - generation
      properties:
        generation:
          $ref: '#/components/schemas/GuidedTemplatesVersionGeneration'
    GuidedShallowTemplateVersionResponse:
      type: object
      description: >
        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.
      required:
        - id
        - versionNumber
        - generation
      properties:
        id:
          description: The UUID of the version.
          type: string
          format: uuid
        versionNumber:
          description: Starts at 0 and auto-increments.
          type: integer
        deletedAt:
          description: Present when the template version has been deleted.
          type: string
          format: date-time
          nullable: true
        generation:
          $ref: '#/components/schemas/GuidedShallowTemplateGeneration'
    GuidedTemplatesVersionGeneration:
      type: object
      description: >-
        When the template inherits from another template, all inner fields are
        optional. Any field omitted is inherited from the parent's published
        version.
      properties:
        instructions:
          $ref: '#/components/schemas/GuidedTemplateInstructionsPartial'
        sections:
          type: array
          items:
            $ref: '#/components/schemas/GuidedTemplatesVersionSectionRequest'
    GuidedShallowTemplateGeneration:
      type: object
      description: >-
        Template generation with section references (not fully resolved). Use
        the resolved GuidedTemplateGeneration for hydrated section data.
      required:
        - instructions
        - sections
      properties:
        instructions:
          $ref: '#/components/schemas/GuidedTemplateInstructions'
        sections:
          description: Section references linked to this version (not fully resolved).
          type: array
          items:
            $ref: '#/components/schemas/GuidedTemplateVersionSectionRef'
    ErrorResponse:
      type: object
      required:
        - requestid
        - status
        - type
        - detail
      properties:
        requestid:
          type: string
        status:
          type: integer
        type:
          type: string
        detail:
          type: string
        validationErrors:
          type: array
          items:
            type: object
            additionalProperties:
              type: string
    GuidedTemplateInstructionsPartial:
      type: object
      description: >-
        Partial form of GuidedTemplateInstructions used when inheriting from
        another template. Any field omitted is inherited.
      properties:
        prompt:
          type: string
          description: Override the inherited template-level prompt instructions.
    GuidedTemplatesVersionSectionRequest:
      type: object
      required:
        - sectionId
      properties:
        sectionId:
          type: string
          format: uuid
          description: The UUID of the section to include in the template version.
        orderIndex:
          type: integer
          description: Sets the order of this section within this template. Starts at 0.
    GuidedTemplateInstructions:
      type: object
      required:
        - prompt
      properties:
        prompt:
          type: string
          description: >-
            Template-level prompt instructions that apply generally to all
            sections.
    GuidedTemplateVersionSectionRef:
      type: object
      required:
        - sectionId
        - orderIndex
      properties:
        sectionId:
          description: The UUID of the section linked to this template version.
          type: string
          format: uuid
        orderIndex:
          description: The ordering position of the section within the template version.
          type: integer
  responses:
    BadRequest:
      description: Bad Request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    NotFound:
      description: Not Found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    AuthorizationHeader:
      type: http
      description: Input your token
      scheme: bearer

````