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

# Clone Voice Agent Route

> Use this route to clone an existing agent. You can use it to clone one of the voice agents templates created by our experts!



## OpenAPI

````yaml /api-reference/openapi.json post /v1/voice-agents/clone
openapi: 3.0.1
info:
  title: Hamsa API
  description: Trying out our transcription and media-to-text APIs
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.tryhamsa.com
security: []
paths:
  /v1/voice-agents/clone:
    post:
      summary: Clone a voice agent
      description: >-
        Use this route to clone an existing agent. You can use it to clone one
        of the voice agents templates created by our experts!
      parameters:
        - name: voiceAgentId
          in: query
          required: true
          schema:
            type: string
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                agentName:
                  type: string
      responses:
        '200':
          description: Successful cloning of voice agent
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CloneResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSchema'
        '401':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSchema'
        '403':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSchema'
        '404':
          description: Voice agent not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSchema'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSchema'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    CloneResponse:
      type: object
      properties:
        success:
          type: boolean
          default: false
        message:
          type: string
          default: success
        data:
          $ref: '#/components/schemas/VoiceAgentResponseData'
    ErrorSchema:
      type: object
      properties:
        code:
          type: integer
        message:
          type: string
    VoiceAgentResponseData:
      type: object
      properties:
        id:
          type: string
        agentName:
          type: string
        greetingMessage:
          type: string
        greetingMessageType:
          type: string
          enum:
            - STATIC
            - PROMPT
          nullable: true
        description:
          type: string
        preamble:
          type: string
        lang:
          type: string
        pokeMessages:
          type: array
          items:
            type: string
        realTime:
          type: boolean
        silenceThreshold:
          type: integer
        interrupt:
          type: boolean
        type:
          type: string
        outcome:
          type: string
          nullable: true
        outcomeResponseShape:
          type: object
          nullable: true
          example:
            type: object
            properties:
              test:
                type: number
                description: Hello world from Hamsa AI!
            required:
              - test
        projectId:
          type: string
        apiKeyId:
          type: string
        voiceId:
          type: string
          nullable: true
        voiceRecordId:
          type: string
          nullable: true
        voiceRecord:
          type: object
          description: The voice record object which is connected to this agent.
          nullable: true
        collectionId:
          type: string
          nullable: true
        isTemplate:
          type: boolean
        icon:
          type: string
          nullable: true
        webhookUrl:
          type: string
          nullable: true
          format: uri
          example: https://example.com/webhook
        webhookAuth:
          $ref: '#/components/schemas/ExternalWebhookAuthScheme'
        params:
          type: object
          description: The parameters that are created for this agent.
        alignment:
          type: object
          properties:
            greetingMessage:
              type: string
            preamble:
              type: string
        tools:
          type: object
          properties:
            genderDetection:
              type: boolean
            smartCallEnd:
              type: boolean
        webToolsIds:
          type: array
          items:
            type: string
        voiceDictionaryIds:
          type: array
          items:
            type: string
        knowledgeBaseItemsIds:
          type: array
          items:
            type: string
        webToolsOverrides:
          type: object
        userInactivityTimeout:
          type: number
        maxCallDuration:
          type: number
        responseDelay:
          type: number
        backgroundNoise:
          type: boolean
        waitForUserToSpeakFirst:
          type: integer
        thinkingVoice:
          type: boolean
        speakerIdentification:
          type: boolean
        llmConfig:
          $ref: '#/components/schemas/VoiceAgentLlmConfig'
        noiseCancellation:
          type: string
        cancelNoisePer:
          type: string
          nullable: true
        agenticRag:
          type: boolean
        languageDialectSwitcher:
          type: boolean
        minInterruptionDuration:
          type: number
        vadActivationThreshold:
          type: number
        enableAutoGainControl:
          type: boolean
        sendDenoisedToStt:
          type: boolean
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    ExternalWebhookAuthScheme:
      type: object
      description: >-
        Authorization header to be sent in this format: `Authorization:
        [authKey] [authSecret]`
      properties:
        authKey:
          type: string
          example: Token
          nullable: true
        authSecret:
          type: string
          example: Secret
          nullable: true
    VoiceAgentLlmConfig:
      type: object
      description: Configuration for the LLM (Large Language Model) used by the voice agent
      properties:
        provider:
          type: string
          enum:
            - OpenAI
            - Gemini
            - deepmyst
            - Custom
            - Groq
          description: The LLM provider to use
          default: OpenAI
          example: OpenAI
        modelName:
          type: string
          description: >-
            The model name to use. Valid models depend on the provider: OpenAI
            (GPT-5, GPT-5-Mini, GPT-5-Nano, GPT-4.1, GPT-4.1-Mini, GPT-4.1-Nano,
            GPT-4o, GPT-4o-mini), Gemini (Gemini 2.5-Pro, Gemini 2.5-Flash,
            gemini-3-flash-preview), deepmyst (gpt-4.1-optimize,
            gpt-4.1-mini-optimize), Groq (openai/gpt-oss-120b,
            openai/gpt-oss-20b)
          default: GPT-4.1
          example: GPT-4.1
        baseUrl:
          type: string
          description: Custom base URL for the LLM API. Required when provider is 'Custom'
          example: https://api.custom-llm.com/v1
        apiKey:
          type: string
          description: >-
            API key for authentication with the LLM provider. Required when
            provider is 'Custom'
          example: sk-...
        temperature:
          type: number
          minimum: 0
          maximum: 1
          description: >-
            Controls randomness in the model's responses. Lower values make
            output more deterministic, higher values make it more creative.
            Note: GPT-5, GPT-5-Mini, and GPT-5-Nano models require temperature
            to be exactly 1.
          default: 0.2
          example: 0.2
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        Pass the API key in the Authorization header, You need to put Token
        keyword before the API key. e.g. 'Authorization: Token <api-key>'

````