Skip to main content
Version: /v2

Switch Room within Call - API

Switches the room of a SIP call. This can be used to move a call from one room to another while the call is in progress.

HTTP method and endpoint

POST

|

https://api.videosdk.live/v2/sip/call/switch-room
Headers Parameters

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
Unique ID of the call.
REQUIRED
VideoSDK Room ID where the call will be switched.
OPTIONAL
VideoSDK Token which will be used to join the new session
Participant ID which will be used to join the new session
Response Parameters
Confirmation message about the call ended.
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/switch-room
import fetch from 'node-fetch';
const options = {
method: "POST",
headers: {
"Authorization": "$YOUR_TOKEN",
},
body: JSON.stringify({
"callId" : "adasd-asda-sdasd-asdas-dad",
"roomId" : "abcd-abcd-abcd",
"token" : "VideoSDK Token",
"participantId" : "participantId"
}),
};
const url= `https://api.videosdk.live/v2/sip/call/switch-room`;
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
RESPONSE
{
"statusCode": 200,
"data": {
"callId": "call_123456789",
"status": "answered",
"roomId": "room_123456",
"sipCallTo": "+14155550123",
"sipCallFrom": "+14155559876",
"gatewayId": "gw_123456789",
"metadata": {
"campaignId": "cmp_123",
"source": "crm"
},
"timelog": [
{
"status": "ANSWERED",
"timestamp": "2025-08-21T11:45:00.000Z"
}
]
}
}

Got a Question? Ask us on discord