Skip to main content
Version: /v2

Remove Participant

This API lets you remove participant by passing roomId or sessionId and participantId as body parameters.

HTTP method and endpoint

POST

|

https://api.videosdk.live/v2/sessions/participants/remove
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
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/"
}
}

Got a Question? Ask us on discord