Manage Types
Read call types
- JavaScript
- Python
- cURL
client.video.listCallTypes();
//or
client.getCallType({ name: 'livestream' });
client.video.list_call_types()
# or
client.get_call_type(name= 'livestream')
curl -X GET "https://video.stream-io-api.com/api/v2/video/calltypes?api_key=${API_KEY}" \
-H "Authorization: ${TOKEN}" \
-H "stream-auth-type: jwt"
# or
curl -X GET "https://video.stream-io-api.com/api/v2/video/calltypes/${CALL_TYPE_NAME}?api_key=${API_KEY}" \
-H "Authorization: ${TOKEN}" \
-H "stream-auth-type: jwt"
Create call type
- JavaScript
- Python
- cURL
client.video.createCallType({
name: 'allhands',
settings: {
audio: { mic_default_on: true, default_device: 'speaker' },
},
grants: {
admin: [
VideoOwnCapability.SEND_AUDIO,
VideoOwnCapability.SEND_VIDEO,
VideoOwnCapability.MUTE_USERS,
],
user: [VideoOwnCapability.SEND_AUDIO, VideoOwnCapability.SEND_VIDEO],
},
});
client.video.create_call_type(
name= 'allhands',
settings = CallSettingsRequest(
audio=AudioSettingsRequest( mic_default_on= True, default_device ='speaker' ),
),
grants = {
"admin": [
OwnCapability.SEND_AUDIO.to_str(),
OwnCapability.SEND_VIDEO.to_str(),
OwnCapability.MUTE_USERS.to_str(),
],
"user": [OwnCapability.SEND_AUDIO.to_str(), OwnCapability.SEND_VIDEO.to_str()],
},
)
curl -X POST "https://video.stream-io-api.com/api/v2/video/calltypes?api_key=${API_KEY}" \
-H "Authorization: ${TOKEN}" \
-H "stream-auth-type: jwt" \
-H "Content-Type: application/json" \
-d '{
"name": "allhands",
"settings": {
"audio": { "mic_default_on": true, "default_device": "speaker" }
},
"grants": {
"admin": ["send-audio", "send-video", "mute-users"],
"user": ["send-audio", "send-video"]
}
}'
Update call type
- JavaScript
- Python
- cURL
- JavaScript@0.3 (deprecated)
client.video.updateCallType({
name: 'allhands',
settings: {
audio: { mic_default_on: false, default_device: 'earpiece' },
},
});
client.video.update_call_type(name='allhands',
settings= CallSettingsRequest(
audio=AudioSettingsRequest( mic_default_on= False, default_device= 'earpiece' ),
),
)
curl -X PUT "https://video.stream-io-api.com/api/v2/video/calltypes/${CALL_TYPE_NAME}?api_key=${API_KEY}" \
-H "Authorization: ${TOKEN}" \
-H "stream-auth-type: jwt" \
-H "Content-Type: application/json" \
-d '{
"settings": {
"audio": { "mic_default_on": false, "default_device": "earpiece" }
}
}'
client.video.updateCallType('allhands', {
settings: {
audio: { mic_default_on: false, default_device: 'earpiece' },
},
});
Delete call type
- JavaScript
- Python
- cURL
client.video.deleteCallType({ name: 'allhands' });
client.video.delete_call_type(name= 'allhands')
curl -X DELETE "https://video.stream-io-api.com/api/v2/video/calltypes/${CALL_TYPE_NAME}?api_key=${API_KEY}" \
-H "Authorization: ${TOKEN}" \
-H "stream-auth-type: jwt"