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

# Add or clone a custom voice

> Adds a voice from your speech connected service by its connected service voice id (connected service, external_id, name), or with type clone clones a voice from a speech sample (name, gender, nationality, consent_confirmed true, and audio_url or audio_base64). The connected service charges for each clone, so send an Idempotency-Key and do not retry blindly. Requires write access. This operation can change workspace data or trigger an external side effect; review the request before sending it and do not retry blindly after a timeout.



## OpenAPI

````yaml /openapi.json post /api/v1/public/custom-voices
openapi: 3.1.0
info:
  description: >-
    Customer-facing API for managing outreach, leads, conversations, voice
    agents, knowledge bases, analytics, and webhooks.
  title: Sendora Public API
  version: 1.0.0
servers:
  - description: Production
    url: https://api.sendora.ai
security: []
tags:
  - description: Leads, lead lists, importing, enriching and finding new prospects.
    name: Leads
  - description: Build, run and measure outreach, and enroll leads.
    name: Campaigns
  - description: Read and send messages, and manage who must not be contacted.
    name: Conversations
  - description: >-
      Voice and chat agents, their tools, knowledge bases, voices and website
      widgets.
    name: Agents
  - description: >-
      Start calls, and manage phone numbers, SMS registration, sending accounts
      and email domains.
    name: Calls and numbers
  - description: Webhooks, jobs, analytics and the Copilot assistant.
    name: Platform
  - description: Manage client workspaces, plans and branding.
    name: Agency
paths:
  /api/v1/public/custom-voices:
    post:
      tags:
        - Agents
      summary: Add or clone a custom voice
      description: >-
        Adds a voice from your speech connected service by its connected service
        voice id (connected service, external_id, name), or with type clone
        clones a voice from a speech sample (name, gender, nationality,
        consent_confirmed true, and audio_url or audio_base64). The connected
        service charges for each clone, so send an Idempotency-Key and do not
        retry blindly. Requires write access. This operation can change
        workspace data or trigger an external side effect; review the request
        before sending it and do not retry blindly after a timeout.
      operationId: add_custom_voice_api_v1_public_custom_voices_post
      parameters:
        - in: header
          name: X-API-Key
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Api-Key
        - in: header
          name: Authorization
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Authorization
      requestBody:
        content:
          application/json:
            schema:
              anyOf:
                - $ref: '#/components/schemas/CloneVoice'
                - $ref: '#/components/schemas/AddCustomVoiceIn'
              title: Body
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                title: Response Add Custom Voice Api V1 Public Custom Voices Post
                type: object
          description: Successful Response
        '401':
          description: The X-API-Key header is missing, invalid, expired, or revoked.
        '402':
          description: >-
            The workspace is suspended for billing, or the request would exceed
            a plan or usage limit.
        '403':
          description: >-
            The key is valid but lacks the required scope, or the workspace has
            no active plan, lacks the entitlement, or has this feature turned
            off or view-only.
        '410':
          description: The workspace behind this key has been deleted.
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
        '500':
          description: >-
            An unexpected Sendora error occurred. Retry only if the operation is
            safe to repeat.
        '503':
          description: >-
            An entitlement or billing check is temporarily unavailable. Retry
            after the Retry-After interval.
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - label: cURL
          lang: bash
          source: >-
            curl -X POST 'https://api.sendora.ai/api/v1/public/custom-voices' -H
            "X-API-Key: $SENDORA_API_KEY" -H "Content-Type: application/json" \
              -d '{"type":"example","name":"example","gender":"example","nationality":"example"}'
        - label: Python
          lang: python
          source: >-
            import requests


            url = 'https://api.sendora.ai/api/v1/public/custom-voices'

            headers = {'X-API-Key': '$SENDORA_API_KEY'}

            response = requests.post(url, headers=headers, json={'type':
            'example', 'name': 'example', 'gender': 'example', 'nationality':
            'example'})

            response.raise_for_status()

            print(response.json())
        - label: JavaScript
          lang: javascript
          source: >-
            const response = await
            fetch("https://api.sendora.ai/api/v1/public/custom-voices", {
              method: "POST",
              headers: { 'X-API-Key': process.env.SENDORA_API_KEY, 'Content-Type': 'application/json' },
              body: JSON.stringify({"type": "example", "name": "example", "gender": "example", "nationality": "example"}),
            });

            if (!response.ok) throw new Error(await response.text());

            console.log(await response.json());
        - label: Go
          lang: go
          source: >-
            req, err := http.NewRequest("POST",
            "https://api.sendora.ai/api/v1/public/custom-voices",
            bytes.NewBufferString(`{"type": "example", "name": "example",
            "gender": "example", "nationality": "example"}`))

            if err != nil { log.Fatal(err) }

            req.Header.Set("X-API-Key", os.Getenv("SENDORA_API_KEY"))

            req.Header.Set("Content-Type", "application/json")

            resp, err := http.DefaultClient.Do(req)

            if err != nil { log.Fatal(err) }

            defer resp.Body.Close()
