Skip to main content
Version: /v2

Remove Participant

This API lets you remove participant by passing roomId or sessionId and participantId as body parameters.
Body Parameters
The unique ID of participant.
REQUIRED
The ID of the room.
OPTIONAL
The ID of the session.
POST
|
https://api.videosdk.live/v2/sessions/participants/remove
import fetch from 'node-fetch';
const options = {
method: "POST",
headers: {
"Authorization": "$YOUR_TOKEN",
"Content-Type": "application/json",
},
body: JSON.stringify({"participantId" : "participantId","roomId" : "roomId","sessionId" : "sessionId"}),
};
const url= `https://api.videosdk.live/v2/sessions/participants/remove`;
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
RESPONSE
{
"start": "2022-03-29T05:21:42.829Z",
"end": null,
"participants": [
{
"_id": "62429767903bdf001299cacb",
"participantId": "demo-1",
"name": "John",
"timelog": [
{
"start": "2022-03-29T05:21:43.663Z",
"end": null
}
]
},
{
"_id": "62429771903bdf001299cae4",
"participantId": "demo-2",
"name": "William",
"timelog": [
{
"start": "2022-03-29T05:21:53.917Z",
"end": "2022-03-29T05:21:54.469Z"
}
]
}
],
"id": "62429766903bdf001299cac5",
"roomId": "abcd-efgh-lmno",
"status": "ongoing",
"links": {
"get_room": "https://api.videosdk.live/v2/rooms/abcd-efgh-lmno",
"get_session": "https://api.videosdk.live/v2/sessions/"
}
}