Create/update a role
This endpoint is used to create/modify a role.
POSThttps://api.100ms.live/v2/templates/<template_id>/roles/<role_name>
curl --location --request POST 'https://api.100ms.live/v2/templates/<template_id>/roles/<role_name>' \ --header 'Authorization: Bearer <management_token>' \ --header 'Content-Type: application/json' \ --data-raw '{ "publishParams": { "allowed": [ "audio", "video", "screen" ], "audio": { "bitRate": 32, "codec": "opus" }, "video": { "bitRate": 310, "codec": "vp8", "frameRate": 30, "width": 480, "height": 360 }, "screen": { "codec": "vp8", "frameRate": 10, "width": 1920, "height": 1080 }, "videoSimulcastLayers": {}, "screenSimulcastLayers": {} }, "subscribeParams": { "subscribeToRoles": [ "guest", "host" ], "maxSubsBitRate": 3200, "subscribeDegradation": { "packetLossThreshold": 25, "degradeGracePeriodSeconds": 1, "recoverGracePeriodSeconds": 4 } }, "permissions": { "endRoom": true, "removeOthers": true, "mute": true, "unmute": true, "changeRole": true, "sendRoomState": false }, "priority": 1, "maxPeerCount": 0 }'
RESPONSE
Status: 200 OK
{ "name": "testurlpath", "publishParams": { "allowed": ["audio", "video", "screen"], "audio": { "bitRate": 32, "codec": "opus" }, "video": { "bitRate": 310, "codec": "vp8", "frameRate": 30, "width": 480, "height": 360 }, "screen": { "codec": "vp8", "frameRate": 10, "width": 1920, "height": 1080 }, "videoSimulcastLayers": {}, "screenSimulcastLayers": {} }, "subscribeParams": { "subscribeToRoles": ["guest", "host"], "maxSubsBitRate": 3200, "subscribeDegradation": { "packetLossThreshold": 25, "degradeGracePeriodSeconds": 1, "recoverGracePeriodSeconds": 4 } }, "permissions": { "endRoom": true, "removeOthers": true, "mute": true, "unmute": true, "changeRole": true, "rtmpStreaming": true, "hlsStreaming": true, "browserRecording": true, "sendRoomState": false }, "priority": 1, "maxPeerCount": 0 }
Arguments
Name | Type | Description | Required |
---|---|---|---|
roleObject | object | Role object corresponding to the given role. check the roles object arguments section for the list of arguments supported | Yes |
name — path param | string | Providing a name renames the role to the provided name. If a role with the same name already exists, it gives an overwrite error. | Yes |
template_id — path param | string | Unique identifier of the template you wish to associate the role. Example: 627ce5b637300e55a72ba7ed | Yes |