> ## Documentation Index
> Fetch the complete documentation index at: https://nadsoft.mintlify.site/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 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
        description:
          type: string
        preamble:
          type: string
        lang:
          type: string
        pokeMessages:
          type: array
          items:
            type: string
        realTime:
          type: boolean
        silenceThreshold:
          type: integer
        interrupt:
          type: boolean
        outcome:
          type: string
        outcomeResponseShape:
          type: object
          example:
            type: object
            properties:
              test:
                type: number
                description: Hello world from Hamsa AI!
            required:
              - test
        projectId:
          type: string
        apiKeyId:
          type: string
        voiceRecordId:
          type: string
          nullable: true
        voiceRecord:
          type: object
          description: The voice record object which is connected to this agent.
          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.
        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
  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>'

````

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