Skip to main content
Version: /v2

End Session - API

This API lets you end session by passing either roomId or sessionId as body parameters.

HTTP method and endpoint

POST

|

https://api.videosdk.live/v2/sessions/end
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
Your roomId
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/"
}
}

Got a Question? Ask us on discord