Make Outbound Call - API
Initiates an outbound SIP call using a configured Routing Rule. The call is associated with a room and participant. Supports advanced options like DTMF, audio recording, call duration, and SIP headers.
HTTP method and endpoint
POST
|
https://api.videosdk.live/v2/sip/call
Headers Parameters
REQUIRED
values: YOUR_TOKEN_WITHOUT_ANY_PREFIX
This will be a JWT token generate using VideoSDK ApiKey and Secret.
Note that the token will not include any prefix such as "Basic " or "Bearer ". Just pass a token as value.
You can generate a new token by refering this Guide: Generate Auth token
REQUIRED
values: application/json
This is usefull for json body parameters, so that VideoSDK servers can understand that the incoming body parameter will be a JSON string.
Body Parameters
REQUIRED
The caller ID number (E.164 format) to place the call from. Must be one of the numbers associated with the routing rule.
REQUIRED
The destination phone number (E.164 format).
REQUIRED
ID of the routing rule to use for this call.
OPTIONAL
OPTIONAL. The room ID where the call will connect. If not provided, the
roomId will be automatically derived from the routing rule configuration. OPTIONAL
Participant details (e.g., name, metadata) to be associated with the call.
OPTIONAL
Whether to record the call audio.
OPTIONAL
Wait until call is answered before connecting.
OPTIONAL
Maximum time (in seconds) to wait for the call to be answered before hanging up.
OPTIONAL
DTMF digits to send automatically after call connects.
OPTIONAL
Maximum call duration in seconds.
OPTIONAL
Media encryption preference (e.g.,
SRTP). If not provided, defaults to routing rule settings. OPTIONAL
Mask phone number for privacy.
OPTIONAL
Custom SIP headers to include in the call.
OPTIONAL
List of SIP headers to include from inbound INVITE in response events.
OPTIONAL
Custom metadata associated with the call.
Response Parameters
Confirmation message about the call status.
Unique ID of the call.
Current status of the call (e.g.,
INITIATED). Room ID associated with the call.
Destination number of the call.
Source number of the call.
Gateway ID used for the call.
Custom metadata associated with the call.
Array of status change logs with timestamps.
POST
|
https://api.videosdk.live/v2/sip/call
NodeJS
import fetch from 'node-fetch';
const options = {
method: "POST",
headers: {
"Authorization": "$YOUR_TOKEN",
"Content-Type": "application/json",
},
body: JSON.stringify({
"sipCallFrom" : "+14155550100",
"sipCallTo" : "+14155550199",
"routingRuleId" : "rr_2554md",
"destinationRoomId" : "room_123456",
"participant" : {"name":"John Doe"},
"recordAudio" : "true",
"waitUntilAnswered" : "false",
"ringingTimeout" : "30",
"dtmf" : "1234#",
"maxCallDuration" : "3600",
"mediaEncryption" : "SRTP",
"hidePhoneNumber" : "true",
"headers" : {"X-Custom-Header":"my-value"},
"includeHeaders" : ["User-Agent","X-Trace-Id"],
"metadata" : {"campaignId":"cmp_123","source":"crm"}
}),
};
const url= `https://api.videosdk.live/v2/sip/call`;
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
RESPONSE
{
"message": "Call initiated successfully",
"data": {
"callId": "call_123456789",
"status": "INITIATED",
"roomId": "room_123456",
"sipCallTo": "+14155550123",
"sipCallFrom": "+14155559876",
"gatewayId": "gw_123456789",
"metadata": {
"campaignId": "cmp_123",
"source": "crm"
},
"timelog": [
{
"status": "INITIATED",
"timestamp": "2025-08-21T11:45:00.000Z"
}
]
}
}
Got a Question? Ask us on discord