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

# Start Voice Clip Upload

> Start a resumable audio upload.

Returns a presigned upload URL for every part up front. Use Get Voice Clip Upload Parts
to resume an interrupted upload or to get fresh URLs after they expire.



## OpenAPI

````yaml https://api.usetuner.ai/public/openapi.json post /api/v1/workspaces/{workspace_id}/agents/{agent_id}/voice-clip-uploads
openapi: 3.1.0
info:
  title: Tuner API
  description: >-
    Send calls to Tuner and manage agents, evaluation settings, simulations and
    workspace settings.
  version: 1.0.0
servers:
  - url: https://api.usetuner.ai
security: []
tags:
  - name: calls
    description: Send call recordings and transcripts to Tuner and retrieve call details.
    x-group: Calls
  - name: workspaces
    description: >-
      Manage your workspaces, the API keys used to access them, and their PII
      redaction and data retention settings.
    x-group: Workspaces
  - name: simulation
    description: >-
      Run simulated calls against your agents, manage simulation profiles, and
      look up the caller personas and background-noise environments they can
      use.
    x-group: Simulation
  - name: scenarios
    description: Manage the test scenarios that simulated calls follow.
    x-group: Scenarios
  - name: replay-testing
    description: >-
      Replay recorded caller audio against a new version of your agent: upload
      or extract voice clips from real calls, then run them as replay runs.
    x-group: Replay Testing
  - name: agents
    description: Create, update and list the voice agents connected to your workspace.
    x-group: Agents
  - name: agent-settings
    description: >-
      Configure how Tuner evaluates an agent's calls, including evaluations,
      call outcomes, intents, data extraction, rules and alerts, plus the
      agent's SIP and outbound call configuration.
    x-group: Agent Settings
  - name: traces
    description: Send OpenTelemetry traces from your agent to Tuner.
    x-group: Traces
  - name: providers
    description: List the voice providers Tuner can connect to.
    x-group: Providers
