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

# Upload and parse a transcript file

> Upload a single transcript file for parsing and content extraction. This is the second step
in the three-step workflow.

The file is streamed directly to Redis via the streamUpload middleware, then:
1. Read back from Redis
2. Parsed based on file type (PDF, CSV, DOCX)
3. Analyzed for speaker labels (Agent/Customer)
4. Stored as structured data in Redis (keyed by requestId)

Multiple files can be uploaded by calling this endpoint multiple times with the same requestId.
The generate endpoint retrieves all files for the request by requestId.




## OpenAPI

````yaml https://api-trial.cognigy.ai/testing/openapi/openapi-viewer.json post /v1/transcript-upload
openapi: 3.0.0
info:
  title: SIMULATOR OPENAPI REST-ful-API Reference
  version: 2025.20.0
  description: >

    ### Introduction

    This is the [OpenAPI 3.0](https://swagger.io/specification/) documentation

    of the
    [REST](https://en.wikipedia.org/wiki/Representational_state_transfer)-ful
    SIMULATOR OPENAPI API.


    ### Cross-Origin Resource Sharing

    This API features Cross-Origin Resource Sharing (CORS) implemented in

    compliance with [W3C spec](https://www.w3.org/TR/cors/), which allows

    cross-domain communication from the browser. All responses have a wildcard

    same-origin header which makes the API completely accessible.


    ### Authentication

    SIMULATOR OPENAPI offers following forms of authentication:

    - Bearer Token (JWT)

    - API Key


    ### Error Handling

    This API uses HTTP status codes equal or above 400 to indicate errors. Error

    details are generated in compliance with [RFC 7807 - "Problem Details for
    HTTP APIs"](https://tools.ietf.org/html/rfc7807).


    Every error response contains a traceId, which should be provided to the
    SIMULATOR OPENAPI Technical Support when reporting an error.
  contact:
    name: Cognigy Technical Support
    url: https://www.cognigy.com
    email: support@cognigy.com
  license:
    name: Cognigy Proprietary License
servers:
  - url: https://api-trial.cognigy.ai/testing
    description: Cognigy Service Testing API
security:
  - bearerAuth: []
  - apiKeyAuth: []
tags:
  - name: Simulations
    description: >-
      Simulation management operations - Create, read, update, and delete
      simulations
externalDocs:
  description: SIMULATOR OPENAPI Documentation
  url: https://docs.cognigy.com/docs/service-testing/
paths:
  /v1/transcript-upload:
    post:
      tags:
        - Transcript Scenario Generation
      summary: Upload and parse a transcript file
      description: >
        Upload a single transcript file for parsing and content extraction. This
        is the second step

        in the three-step workflow.


        The file is streamed directly to Redis via the streamUpload middleware,
        then:

        1. Read back from Redis

        2. Parsed based on file type (PDF, CSV, DOCX)

        3. Analyzed for speaker labels (Agent/Customer)

        4. Stored as structured data in Redis (keyed by requestId)


        Multiple files can be uploaded by calling this endpoint multiple times
        with the same requestId.

        The generate endpoint retrieves all files for the request by requestId.
      operationId: uploadTranscriptFile
      parameters:
        - name: projectId
          in: query
          required: false
          schema:
            type: string
          description: Project identifier
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                requestId:
                  type: string
                  description: Request ID from the create-request step
                projectId:
                  type: string
                  description: Project identifier
                file:
                  type: string
                  format: binary
                  description: Transcript file (CSV)
              required:
                - requestId
                - file
      responses:
        '200':
          description: File uploaded and parsed successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  fileId:
                    type: string
                    description: Unique file identifier
                  fileName:
                    type: string
                    description: Original file name
                  fileSize:
                    type: integer
                    description: File size in bytes
                  fileType:
                    type: string
                    enum:
                      - csv
                    description: Detected file type
                  textLength:
                    type: integer
                    description: Length of extracted text content
                  processedAt:
                    type: string
                    format: date-time
                  expiresAt:
                    type: string
                    format: date-time
                    description: >
                      When the owning request - and therefore this stored
                      transcript - expires. The file is

                      stored with the request's remaining TTL, so a file never
                      outlives its request: after

                      this instant the requestId is gone and generation answers
                      404.
                required:
                  - success
                  - fileId
                  - fileName
                  - fileSize
                  - fileType
                  - textLength
                  - processedAt
                  - expiresAt
              example:
                success: true
                fileId: f1e2d3c4-b5a6-7890-fedc-ba0987654321
                fileName: customer_support_call.csv
                fileSize: 245678
                fileType: csv
                textLength: 2450
                processedAt: '2026-08-26T14:30:00.000Z'
                expiresAt: '2026-08-26T14:38:20.000Z'
        '400':
          description: >
            Bad Request. `code` is the machine-readable reason:
            `UNSUPPORTED_FILE_TYPE`,

            `EMPTY_TRANSCRIPT`, `MISSING_SPEAKER_LABELS`, or
            `MAX_FILES_EXCEEDED`.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: HTTP status text
                  detail:
                    type: string
                    description: Human-readable reason
                  code:
                    type: string
                  traceId:
                    type: string
                  maxFiles:
                    type: integer
                    description: Present on MAX_FILES_EXCEEDED
                  supportedMimeTypes:
                    type: array
                    items:
                      type: string
                    description: Present on UNSUPPORTED_FILE_TYPE
                required:
                  - error
                  - detail
                  - code
                  - traceId
              examples:
                maxFilesExceeded:
                  value:
                    error: Bad Request
                    detail: >-
                      Maximum of 10 files per request reached. Please create a
                      new request to upload more files.
                    code: MAX_FILES_EXCEEDED
                    traceId: service-testing-8f3c1e2a-7b44-4c90-9d21-6ac5f0b1e773
                    maxFiles: 10
                unsupportedType:
                  value:
                    error: Bad Request
                    detail: >-
                      Unsupported file type 'text/plain'. Supported types:
                      text/csv
                    code: UNSUPPORTED_FILE_TYPE
                    traceId: service-testing-8f3c1e2a-7b44-4c90-9d21-6ac5f0b1e773
                    supportedMimeTypes:
                      - text/csv
                noSpeakerLabels:
                  value:
                    error: Bad Request
                    detail: >-
                      Speaker labels not detected. All transcripts must contain
                      clear Agent/Customer speaker labels. For CSV files, use a
                      three-column format with headers 'speaker', 'message', and
                      'created_at'.
                    code: MISSING_SPEAKER_LABELS
                    traceId: service-testing-8f3c1e2a-7b44-4c90-9d21-6ac5f0b1e773
                missingFile:
                  summary: >-
                    Answered by the controller before the use case runs, in a
                    thinner envelope
                  value:
                    error: >-
                      No file was uploaded. Please include a file in the
                      request.
        '401':
          description: Unauthorized
        '403':
          description: Forbidden - Insufficient permissions
        '404':
          description: Not Found - the requestId is unknown or its TTL has elapsed.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  detail:
                    type: string
                  code:
                    type: string
                  traceId:
                    type: string
                required:
                  - error
                  - detail
                  - code
                  - traceId
              example:
                error: Not Found
                detail: >-
                  Transcript request not found or has expired. Please create a
                  new request.
                code: TRANSCRIPT_REQUEST_NOT_FOUND
                traceId: service-testing-8f3c1e2a-7b44-4c90-9d21-6ac5f0b1e773
        '413':
          description: Payload Too Large - File exceeds maximum size
        '500':
          description: >
            The staged upload could not be read back from temporary storage. The
            staged bytes are

            discarded, so the upload must be retried from the beginning; the
            request itself is unaffected

            and keeps its remaining TTL.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  detail:
                    type: string
                  code:
                    type: string
                  traceId:
                    type: string
                required:
                  - error
                  - detail
                  - code
                  - traceId
              example:
                error: Internal Server Error
                detail: >-
                  The uploaded file could not be read from temporary storage.
                  Please upload the file again.
                code: UPLOAD_STORAGE_READ_FAILED
                traceId: service-testing-8f3c1e2a-7b44-4c90-9d21-6ac5f0b1e773
      security:
        - bearerAuth: []
        - apiKeyAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: JWT Bearer Token for authentication
    apiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: API Key for authentication

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.