1. makecall (Make outbound call)
Epicode docs
  • IraVoice API
    • IraVoice API (2.0.0)
    • makecall (Make outbound call)
      • Make Call
        POST
    • makecalldirect
      • Make Call Direct
    • dropcall
      • Drop Call
    • stopstream
      • Stop Stream
    • bridgecalls
      • Bridge Calls
    • transfercall
      • Transfer Call
    • Schemas
      • BridgeCalls
      • DropCall
      • HTTPValidationError
      • MakeCall
      • MakeCallDirect
      • StopStream
      • TransferCall
      • ValidationError
  • Epicode Onboarding Guide
    • 📞 IraVoice Onboarding Guide
    • Sandbox Environment
    • Get started with BotCompose
  • BotCompose API
    • Introduction
  1. makecall (Make outbound call)

Make Call

POST
/api/makecall
Picks a IraVoice cluster based on the ratio of capacity assigned and queues the call in the IraCallScheduler in that cluster.
If the request is successful, response json will contain the call_uuid and cluster name the call was placed in.
In the JSON payload, call_params can be used to control streaming, event webhook, inactivity behavior etc as explained below.

Call Params#

Example:
{
    "stream_on_cpa_events": ["LV"],
    "drop_on_cpa_events": ["AM", "FX"],

    "websocket_host": "bot.example.com",
    "websocket_port": 8443,
    "websocket_app": "voicebot",

    "streaming_useraudio": true,
    "stream_frame_size_ms": 200,

    "stt_sampling_rate": 16000,
    "tts_sampling_rate": 16000,

    "bot_inactivity_limit": 30,

    "event_url": "https://events.example.com/calls",

    "disable_recording": false
}

Call Progress Analysis (CPA)#

Only applicable for outbound calls where the makecall payload has the cpa_config parameter set.
IraCPA will analyze the first 1.75 seconds of call audio and identify if the call is answered by a Human(LV) / Answering machine(AM) / Fax machine(FX). It can also detect silence(SL) and beeps(BP).
Automatic actions will be taken based on the configured stream_on_cpa_events and drop_on_cpa_events parameters.
To know more about IraCPA, follow link.
ParameterTypeDescription
stream_on_cpa_eventsarrayStreams call media to the configured WebSocket endpoint when CPA event matches any value.
Default: ["LV"].
drop_on_cpa_eventsarrayTerminates the call when CPA event matches any value.
Default: ["FX","AM"].

WebSocket Streaming#

Connects to websocket server specified. Streams audio from the call to the WebSocket server and plays audio received from the WebSocket server into the call. The WebSocket message model is explained in detail in the WebSocket Message Model section below.
ParameterTypeDescription
websocket_hoststringHostname of the WebSocket server to which IraVoice will stream call media.
Requires websocket_port and websocket_app.
websocket_portintegerPort of the WebSocket server.
Used only if websocket_host is set.
websocket_appstringPath name used to construct the WebSocket endpoint.
Used with websocket_host and websocket_port.
stream_frame_size_msintegerAudio chunk duration in milliseconds.
Default: 200ms. Minimum: 20ms.
Chunking is time-based (not packet-based).
stt_sampling_rateintegerSampling rate (Hz) for audio sent from IraVoice → AI Orchestration.
Range: 8000-48000.
tts_sampling_rateintegerSampling rate (Hz) for audio sent from AI Orchestration → IraVoice.
Range: 8000-48000.

Bot Inactivity#

Drops the call if no audio is received from the WebSocket server for a continuous duration specified in bot_inactivity_limit parameter.
Disabled if bot_inactivity_limit is not set or set to 0.
ParameterTypeDescription
bot_inactivity_limitintegerDuration in seconds to wait before dropping the call due to bot inactivity.
Default: 0 (disabled).

Webhooks & Events#

ParameterTypeDescription
event_urlstringHTTP webhook endpoint to receive call lifecycle events via POST
(started, ringing, answered, hangup, etc.).
If set, events are always emitted.

Recording#

ParameterTypeDescription
disable_recordingbooleanDisables call recording when set to true. Default: false
( all calls are recorded by default).

WebSocket Endpoint Example#

InputResult
websocket_host = test.example.com
websocket_port = 8443
websocket_app = myapp
wss://test.example.com:8443/myapp

Critical Constraints#

TopicDetail
Transport SecurityOnly wss:// is supported. ws:// is rejected. Your WebSocket server must have a valid SSL certificate.
WebSocket ProtocolSee WebSocket Message Model for message structure.
Webhook SchemaSee Webhook Event URL Payload for payload format.

Request

Authorization
Bearer Token
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
or
Body Params application/jsonRequired

Examples

Responses

🟢200
application/json
Call request accepted and scheduled successfully
Bodyapplication/json

🟠400
🟠403
🟠404
🟠409
🟠422
🔴500
🔴503
Request Request Example
Shell
JavaScript
Java
Swift
curl --location '/api/makecall' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
    "campaign_name": "Harriet Jacobs",
    "from_number": "1234567890",
    "to_number": "123456790",
    "call_params": {
        "stream_on_cpa_events": [
            "LV"
        ],
        "drop_on_cpa_events": [
            "AM",
            "FX"
        ],
        "websocket_host": "bot.example.com",
        "websocket_port": 8443,
        "websocket_app": "voicebot",
        "streaming_useraudio": true,
        "stream_frame_size_ms": 200,
        "stt_sampling_rate": 16000,
        "tts_sampling_rate": 16000,
        "bot_inactivity_limit": 30,
        "event_url": "https://events.example.com/calls",
        "disable_recording": false
    },
    "channel_vars": {},
    "cpa_config": "",
    "dial_timeout": 30
}'
Response Response Example
200 - Success
{
    "status_code": 0,
    "status": "OK",
    "call_uuid": "123e4567-e89b-12d3-a456-426614174000",
    "cluster": "cluster1"
}
Modified at 2026-05-25 10:28:00
Previous
IraVoice API (2.0.0)
Next
Make Call Direct
Built with