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

# Start a Call for a Conversation Route



## OpenAPI

````yaml /api-reference/openapi.json post /v1/voice-agents/call
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/call:
    post:
      summary: >-
        Initiate a call with a voice agent. This endpoint is kept to testing
        outbound calls via Twilio only.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CallRequest'
      responses:
        '200':
          description: Successful call initiation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CallResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSchema'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSchema'
        '403':
          description: Forbidden
          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:
    CallRequest:
      type: object
      properties:
        toNumber:
          type: string
          description: The number that you want to call
        fromNumber:
          type: string
          enum:
            - '+18449292835'
            - '+18558961879'
        agentDetails:
          $ref: '#/components/schemas/VoiceAgentRequest'
          description: Send agentDetails instead of voiceAgentId and params.
          default: {}
        voiceAgentId:
          type: string
          nullable: true
        params:
          type: object
          description: >-
            Params set in the voice agent's greeting message or preamble. Send
            when using voiceAgentId only.
          additionalProperties: true
          default: {}
        webhookUrl:
          type: string
          nullable: true
          format: uri
          example: https://example.com/webhook
        webhookAuth:
          $ref: '#/components/schemas/ExternalWebhookAuthScheme'
      anyOf:
        - required:
            - voiceAgentId
            - params
            - fromNumber
            - toNumber
          not:
            required:
              - agentDetails
        - required:
            - agentDetails
            - fromNumber
            - toNumber
          not:
            required:
              - voiceAgentId
              - params
    CallResponse:
      type: object
      properties:
        success:
          type: boolean
          default: false
        message:
          type: string
          default: success
        data:
          type: object
          properties:
            id:
              type: string
            title:
              type: string
              nullable: true
            model:
              type: string
            type:
              type: string
            processingType:
              type: string
            webhookUrl:
              type: string
              nullable: true
            totalCost:
              type: number
            usageTime:
              type: string
              nullable: true
            fromLng:
              type: string
              nullable: true
            toLng:
              type: string
              nullable: true
            mediaUrl:
              type: string
              nullable: true
            jobResponse:
              type: object
              nullable: true
            fromScript:
              type: string
              nullable: true
            toScript:
              type: string
              nullable: true
            status:
              type: string
            relevantJobId:
              type: string
              nullable: true
            agentDetails:
              $ref: '#/components/schemas/VoiceAgentResponseData'
            apiKeyId:
              type: string
            billingId:
              type: string
            systemModelKey:
              type: string
              nullable: true
            voiceAgentId:
              type: string
              nullable: true
            createdAt:
              type: string
              format: date-time
            updatedAt:
              type: string
              format: date-time
    ErrorSchema:
      type: object
      properties:
        code:
          type: integer
        message:
          type: string
    VoiceAgentRequest:
      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
          default: Hello, how can I help you today?
        greetingMessageType:
          type: string
          nullable: true
          enum:
            - STATIC
            - PROMPT
          default: null
        preamble:
          description: >-
            Preamble can be customized by adding params like: {{agentName}}, to
            make the prompt more specific and context aware!
          type: string
          default: You are a helpful assistant that will answer users questions.
        lang:
          type: string
          enum:
            - ar
            - en
          default: ar
        pokeMessages:
          description: The messages to say to the user when he doesn't respond!
          type: array
          items:
            type: string
          default: []
        realTime:
          type: boolean
          default: false
        silenceThreshold:
          type: integer
          default: 800
          minimum: 1
          description: >-
            The silence threshold in milliseconds. Minimum value is 1
            millisecond.
        interrupt:
          type: boolean
          default: true
        type:
          type: string
          default: Single Prompt
        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
          default: null
        webhookUrl:
          type: string
          nullable: true
          format: uri
          example: https://example.com/webhook
        webhookAuth:
          $ref: '#/components/schemas/ExternalWebhookAuthScheme'
        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
        voiceId:
          description: >-
            For trying voices and choosing one by yourself, or even cloning a
            voice, please visit Hamsa Agents platform voices tab
            [here](https://agents.tryhamsa.com/app/voices).
          type: string
          nullable: true
          default: null
        tools:
          type: object
          properties:
            genderDetection:
              type: boolean
              default: false
            smartCallEnd:
              type: boolean
              default: false
          default:
            genderDetection: false
            smartCallEnd: 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
          default: {}
        alignment:
          type: object
          properties:
            greetingMessage:
              type: string
              default: ltr
            preamble:
              type: string
              default: ltr
          default:
            greetingMessage: ltr
            preamble: ltr
        webToolsIds:
          type: array
          items:
            type: string
        voiceDictionaryIds:
          type: array
          items:
            type: string
        knowledgeBaseItemsIds:
          type: array
          items:
            type: string
        webToolsOverrides:
          type: object
        userInactivityTimeout:
          type: number
          minimum: 5
          maximum: 30
          default: 15
        maxCallDuration:
          type: number
          minimum: 30
          maximum: 600
          default: 300
        responseDelay:
          type: number
          minimum: 100
          maximum: 1500
          default: 400
        backgroundNoise:
          type: boolean
          default: false
        waitForUserToSpeakFirst:
          type: integer
          minimum: 0
          maximum: 2
          default: 0
        thinkingVoice:
          type: boolean
          default: false
        speakerIdentification:
          type: boolean
          default: false
        llmConfig:
          $ref: '#/components/schemas/VoiceAgentLlmConfig'
        noiseCancellation:
          type: string
          default: telephony-optimized
        cancelNoisePer:
          type: string
          default: conversation
        agenticRag:
          type: boolean
          default: false
        languageDialectSwitcher:
          type: boolean
          default: false
        minInterruptionDuration:
          type: number
          minimum: 0.2
          maximum: 1.5
          default: 0.5
        vadActivationThreshold:
          type: number
          minimum: 0.2
          maximum: 0.9
          default: 0.5
        enableAutoGainControl:
          type: boolean
          default: false
        sendDenoisedToStt:
          type: boolean
          default: false
      required:
        - agentName
    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
    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
    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>'

````