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

# Create transcription record

> Creates a new transcription record for audio-to-text conversion from patient-doctor conversations. This is the first step in the clinical documentation workflow - stores the raw transcription from a doctor-patient conversation before AI processing.




## OpenAPI

````yaml /openapi/openapi.yaml post /v1/transcriptions/create
openapi: 3.0.3
info:
  title: Sofia Clinical Documentation API
  version: 1.0.0
  description: >
    Comprehensive AI-powered clinical documentation platform that includes
    ICD-10 medical coding, transcription management, AI conversation threads,
    and clinical note generation with support for various clinical templates
    (SOAP, BIRP, etc.).
servers:
  - url: https://{your-prod-endpoint}
    description: Production (provided after deployment)
  - url: https://{your-dev-endpoint}
    description: Development (provided upon request)
security:
  - bearerAuth: []
paths:
  /v1/transcriptions/create:
    post:
      summary: Create transcription record
      description: >
        Creates a new transcription record for audio-to-text conversion from
        patient-doctor conversations. This is the first step in the clinical
        documentation workflow - stores the raw transcription from a
        doctor-patient conversation before AI processing.
      operationId: createTranscription
      parameters:
        - in: header
          name: x-doctor
          schema:
            type: string
          required: true
          description: Doctor identifier for tracking and auditing
          example: dr_123
        - in: header
          name: x-patient
          schema:
            type: string
          required: false
          description: Patient identifier for tracking and auditing
          example: pt_456
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TranscriptionCreateRequest'
            example:
              duration_seconds: 180
              original_transcript: >-
                The patient is a 45-year-old male presenting with chest pain
                radiating to left arm for the past 2 hours...
              language_used: en
      responses:
        '201':
          description: Transcription created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TranscriptionCreateResponse'
              example:
                message: Transcription created successfully
                transcription:
                  id: trans_abc123xyz
                  user_id: usr_123456789
                  group_id: grp_987654321
                  duration_seconds: 180
                  language_used: en
                  original_transcript: The patient is a 45-year-old male...
                  created_at: '2023-10-09T10:00:00.000Z'
                  updated_at: '2023-10-09T10:00:00.000Z'
        '400':
          description: Bad request (missing required fields or invalid data)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                success: false
                error: Bad Request
                details: duration_seconds and original_transcript are required
        '401':
          description: Unauthorized (invalid or missing token)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    TranscriptionCreateRequest:
      type: object
      required:
        - duration_seconds
        - original_transcript
      properties:
        duration_seconds:
          type: number
          format: float
          minimum: 0
          description: Duration of the recording in seconds
          example: 180
        original_transcript:
          type: string
          description: The transcribed text from the conversation
          example: The patient is a 45-year-old male presenting with chest pain...
        language_used:
          type: string
          description: Language code (e.g., 'en', 'es', 'fr')
          example: en
    TranscriptionCreateResponse:
      type: object
      required:
        - message
        - transcription
      properties:
        message:
          type: string
          example: Transcription created successfully
        transcription:
          type: object
          required:
            - id
            - user_id
            - group_id
            - duration_seconds
            - original_transcript
            - created_at
            - updated_at
          properties:
            id:
              type: string
              description: Unique transcription identifier
              example: trans_abc123xyz
            user_id:
              type: string
              description: User identifier
              example: usr_123456789
            group_id:
              type: string
              description: Group/organization identifier
              example: grp_987654321
            duration_seconds:
              type: number
              format: float
              description: Duration of the recording in seconds
              example: 180
            language_used:
              type: string
              description: Language code used
              example: en
            original_transcript:
              type: string
              description: The transcribed text
              example: The patient is a 45-year-old male...
            created_at:
              type: string
              format: date-time
              description: Timestamp when transcription was created
              example: '2023-10-09T10:00:00.000Z'
            updated_at:
              type: string
              format: date-time
              description: Timestamp when transcription was last updated
              example: '2023-10-09T10:00:00.000Z'
    Error:
      type: object
      required:
        - success
        - error
        - details
      properties:
        success:
          type: boolean
          enum:
            - false
          description: Always false for error responses
        error:
          type: string
          description: Error name/type
          example: Bad Request
        details:
          type: string
          description: Detailed error message
          example: Either medical_note or pdf_file must be provided
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Bearer token for API authentication

````