> ## Documentation Index
> Fetch the complete documentation index at: https://docs.enneo.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Complete call and store transcript

> Called when a call is completed to store the final transcript and call details



## OpenAPI

````yaml https://dev.enneo.dev/api/mind/docs/open-api post /telephony/callCompleted
openapi: 3.0.0
info:
  version: '1'
  title: enneo.MIND API
  description: This describes the API of enneo Mind, the main ticketing backend
  contact:
    name: enneo GmbH
    email: richard@enneo.ai
  license:
    name: Proprietary software
    url: https://enneo.ai
servers:
  - url: https://demo.enneo.ai/api/mind
    description: Production server, demo client
  - url: https://main.enneo.dev/api/mind
    description: Development main branch
  - url: http://localhost:8005/api/mind
    description: Local development server
security:
  - bearerAuth:
      - api
  - cookieAuth:
      - api
paths:
  /telephony/callCompleted:
    post:
      tags:
        - Telephony
      summary: Complete call and store transcript
      description: >-
        Called when a call is completed to store the final transcript and call
        details
      operationId: completeCall
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                ticketId:
                  type: integer
                  description: >-
                    Optional ticket id of the enneo call ticket. If provided,
                    the transcript will be attached to the given ticket id
                  nullable: true
                  example: 123
                channelId:
                  type: string
                  description: >-
                    Unique identifier of a third party system of this call. If a
                    channelId was provided during a previous /agentConnected api
                    call, the transcript will be appended to the corresponding
                    ticket
                  example: call_123abc456
                transcript:
                  type: array
                  description: Complete transcript of the call
                  items:
                    $ref: '#/components/schemas/Transcript'
                duration:
                  type: integer
                  description: 'DEPRECATED: Use totalDurationSeconds instead'
                  nullable: true
                  example: 300
                totalDurationSeconds:
                  type: integer
                  description: Total call duration from start to end in seconds
                  nullable: true
                  example: 300
                botDurationSeconds:
                  type: integer
                  description: >-
                    Duration spent with the voice bot (automated conversation)
                    in seconds
                  nullable: true
                  example: 45
                queueDurationSeconds:
                  type: integer
                  description: Duration spent waiting in queue for an agent in seconds
                  nullable: true
                  example: 30
                humanDurationSeconds:
                  type: integer
                  description: Duration spent talking with a human agent in seconds
                  nullable: true
                  example: 225
              required:
                - channelId
                - transcript
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Success'
        '400':
          description: Invalid input
        '404':
          description: Ticket not found
        '500':
          description: Internal error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Transcript:
      type: object
      description: A single entry in a conversation transcript
      required:
        - speaker
        - message
      properties:
        speaker:
          type: string
          description: >
            Who spoke this message. Determines conversation direction and type:

            - 'customer': Customer/caller message (direction=in, type=text)

            - 'agent': Bot/assistant message (direction=out, type=text)

            - 'agent_request': AI agent tool call request (direction=internal,
            type=agent_request)

            - 'agent_response': AI agent tool call response (direction=internal,
            type=agent_response)
          enum:
            - customer
            - agent
            - agent_request
            - agent_response
          example: customer
        message:
          type: string
          description: The actual message that was spoken
          example: Hello, my name is AI Assistant. How can I help you today?
        timestamp:
          type: string
          format: date-time
          description: When this message was spoken
          nullable: true
          example: '2024-01-23T14:32:11Z'
      example:
        speaker: agent
        message: Hello, my name is AI Assistant. How can I help you today?
        timestamp: '2024-01-23T14:32:11Z'
    Success:
      type: object
      description: Data format of Enneo success messages
      properties:
        success:
          type: boolean
          example: true
          description: Operation was successful
    Error:
      type: object
      description: Data format of Enneo error messages
      properties:
        error:
          type: string
          example: Contract 121 could not be processed
          description: Readable error message that should be shown to the user
        details:
          type: string
          example: >-
            Uncatched null point exception in testFunction() in
            /app/src/file:212
          description: Not easily readable error message that is for the developer
        txId:
          type: string
          example: c916167c94
          description: >-
            Internal transaction id. Useful for debugging. Corresponds to the
            OpenTelemetry trace ID.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: JWT-based authentication
      x-scopes:
        api: Full access to the API
    cookieAuth:
      type: apiKey
      in: cookie
      name: connect.sid
      description: Cookie-based authentication
      x-scopes:
        api: Full access to the API

````