Create Room Codes

Once you've created a Room via Create Room API, you need to create Room Codes to be able to create a Room Link and Join a Room. This API would automatically create Room Codes for any newly added Roles and would disable Room Codes for deleted Roles.

There are two ways to create Room Codes:

1. Create a Room Code API

Creates Room Code for every Role in the Room at once

POSThttps://api.100ms.live/v2/room-codes/room/<room_id>
curl --location --request POST 'https://api.100ms.live/v2/room-codes/room/<room_id>' \ --header 'Authorization: Bearer <management_token>' \ --header 'Content-Type: application/json' \
RESPONSE
Status: 200 OK
{ "data": [ { "code": "wpi-srjb-wer", "room_id": "329ek8g8f2e4g30487862vdb", "role": "host", "enabled": true, "created_at": "2023-03-14T15:54:18Z", "updated_at": "2023-03-14T15:54:20Z", }, { "code": "dfj-ewbe-oqw", "room_id": "329ek8g8f2e4g30487862vdb", "role": "guest", "enabled": true, "created_at": "2023-03-14T15:14:18Z", "updated_at": "2023-03-14T15:24:18Z", } ] }

Arguments

FieldTypeDescription
room_idstringmandatory

Errors

DescriptionCode
Room not found404
Room is disabled403
Authentication Error401

2. Create Role Room Code API

Creates a Room Code for a specific Role in a Room

POSThttps://api.100ms.live/v2/room-codes/room/<room_id>/role/<role>
curl --location --request POST 'https://api.100ms.live/v2/room-codes/room/<room_id>/role/<role>' \ --header 'Authorization: Bearer <management_token>' \ --header 'Content-Type: application/json' \

Arguments

FieldTypeDescription
room_idstringmandatory
rolestringmandatory

RESPONSE
Status: 200 OK
{ "code": "wet-qwgq-otr", "room_id": "329ek8g8f2e4g30487862vdb", "role": "host", "enabled": true, "created_at": "2023-03-14T15:14:18Z", "updated_at": "2023-03-17T02:24:10Z", }

Errors

DescriptionCode
Room not found404
Room is disabled403
Authentication Error401
Role not found404

Have a suggestion? Recommend changes ->

Run in postman

Was this helpful?

1234