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

# Create an Outbound Call



## OpenAPI

````yaml /api-reference/openapi.json post /v1/voice-agents/phone-number/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/phone-number/call:
    post:
      summary: Call Voice Agent using Twilio custom phone number.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CallPhoneNumberRequest'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CallPhoneNumberResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSchema'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSchema'
        '500':
          description: Server Side Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSchema'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    CallPhoneNumberRequest:
      type: object
      properties:
        toNumber:
          type: string
          description: The number that you want to call
        phoneNumber:
          type: string
          example: '+1234567890'
        agentDetails:
          $ref: '#/components/schemas/VoiceAgentRequest'
          description: Send agentDetails instead of voiceAgentId and params.
          default:
            agentName: ''
        voiceAgentId:
          type: string
          nullable: true
          example: d949f13f-40d2-4e48-ac86-b66633070603
        params:
          type: object
          description: >-
            Overriding params set in the voice agent's greeting message or
            preamble. Send when using voiceAgentId only.
          additionalProperties: true
          default: {}
      anyOf:
        - required:
            - voiceAgentId
            - params
            - phoneNumber
            - toNumber
        - required:
            - agentDetails
            - phoneNumber
            - toNumber
    CallPhoneNumberResponse:
      type: object
      properties:
        success:
          type: boolean
          default: false
        message:
          type: string
          default: success
        data:
          type: object
          properties:
            voiceAgentId:
              type: string
              example: d949f13f-40d2-4e48-ac86-b66633070603
              description: The voice agent Id attached to the phone number
            jobId:
              type: string
              example: d949f13f-40d2-4e48-ac86-b66633070603
              description: The call job Id
    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
    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>'

````