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

# Create transcription task

> Uploads a raw audio or video file as the request body and queues an asynchronous transcription task. Requires an active annual HearDraft plan, a valid workspace API key, a `Content-Length` header, a supported media `Content-Type`, and an `Idempotency-Key`.




## OpenAPI

````yaml /openapi.yaml post /api/v1/transcriptions
openapi: 3.1.0
info:
  title: HearDraft Transcription API
  version: 1.0.0
  description: >
    Submit audio or video recordings from your backend and retrieve timestamped
    transcripts with millisecond precision. Every transcription task created
    through the API is synced into the owning HearDraft workspace so your team
    can replay audio, edit passages, and export TXT, Markdown, CSV, JSON, SRT,
    or VTT.
servers:
  - url: https://heardraft.com
    description: Production API
security:
  - BearerAuth: []
tags:
  - name: Transcriptions
    description: Submit recordings and poll transcription results.
paths:
  /api/v1/transcriptions:
    post:
      tags:
        - Transcriptions
      summary: Create transcription task
      description: >
        Uploads a raw audio or video file as the request body and queues an
        asynchronous transcription task. Requires an active annual HearDraft
        plan, a valid workspace API key, a `Content-Length` header, a supported
        media `Content-Type`, and an `Idempotency-Key`.
      operationId: createTranscription
      parameters:
        - name: filename
          in: query
          required: true
          description: >-
            Original filename with a supported audio or video extension (max 160
            chars).
          schema:
            type: string
            maxLength: 160
            example: interview.wav
        - name: language
          in: query
          required: false
          description: >-
            Language code (such as `en`, `ja`, `de`, `fr`, `es`, `zh`) or `auto`
            for automatic detection.
          schema:
            type: string
            default: auto
            example: auto
        - name: Idempotency-Key
          in: header
          required: true
          description: >-
            Unique request key (`8–128` characters: letters, digits, `.`, `_`,
            or `-`). Reuse the same key and payload when safely retrying a
            submission.
          schema:
            type: string
            pattern: ^[A-Za-z0-9._-]{8,128}$
            example: interview-2026-11-24-001
        - name: Content-Length
          in: header
          required: true
          description: Exact byte size of the raw media payload (1 byte up to 100 MB).
          schema:
            type: integer
            minimum: 1
            maximum: 104857600
      requestBody:
        required: true
        description: Raw audio or video binary payload (up to 100 MB and 10 hours).
        content:
          audio/wav:
            schema:
              type: string
              format: binary
          audio/mpeg:
            schema:
              type: string
              format: binary
          audio/mp4:
            schema:
              type: string
              format: binary
          video/mp4:
            schema:
              type: string
              format: binary
          application/octet-stream:
            schema:
              type: string
              format: binary
      responses:
        '202':
          description: Transcription task accepted and queued.
          headers:
            Location:
              description: Polling path for the accepted transcription task.
              schema:
                type: string
                example: /api/v1/transcriptions/8b1e23fa-4c2b-4a8e-9b19-1d63df06a012
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TranscriptionTask'
        '400':
          description: >-
            Missing or invalid query parameter, filename, language, or
            Idempotency-Key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '401':
          description: Missing or invalid Bearer API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '403':
          description: >-
            Workspace does not have an active paid annual plan or API access is
            disabled.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '409':
          description: >-
            Idempotency key reused with different file metadata
            (`IDEMPOTENCY_CONFLICT`) or upload is currently in progress
            (`UPLOAD_IN_PROGRESS`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '411':
          description: Missing `Content-Length` header (`LENGTH_REQUIRED`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '413':
          description: File exceeds the 100 MB request size limit (`INVALID_FILE_SIZE`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '415':
          description: Unsupported `Content-Type` header (`UNSUPPORTED_MEDIA_TYPE`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '429':
          description: Workspace rate limit exceeded (120 requests per minute).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '503':
          description: >-
            Transcription queue temporarily unavailable (`QUEUE_UNAVAILABLE` or
            `TASK_UNAVAILABLE`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
components:
  schemas:
    TranscriptionTask:
      type: object
      required:
        - id
        - sourceId
        - status
        - expiresAt
        - result
        - error
      properties:
        id:
          type: string
          format: uuid
          description: Unique transcription job ID.
          example: 8b1e23fa-4c2b-4a8e-9b19-1d63df06a012
        sourceId:
          type: string
          format: uuid
          description: >-
            Source ID inside the HearDraft workspace where this recording and
            transcript appear.
          example: 1f9c2810-79a4-4f25-8f55-c2e60ad1a4be
        status:
          type: string
          enum:
            - queued
            - running
            - ready
            - failed
            - canceled
          description: Current processing status of the transcription task.
          example: ready
        expiresAt:
          type:
            - string
            - 'null'
          format: date-time
          description: >-
            ISO-8601 expiration timestamp, or `null` when retained on an active
            paid plan.
          example: null
        result:
          oneOf:
            - $ref: '#/components/schemas/TranscriptionResult'
            - type: 'null'
        error:
          oneOf:
            - type: object
              required:
                - code
                - message
              properties:
                code:
                  type: string
                  example: TRANSCRIPTION_FAILED
                message:
                  type: string
                  example: Transcription could not finish.
            - type: 'null'
    ApiError:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              example: INVALID_IDEMPOTENCY_KEY
            message:
              type: string
              example: >-
                Send an Idempotency-Key with 8–128 letters, digits, dots,
                underscores or hyphens.
    TranscriptionResult:
      type: object
      required:
        - text
        - durationSeconds
        - segments
      properties:
        text:
          type: string
          description: Full transcript joined with newline separators.
          example: |-
            Welcome back everyone.
            Let's review the interview timeline before Friday.
        durationSeconds:
          type: number
          description: Total duration of the original recording in seconds.
          example: 142.4
        segments:
          type: array
          items:
            $ref: '#/components/schemas/TranscriptSegment'
    TranscriptSegment:
      type: object
      required:
        - text
        - startMs
        - endMs
      properties:
        text:
          type: string
          description: Spoken text for this passage.
          example: Let's review the interview timeline before Friday.
        startMs:
          type: integer
          minimum: 0
          description: Segment start time in milliseconds.
          example: 4200
        endMs:
          type: integer
          minimum: 0
          description: Segment end time in milliseconds.
          example: 8650
        speaker:
          type:
            - string
            - 'null'
          description: Optional speaker label assigned to this segment.
          example: Speaker 1
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        Workspace API key generated in HearDraft
        (`https://heardraft.com/app/developers/api`).

````

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