Skip to main content
Version: /v2

End Session

This API lets you end session by passing either roomId or sessionId as body parameters.
Body Parameters
REQUIRED
Your roomId or customRoomId.
OPTIONAL
Your sessionId
POST
|
https://api.videosdk.live/v2/sessions/end
import fetch from 'node-fetch';
const options = {
method: "POST",
headers: {
"Authorization": "$YOUR_TOKEN",
"Content-Type": "application/json",
},
body: JSON.stringify({"roomId" : "roomId","sessionId" : "sessionId"}),
};
const url= `https://api.videosdk.live/v2/sessions/end`;
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-lmnop",
"status": "ongoing",
"links": {
"get_room": "https://api.videosdk.live/v2/rooms/abcd-efgh-lmnop",
"get_session": "https://api.videosdk.live/v2/sessions/"
}
}