Skip to main content
Version: /v2

Create a Room

This API lets you create unique meetingId.

HTTP method and endpoint

POST

|

https://api.videosdk.live/v2/rooms
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
@discontinued

The region parameter has been discontinued; instead, the Video SDK's smart service will pick the best optimal servers for a conference, closest to your end-users' location. If you still need to hold your conferences in a specific region, i.e. Geo Fencing.

Contact Us

OPTIONAL

Customize Room id for better understanding.

OPTIONAL

values :

{
  'webhook': {
    'endPoint': 'your webhook endpoint',
    'events': ['webhook event type_1', 'webhook event type_2']
   }
}

You can subscribe from various events to get webhook.

  • participant-joined
  • participant-left
  • session-started
  • session-ended
  • recording-started
  • recording-stopped
  • livestream-started
  • livestream-stopped
  • hls-started
  • hls-playable
  • hls-stopped
    • Please refer this User webhooks for more information. All User webhooks endpoint must me a POST method in your api server / webhook server.

values :

{
  'autoCloseConfig': {
    'type': 'session-end-and-deactivate',
    'duration': 60
   }
}

This configuration will be used to automatically close the running session and also deactivate it, if configured.

  • type
    • session-ends: This will close the running session after provided duration.
    • session-end-and-deactivate: This will not only close the running session after provided duration but also deactivate the roomId. i.e. Only one session could be taken using this roomId, after that session ends no other session could be taken for the same roomId.
  • duration
    • This duration will be in minutes, and after that duration, your room will be closed. Default value is 480 minutes.
POST
|
https://api.videosdk.live/v2/rooms
import fetch from 'node-fetch';
const options = {
method: "POST",
headers: {
"Authorization": "$YOUR_TOKEN",
"Content-Type": "application/json",
},
body: JSON.stringify({"region" : "sg001","customRoomId" : "aaa-bbb-ccc","webhook" : "see example","autoCloseConfig" : "see example"}),
};
const url= `https://api.videosdk.live/v2/rooms`;
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
RESPONSE
{
"roomId": "abc-xyzw-lmno",
"customRoomId": "final-testing",
"userId": "5f7edbb14c938bcd42944527",
"disabled": false,
"createdAt": "2022-03-25T04:49:11.024Z",
"updatedAt": "2022-03-25T04:49:11.024Z",
"id": "623d49c760a18e699abcc8a4",
"links": {
"get_room": "https://api.videosdk.live/v2/rooms/abc-xyzw-lmno",
"get_session": "https://api.videosdk.live/v2/sessions/"
}
}

Got a Question? Ask us on discord