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

# Make a call

> To make an outbound call to a given telephone number



## OpenAPI

````yaml https://api.insighto.ai/api/v1/openapi.json post /api/v1/call/{widget_id}
openapi: 3.1.0
info:
  title: Ragify
  version: v1
servers: []
security: []
paths:
  /api/v1/call/{widget_id}:
    post:
      tags:
        - Calling
      summary: Make a call
      description: To make an outbound call to a given telephone number
      operationId: make_a_call_api_v1_call__widget_id__post
      parameters:
        - name: widget_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            description: >-
              Widget ID to be used for initiating the call. It must be connected
              to Twilio, Plivo or Telnyx.
            title: Widget Id
          description: >-
            Widget ID to be used for initiating the call. It must be connected
            to Twilio, Plivo or Telnyx.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MakeCallPayload'
              description: Payload containing the phone number and other details.
      responses:
        '201':
          description: Call successfully initiated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IPostResponseBase_Call_'
        '400':
          description: Invalid input, such as malformed phone number
          content:
            application/json:
              example:
                detail: Couldn't authenticate your Twilio account
        '401':
          description: Authentication credentials are missing or invalid
          content:
            application/json:
              example:
                detail: Invalid authentication credentials
        '404':
          description: Widget not found or not configured for telephony
          content:
            application/json:
              example:
                detail: Invalid Widget ID
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '429':
          description: Too Many Requests
          content:
            application/json:
              example:
                detail: Too Many Requests
              schema:
                $ref: '#/components/schemas/HTTP429Response'
        '500':
          description: Internal server error
      security:
        - Your API Key: []
        - HTTPBearer: []
components:
  schemas:
    MakeCallPayload:
      properties:
        to:
          type: string
          title: To
          description: 'The phone number to call. Must be in E.164 format. Ex: 16501234567'
        prompt_dynamic_variables:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Prompt Dynamic Variables
          description: >-
            Dynamic variables to be used in the prompt. Ex: {'name': 'Bob',
            'appointment_day': 'tomorrow', 'reason': 'for confirmation of
            appointment'}
      type: object
      required:
        - to
      title: MakeCallPayload
      examples:
        - prompt_dynamic_variables:
            appointment_day: tomorrow
            name: Bob
            reason: for confirmation of appointment
          to: '919810012345'
        - to: '19810012345'
    IPostResponseBase_Call_:
      properties:
        message:
          anyOf:
            - type: string
            - type: 'null'
          title: Message
          default: Data created successfully
        meta:
          anyOf:
            - additionalProperties: true
              type: object
            - {}
            - type: 'null'
          title: Meta
          default: {}
        data:
          anyOf:
            - $ref: '#/components/schemas/Call'
            - type: 'null'
      type: object
      title: IPostResponseBase[Call]
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    HTTP429Response:
      properties:
        detail:
          type: string
          title: Detail
      type: object
      required:
        - detail
      title: HTTP429Response
    Call:
      properties:
        conversation_id:
          type: string
          format: uuid
          title: Conversation Id
          description: >-
            The unique ID of the conversation. Ex:
            123e4567-e89b-12d3-a456-426614174000
        contact_id:
          type: string
          format: uuid
          title: Contact Id
          description: >-
            The unique ID of the contact. Ex:
            123e4567-e89b-12d3-a456-426614174000
        widget_id:
          type: string
          format: uuid
          title: Widget Id
          description: >-
            The unique ID of the widget used for the call. Ex:
            123e4567-e89b-12d3-a456-426614174000
        assistant_id:
          type: string
          format: uuid
          title: Assistant Id
          description: >-
            The unique ID of the assistant used for the call. Ex:
            123e4567-e89b-12d3-a456-426614174000
        direction:
          type: string
          title: Direction
          description: The direction of the call. Must be either 'inbound' or 'outbound'.
        from_number:
          type: string
          title: From Number
          description: 'Phone number to call from. Ex: 16501234567'
        to_number:
          type: string
          title: To Number
          description: 'Phone number to call to. Ex: 16501234567'
        telephony_provider:
          $ref: '#/components/schemas/TelephonyProviderCallDetails'
          description: >-
            Details of telephony provider used for the call. Ex: Twilio, Plivo,
            Telnyx, etc.
        prompt_dynamic_variables:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Prompt Dynamic Variables
          description: >-
            Dynamic variables to used in the prompt. Ex: {'name': 'Bob',
            'appointment_day': 'tomorrow', 'reason': 'for confirmation of
            appointment'}
      type: object
      required:
        - conversation_id
        - contact_id
        - widget_id
        - assistant_id
        - direction
        - from_number
        - to_number
        - telephony_provider
      title: Call
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    TelephonyProviderCallDetails:
      properties:
        provider_name:
          $ref: '#/components/schemas/TelephonyProviderEnum'
          description: >-
            The telephone provider to use for the call. Ex: Twilio, Plivo,
            Telnyx, etc.
        call_id:
          type: string
          title: Call Id
          description: >-
            The ID of the telephony provider. Ex: Twilio CallSID, Plivo Call
            UUID, etc.
        response_body:
          additionalProperties: true
          type: object
          title: Response Body
          description: Complete response body from the telephony provider
      type: object
      required:
        - provider_name
        - call_id
        - response_body
      title: TelephonyProviderCallDetails
    TelephonyProviderEnum:
      type: string
      enum:
        - twilio
        - plivo
        - telnyx
        - sip
      title: TelephonyProviderEnum
  securitySchemes:
    Your API Key:
      type: apiKey
      description: >-
        Your API key for authentication. You can generate it from the
        **Settings** page. Format: starts with `in-`.
      in: query
      name: api_key
    HTTPBearer:
      type: http
      scheme: bearer

````