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

# Update Document



## OpenAPI

````yaml /api-reference/auto-generated-openapi.yml patch /interactions/{id}/documents/{documentId}
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: Facts
  - name: Documents
  - name: Codes
  - name: Recordings
  - name: Transcripts
paths:
  /interactions/{id}/documents/{documentId}:
    patch:
      tags:
        - Documents
      summary: Update Document
      operationId: documents_update
      parameters:
        - $ref: '#/components/parameters/Tenant-Name'
        - $ref: '#/components/parameters/CommonInteractionId'
        - name: documentId
          in: path
          description: >-
            The document ID representing the context for the request. Must be a
            valid UUID.
          required: true
          schema:
            $ref: '#/components/schemas/UUID'
            format: uuid
            type: string
            description: >-
              The document ID representing the context for the request. Must be
              a valid UUID.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DocumentsUpdateRequest'
        required: true
      responses:
        '200':
          description: ' '
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentsGetResponse'
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: RFC9457
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: RFC9457
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: RFC9457
        '504':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: RFC9457
      x-codeSamples:
        - lang: csharp
          label: C# .NET SDK
          source: |
            using Corti;

            var client = new CortiClient(
                "TENANT_NAME",
                CortiClientEnvironment.Eu,
                new CortiClientAuth.ClientCredentials("client_id", "client_secret")
            );
            await client.Documents.UpdateAsync(
                "f47ac10b-58cc-4372-a567-0e02b2c3d479",
                "f47ac10b-58cc-4372-a567-0e02b2c3d479",
                new DocumentsUpdateRequest()
            );
        - 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.update("f47ac10b-58cc-4372-a567-0e02b2c3d479",
            "f47ac10b-58cc-4372-a567-0e02b2c3d479");
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
    CommonInteractionId:
      name: id
      in: path
      description: The unique identifier of the interaction. Must be a valid UUID.
      required: true
      schema:
        $ref: '#/components/schemas/UUID'
  schemas:
    UUID:
      type: string
      items: {}
      format: uuid
      example: f47ac10b-58cc-4372-a567-0e02b2c3d479
    DocumentsUpdateRequest:
      type: object
      properties:
        name:
          type: string
          description: An optional name for the document.
        sections:
          type: array
          items:
            $ref: '#/components/schemas/DocumentsSectionInput'
    DocumentsGetResponse:
      type: object
      required:
        - id
        - name
        - templateRef
        - isStream
        - sections
        - createdAt
        - updatedAt
        - outputLanguage
        - usageInfo
      properties:
        id:
          $ref: '#/components/schemas/UUID'
          type: string
          format: uuid
          description: Unique ID of the generated document
        name:
          type: string
          description: Name of the generated document
        templateRef:
          type: string
          description: Reference for the used template
        isStream:
          type: boolean
        sections:
          type: array
          description: Individual document sections
          items:
            $ref: '#/components/schemas/DocumentsSection'
        createdAt:
          type: string
          format: date-time
          description: The original timestamp when the document was created.
        updatedAt:
          type: string
          format: date-time
          description: The timestamp when the document was last updated.
        outputLanguage:
          type: string
          description: >-
            The language in which the document will be generated. Check
            https://docs.corti.ai/about/languages for more.
        usageInfo:
          $ref: '#/components/schemas/CommonUsageInfo'
          type: object
    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
    DocumentsSectionInput:
      type: object
      required:
        - key
      properties:
        key:
          type: string
        name:
          type: string
        text:
          type: string
        sort:
          type: integer
    DocumentsSection:
      type: object
      required:
        - key
        - name
        - text
        - sort
        - createdAt
        - updatedAt
      properties:
        key:
          type: string
          description: Document section key
        name:
          type: string
          description: >-
            Name or heading of the document section within the generated
            document
        text:
          type: string
          description: Contents of the document section within the generated document
        sort:
          type: integer
          description: Order of the document section within the generated document
        createdAt:
          type: string
          format: date-time
          description: The original timestamp when the document section was created.
        updatedAt:
          type: string
          format: date-time
          description: The timestamp when the document section was last updated.
    CommonUsageInfo:
      type: object
      description: Credits consumed for this request.
      required:
        - creditsConsumed
      properties:
        creditsConsumed:
          type: number
  securitySchemes:
    AuthorizationHeader:
      type: http
      description: Input your token
      scheme: bearer

````