components:
  schemas:
    CloneVoice:
      properties:
        audio_base64:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            The sample itself, base64 encoded, up to 10 MB. Use audio_url for
            larger files
          title: Audio Base64
        audio_url:
          anyOf:
            - maxLength: 2000
              type: string
            - type: 'null'
          description: >-
            A public https link to the speech sample (mp3, wav, m4a, ogg, webm
            or flac, up to 50 MB)
          title: Audio Url
        consent_confirmed:
          default: false
          description: >-
            Must be true: you confirm the speaker agreed to have their voice
            cloned
          title: Consent Confirmed
          type: boolean
        credential_mode:
          default: byok
          description: Credential mode returned by the Sendora API.
          enum:
            - managed
            - byok
          title: Credential Mode
          type: string
        description:
          anyOf:
            - maxLength: 500
              type: string
            - type: 'null'
          description: Description returned by the Sendora API.
          title: Description
        filename:
          anyOf:
            - maxLength: 200
              type: string
            - type: 'null'
          description: 'With audio_base64: the file name, for example sample.mp3'
          title: Filename
        gender:
          description: Gender returned by the Sendora API.
          maxLength: 50
          minLength: 1
          title: Gender
          type: string
        language:
          anyOf:
            - maxLength: 20
              type: string
            - type: 'null'
          description: Language returned by the Sendora API.
          title: Language
        name:
          description: Name returned by the Sendora API.
          maxLength: 200
          minLength: 1
          title: Name
          type: string
        nationality:
          description: For example American or Indian
          maxLength: 80
          minLength: 1
          title: Nationality
          type: string
        type:
          const: clone
          description: >-
            clone creates a voice from a speech sample; leave type out to add an
            existing connected service voice
          title: Type
          type: string
      required:
        - type
        - name
        - gender
        - nationality
      title: CloneVoice
      type: object
    AddCustomVoiceIn:
      properties:
        credential_mode:
          default: byok
          description: Credential mode returned by the Sendora API.
          pattern: ^(managed|byok)$
          title: Credential Mode
          type: string
        description:
          anyOf:
            - maxLength: 500
              type: string
            - type: 'null'
          description: Description returned by the Sendora API.
          title: Description
        external_id:
          description: The item's id in the service it was imported from.
          maxLength: 256
          minLength: 1
          title: External Id
          type: string
        gender:
          anyOf:
            - maxLength: 50
              type: string
            - type: 'null'
          description: Gender returned by the Sendora API.
          title: Gender
        language:
          anyOf:
            - maxLength: 20
              type: string
            - type: 'null'
          description: Language returned by the Sendora API.
          title: Language
        name:
          description: Name returned by the Sendora API.
          maxLength: 200
          minLength: 1
          title: Name
          type: string
        preview_url:
          anyOf:
            - maxLength: 1024
              type: string
            - type: 'null'
          description: Preview url returned by the Sendora API.
          title: Preview Url
        provider:
          description: connected service returned by the Sendora API.
          pattern: ^(elevenlabs|cartesia|inworld)$
          title: connected service
          type: string
        provider_params:
          anyOf:
            - type: object
            - type: 'null'
          description: connected service params returned by the Sendora API.
          title: connected service Params
        use_case:
          default: both
          description: Use case returned by the Sendora API.
          pattern: ^(calls|voice_notes|both)$
          title: Use Case
          type: string
      required:
        - provider
        - external_id
        - name
      title: AddCustomVoiceIn
      type: object
    HTTPValidationError:
      properties:
        detail:
          description: Detail returned by the Sendora API.
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      required: []
      title: HTTPValidationError
      type: object
    ValidationError:
      properties:
        loc:
          description: Loc returned by the Sendora API.
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          description: Msg returned by the Sendora API.
          title: Message
          type: string
        type:
          description: Type returned by the Sendora API.
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
  securitySchemes:
    ApiKeyAuth:
      description: Customer API key created in the Sendora dashboard.
      in: header
      name: X-API-Key
      type: apiKey

````

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