100ms Logo

100ms

Docs

Search docs
/

Create via API

Creates a new room. This provides a more scalable way of creating a room.

POSThttps://api.100ms.live/v2/rooms
curl --location --request POST 'https://api.100ms.live/v2/rooms' \ --header 'Authorization: Bearer <management_token>' \ --header 'Content-Type: application/json' \ --data-raw '{ "name": "new-room-1662723668", "description": "This is a sample description for the room", "template_id": "<template_id of the template you wish to associate with the room>", "recording_info": { "enabled": true, "upload_info": { "type": "s3", "location": "<Name of the AWS s3 bucket>", "prefix": "<Upload prefix path>", "options": { "region": "<region of the s3 bucket>" }, "credentials": { "key": "<access key ID for the AWS account/S3 bucket>", "secret": "<secret access key for the AWS account/S3 bucket>" } } }, "region": "in" }'
RESPONSE
Status: 200 OK
{ "id": "631b2654f771854d9bf633df", "name": "new-room-1662723668", "enabled": true, "description": "This is a sample description for the room", "customer": "627cdddff2e4e30487862ad1", "recording_info": { "enabled": true, "upload_info": { "type": "s3", "location": "<Name of the AWS s3 bucket>", "prefix": "<Upload prefix path>", "credentials": { "key": "<access key ID for the AWS account/S3 bucket>", "secret": "<secret access key for the AWS account/S3 bucket>" }, "options": { "region": "<region of the s3 bucket>" } } }, "template_id": "63188115d11d6db790c73c60", "template": "new-template-1662550293", "region": "in", "created_at": "2022-09-09T11:41:08.082Z", "updated_at": "2022-09-09T11:41:08.074Z", "active": true }

Main Arguments

NameTypeDescriptionRequired
name
stringAn alias you can assign to 100ms rooms. This is case-insensitive.

Accepted characters are a-z, A-Z, 0-9, and . - : _. If not provided, this is generated automatically.

Note: Create room is called with an existing room name, then the corresponding room ID is returned.
No
description
stringA string to describe your room's usage. For example "9PM English Class Batch 2"No
template_id
stringTemplate ID of template you wish to associate with the room. You can get template ID either from the templates section on the dashboard or use the Template API.

Note: default template will be assigned if template is not specified in the create room request.
No
recording_info
objectObject of type recording_info. This object contains information for enabling recording/setting storage location for recordings.

Check the recording_info arguments below for more information.

Note: This argument is only applicable to enable/disable SFU recording. Refer to RTMP Streaming & Browser Recording guide for other options.
No
region
stringRegion in which you want to create room.

in - India
us - United States
eu - European Union
auto - Automatic region selection (default, and in case this parameter is not provided)
No

recording_info arguments

NameTypeDescriptionRequired
enabledbooleanEnable SFU recording. Disabled by defaultNo
upload_infoobjectObject of type upload_info. This object contains information on recordings storage location.

If you want to store recording with 100ms, and not use your own s3, don't add this to the object.

Check the upload_info object below for more information.
No

recording_info in the room acts as an atomic property. It depends on the recording settings defined in a template as below:

  • If the recording_info key is not provided in the API, the room will fill it with recording settings from the template. And the response body will include recording_source_template: true. This implies that whenever recording info is modified in the template, the recording settings for the room will also be updated.
  • If the recording_info key is provided in the API, the recording settings of the room won't be affected by the template at all.

To know more about recording please visit Recording.

upload_info arguments

NameTypeDescriptionRequired
typestringUpload Destination type. Currently, only s3 is supportedYes
locationstringName of the AWS s3 bucket in which you want to store all recordingsYes
prefixstringUpload prefix pathNo
optionsobjectAdditional configurations of type Options to be used for uploading.

Check the options arguments below for more information.
No
credentialsobjectObject of type Credentials. This is used to share AWS credentials to access the s3 bucket specified.

Check the credentials arguments below for more information.
No

Options arguments

NameTypeDescriptionRequired
regionstringRegion of the AWS account hosting the s3 bucket for storing recordings. If not provided it is assumed to be ap-south-1No

Credentials arguments

NameTypeDescriptionRequired
keystringaccess key ID for the AWS account hosting the s3 bucket for storing recordingsYes
secretstringsecret access key for the AWS account hosting the s3 bucket for storing recordingsYes

The access keys should have read(GetObject) and write(PutObject) permissions for the s3 bucket. For more details check - https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html