Update a template
This endpoint is used to modify a Template. Updating the template involves a three-step process:
| Deprecation Notice: The settings.enabled
field which was used to enable custom composite recording, has been deprecated. Please use the new recordings API to configure composite recordings.
| Deprecation Notice: The destinations.browserRecordings
field which was used to provide configuration for browser based recording, has been deprecated. Please use the new recordings API to configure browser recording.
- Use the Get API to retrieve the template object.
- Modify the template object to update it.
- Use this API to post the updated object as the request body.
When updating a template object, please provide all fields, even if only some fields are being modified. This method overwrites all fields.
Understand sub-objects hierarchy
Refer to the sub-objects attributes here
curl --location --request POST 'https://api.100ms.live/v2/templates/6316d5ca5a2635a5849a0216' \ --header 'Authorization: Bearer <management_token>' \ --header 'Content-Type: application/json' \ --data-raw '{ "name": "new-template-1662552998", "roles": { "guest": { "name": "guest", "publishParams": { "allowed": ["audio", "video", "screen"], "audio": { "bitRate": 32, "codec": "opus" }, "video": { "bitRate": 300, "codec": "vp8", "frameRate": 30, "width": 480, "height": 360 }, "screen": { "codec": "vp8", "frameRate": 10, "width": 1920, "height": 1080 }, "simulcast": { "video": { "layers": [ { "rid": "f", "scaleResolutionDownBy": 1, "maxBitrate": 700, "maxFramerate": 25 }, { "rid": "h", "scaleResolutionDownBy": 2, "maxBitrate": 350, "maxFramerate": 25 }, { "rid": "q", "scaleResolutionDownBy": 4, "maxBitrate": 100, "maxFramerate": 25 } ] }, "screen": {} } }, "subscribeParams": { "subscribeToRoles": ["host", "guest"], "maxSubsBitRate": 3200, "subscribeDegradation": { "packetLossThreshold": 25, "degradeGracePeriodSeconds": 1, "recoverGracePeriodSeconds": 4 } }, "permissions": { "rtmpStreaming": true, "hlsStreaming": true, "browserRecording": true, "sendRoomState": false, "pollRead": true, "pollWrite": true }, "priority": 1, "maxPeerCount": 0 }, "host": { "name": "host", "publishParams": { "allowed": ["audio", "video", "screen"], "audio": { "bitRate": 32, "codec": "opus" }, "video": { "bitRate": 300, "codec": "vp8", "frameRate": 30, "width": 480, "height": 360 }, "screen": { "codec": "vp8", "frameRate": 10, "width": 1920, "height": 1080 }, "simulcast": { "video": { "layers": [ { "rid": "f", "scaleResolutionDownBy": 1, "maxBitrate": 700, "maxFramerate": 25 }, { "rid": "h", "scaleResolutionDownBy": 2, "maxBitrate": 350, "maxFramerate": 25 }, { "rid": "q", "scaleResolutionDownBy": 4, "maxBitrate": 100, "maxFramerate": 25 } ] }, "screen": {} } }, "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, "pollRead": true, "pollWrite": true }, "priority": 1, "maxPeerCount": 0 } }, "settings": { "region": "in", "recording": null, "roomState": { "messageInterval": 5, "sendPeerList": false, "stopRoomStateOnJoin": true, "enabled": false }, "retry": {} }, "destinations": {}, }'
{ "id": "6316d5ca5a2635a5849a0216", "name": "new-template-1662552988", "customerId": "627cdddff2e4e30487862ad1", "roles": { "guest": { "name": "guest", "publishParams": { "allowed": ["audio", "video", "screen"], "audio": { "bitRate": 32, "codec": "opus" }, "video": { "bitRate": 300, "codec": "vp8", "frameRate": 30, "width": 480, "height": 360 }, "screen": { "codec": "vp8", "frameRate": 10, "width": 1920, "height": 1080 }, "simulcast": { "video": { "layers": [ { "rid": "f", "scaleResolutionDownBy": 1, "maxBitrate": 700, "maxFramerate": 25 }, { "rid": "h", "scaleResolutionDownBy": 2, "maxBitrate": 350, "maxFramerate": 25 }, { "rid": "q", "scaleResolutionDownBy": 4, "maxBitrate": 100, "maxFramerate": 25 } ] }, "screen": {} } }, "subscribeParams": { "subscribeToRoles": ["host", "guest"], "maxSubsBitRate": 3200, "subscribeDegradation": { "packetLossThreshold": 25, "degradeGracePeriodSeconds": 1, "recoverGracePeriodSeconds": 4 } }, "permissions": { "rtmpStreaming": true, "hlsStreaming": true, "browserRecording": true, "sendRoomState": false, "pollRead": true, "pollWrite": true }, "priority": 1, "maxPeerCount": 0 }, "host": { "name": "host", "publishParams": { "allowed": ["audio", "video", "screen"], "audio": { "bitRate": 32, "codec": "opus" }, "video": { "bitRate": 300, "codec": "vp8", "frameRate": 30, "width": 480, "height": 360 }, "screen": { "codec": "vp8", "frameRate": 10, "width": 1920, "height": 1080 }, "simulcast": { "video": { "layers": [ { "rid": "f", "scaleResolutionDownBy": 1, "maxBitrate": 700, "maxFramerate": 25 }, { "rid": "h", "scaleResolutionDownBy": 2, "maxBitrate": 350, "maxFramerate": 25 }, { "rid": "q", "scaleResolutionDownBy": 4, "maxBitrate": 100, "maxFramerate": 25 } ] }, "screen": {} } }, "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, "pollRead": true, "pollWrite": true }, "priority": 1, "maxPeerCount": 0 } }, "settings": { "region": "in", "recording": null, "roomState": { "messageInterval": 5, "sendPeerList": false, "stopRoomStateOnJoin": true, "enabled": false }, "retry": {} }, "destinations": {}, "createdAt": "0001-01-01T00:00:00Z", "updatedAt": "0001-01-01T00:00:00Z", "_id": "6316d5ca5a2635a5849a0216", "customer": "627cdddff2e4e30487862ad1" }
Arguments
Name | Type | Description | Required |
---|---|---|---|
template_id — path param | string | Unique identifier of the template you wish to update. Example: 627ce5b637300e55a72ba7ed | Yes |
roles | object | Modified map of {roleName:roleObject} . Since this is a POST request, you need to provide the whole roles object to modify/persist/override it. check the roles object arguments section for the list of arguments supported | Yes |
settings | object | Modified settings. Since this is a POST request, you need to provide the whole settings object to modify/persist/override it. check the settings object arguments section for the list of arguments supported | Yes |
name | string | If you don't provide the name , earlier provided name is used. Trying to modify a template's name to match another existing template's name produces overwrite error. | No |
destinations | object | Modified destinations. Since this is a POST request, you need to provide the whole destinations object to modify/persist/override it. check the destinations object arguments section for the list of arguments supported | No |