paths:
  /api/v1/workspaces/{workspace_id}/agents/{agent_id}/voice-clip-uploads:
    post:
      tags:
        - replay-testing
      summary: Start Voice Clip Upload
      description: >-
        Start a resumable audio upload.


        Returns a presigned upload URL for every part up front. Use Get Voice
        Clip Upload Parts

        to resume an interrupted upload or to get fresh URLs after they expire.
      operationId: >-
        create_voice_clip_upload_api_v1_workspaces__workspace_id__agents__agent_id__voice_clip_uploads_post
      parameters:
        - name: agent_id
          in: path
          required: true
          schema:
            type: integer
            description: Tuner's internal numeric ID for the agent.
            title: Agent Id
          description: Tuner's internal numeric ID for the agent.
        - name: workspace_id
          in: path
          required: true
          schema:
            type: integer
            description: Workspace ID. Find this in Workspace > General Settings.
            title: Workspace Id
          description: Workspace ID. Find this in Workspace > General Settings.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VoiceClipUploadCreateRequest'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VoiceClipUploadCreateResponse'
        '400':
          description: Unsupported extension, or a declared size above the 200 MB ceiling.
          content:
            application/json:
              example:
                detail: 'Unsupported extension ''flac''. Allowed: [''m4a'', ''mp3'', ''wav'']'
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Missing or invalid API key.
          content:
            application/json:
              example:
                detail: Not authenticated
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '402':
          description: >-
            Simulation is not included in the workspace's current plan, or the
            workspace lacks credits for uploaded-audio analysis.
          content:
            application/json:
              example:
                detail: Simulation not included in your current plan.
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: You do not have access to this workspace.
          content:
            application/json:
              example:
                detail: User does not have access to workspace 42
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Agent not found.
          content:
            application/json:
              example:
                detail: Agent with ID 17 not found
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '503':
          description: Audio uploads are currently unavailable.
          content:
            application/json:
              example:
                detail: Audio uploads are not available in this environment.
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - Bearer: []
components:
  schemas:
    VoiceClipUploadCreateRequest:
      properties:
        filename:
          type: string
          maxLength: 512
          minLength: 1
          title: Filename
          description: Original file name of the audio recording, up to 512 characters.
        extension:
          type: string
          maxLength: 10
          minLength: 1
          title: Extension
          description: >-
            File extension of the recording, with or without a leading dot. One
            of flac, m4a, mp3, ogg, wav, webm.
        size_bytes:
          type: integer
          maximum: 209715200
          exclusiveMinimum: 0
          title: Size Bytes
          description: >-
            Size of the recording in bytes, up to 200 MB. The upload is split
            into parts based on this size.
      type: object
      required:
        - filename
        - extension
        - size_bytes
      title: VoiceClipUploadCreateRequest
      description: Details of the recording to upload.
    VoiceClipUploadCreateResponse:
      properties:
        id:
          type: integer
          title: Id
          description: Voice clip upload ID.
        status:
          type: string
          title: Status
          description: >-
            Upload status: `uploading`, `uploaded`, `analyzing`,
            `awaiting_selection`, `consumed` or `failed`. `awaiting_selection`
            means the recording is ready for you to pick the caller's channel;
            `consumed` means a clip set has been built from it.
        filename:
          type: string
          title: Filename
          description: Original file name of the recording.
        extension:
          type: string
          title: Extension
          description: File extension of the recording.
        size_bytes:
          type: integer
          title: Size Bytes
          description: Declared size of the recording, in bytes.
        duration_ms:
          anyOf:
            - type: integer
            - type: 'null'
          title: Duration Ms
          description: Duration of the recording in milliseconds. Set after analysis.
        channel_count:
          anyOf:
            - type: integer
            - type: 'null'
          title: Channel Count
          description: Number of audio channels. Set after analysis.
        channel_mode:
          anyOf:
            - type: string
            - type: 'null'
          title: Channel Mode
          description: '`mono` or `multi_channel`. Set after analysis.'
        speakers:
          anyOf:
            - items:
                $ref: '#/components/schemas/VoiceClipUploadSpeaker'
              type: array
            - type: 'null'
          title: Speakers
          description: Channels detected in the recording. Set after analysis.
        failure_reason:
          anyOf:
            - type: string
            - type: 'null'
          title: Failure Reason
          description: Why the upload failed. Set only when `status` is `failed`.
        created_at:
          type: string
          format: date-time
          title: Created At
          description: When the upload was started.
        part_size_bytes:
          type: integer
          title: Part Size Bytes
          description: >-
            Size of each part in bytes. Every part except the last must be this
            size.
        parts:
          items:
            $ref: '#/components/schemas/VoiceClipUploadPart'
          type: array
          title: Parts
          description: One presigned upload URL per part.
        expires_at:
          type: string
          format: date-time
          title: Expires At
          description: When the part URLs expire.
      type: object
      required:
        - id
        - status
        - filename
        - extension
        - size_bytes
        - created_at
        - part_size_bytes
        - expires_at
      title: VoiceClipUploadCreateResponse
      description: A new upload, with the URLs to send its parts to.
    ErrorResponse:
      properties:
        detail:
          type: string
          title: Detail
          description: Human-readable description of what went wrong.
      type: object
      required:
        - detail
      title: ErrorResponse
      description: Error body returned when a request fails.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    VoiceClipUploadSpeaker:
      properties:
        index:
          type: integer
          title: Index
          description: Channel index. Use it to pick the caller's channel.
        label:
          type: string
          title: Label
          description: Display label for the channel.
      type: object
      required:
        - index
        - label
      title: VoiceClipUploadSpeaker
      description: One audio channel detected in an uploaded recording.
    VoiceClipUploadPart:
      properties:
        part_number:
          type: integer
          minimum: 1
          title: Part Number
          description: 1-based part index.
        url:
          type: string
          title: Url
          description: Presigned PUT URL. Treat as a credential; do not log.
      type: object
      required:
        - part_number
        - url
      title: VoiceClipUploadPart
      description: One part of the multipart upload, as offered to the client.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    Bearer:
      type: http
      description: >-
        Use Tuner API key (tr_api_...) or user session token. Find your API key
        in Workspace Settings > API Keys.
      scheme: bearer

````

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