> ## 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.

# Update Voice Agent Route



## OpenAPI

````yaml /api-reference/openapi.json patch /v1/voice-agents/{voiceAgentId}
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/{voiceAgentId}:
    patch:
      summary: Update an existing voice agent
      parameters:
        - name: voiceAgentId
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateVoiceAgentRequest'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VoiceAgentResponse'
        '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: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSchema'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSchema'
      deprecated: true
      security:
        - ApiKeyAuth: []
components:
  schemas:
    UpdateVoiceAgentRequest:
      type: object
      properties:
        agentName:
          type: string
        greetingMessage:
          description: >-
            Greeting Message can be customized by adding params like: {{name}},
            to make the message more personal!
          type: string
          nullable: true
        greetingMessageType:
          type: string
          nullable: true
        preamble:
          description: >-
            Preamble can be customized by adding params like: {{agentName}}, to
            make the prompt more specific and context aware!
          type: string
        lang:
          type: string
          enum:
            - ar
            - en
        pokeMessages:
          description: The messages to say to the user when he doesn't respond!
          type: array
          items:
            type: string
        realTime:
          type: boolean
        silenceThreshold:
          type: integer
        interrupt:
          type: boolean
        outcome:
          description: >-
            A prompt to take the conversation and transform it to anything you
            like, like creating an article out of the conversation!
          type: string
          nullable: true
        outcomeResponseShape:
          type: object
          title: Outcome Response Schema
          description: >-
            Recursive OpenAPI-style shape with 'type', 'properties', 'required',
            'items', ...etc. Please refer to the `OpenAPI Outcome Response
            Instructions` above for more information.
          example:
            type: object
            properties:
              test:
                type: number
                description: Hello world from Hamsa AI!
            required:
              - test
          additionalProperties: true
        webhookUrl:
          type: string
          nullable: true
          format: uri
          example: https://example.com/webhook
        webhookAuth:
          $ref: '#/components/schemas/ExternalWebhookAuthScheme'
        voiceId:
          description: >-
            For trying voices and choosing one by yourself, or event cloning a
            voice, please visit Hamsa Agents platform voices tab
            [here](https://agents.tryhamsa.com/app/voices).
          type: string
        description:
          type: string
        isTemplate:
          type: boolean
        icon:
          type: string
        tools:
          type: object
          properties:
            genderDetection:
              type: boolean
              default: false
            smartCallEnd:
              type: boolean
              default: false
        params:
          description: >-
            Set the params you define in the greeting message or preamble fields
            here, the key is the same as the param and the value is the param
            value. Press 'Add new property' below to set the param name then
            press enter, after that add the value.
          type: object
        alignment:
          type: object
          properties:
            greetingMessage:
              type: string
              default: ltr
            preamble:
              type: string
              default: ltr
        knowledgeBaseItemsIds:
          type: array
          items:
            type: string
        webToolsIds:
          type: array
          items:
            type: string
        voiceDictionaryIds:
          type: array
          items:
            type: string
        userInactivityTimeout:
          type: number
          minimum: 5
          maximum: 30
        maxCallDuration:
          type: number
          minimum: 30
          maximum: 600
        responseDelay:
          type: number
          minimum: 100
          maximum: 1500
        backgroundNoise:
          type: boolean
        waitForUserToSpeakFirst:
          type: integer
          minimum: 0
          maximum: 2
        thinkingVoice:
          type: boolean
        speakerIdentification:
          type: boolean
        llmConfig:
          $ref: '#/components/schemas/VoiceAgentLlmConfig'
        webToolsOverrides:
          type: object
        agenticRag:
          type: boolean
        languageDialectSwitcher:
          type: boolean
        noiseCancellation:
          type: string
        cancelNoisePer:
          type: string
          nullable: true
        minInterruptionDuration:
          type: number
          minimum: 0.2
          maximum: 1.5
        vadActivationThreshold:
          type: number
          minimum: 0.2
          maximum: 0.9
        enableAutoGainControl:
          type: boolean
        sendDenoisedToStt:
          type: boolean
    VoiceAgentResponse:
      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
    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
    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
  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>'

````