You can also mute every other participant’s video or audio.
// You can specify which kind of stream(s) to mutecall.muteUsers({ mute_all_users: true, audio: true, muted_by_id: "john",});
# You can specify which kind of stream(s) to mutecall.mute_users( mute_all_users=True, audio=True,)
// You can specify which kind of stream(s) to mutecall.MuteUsers(ctx, &getstream.MuteUsersRequest{ MuteAllUsers: getstream.PtrTo(true), Audio: getstream.PtrTo(true), MutedByID: getstream.PtrTo("john"),})
It's possible for users to ask for any of the following permissions:
Sending audio
Sending video
Sharing their screen
This feature is very common in audio rooms where users usually have to request permission to speak, but it can be useful in other call types and scenarios as well.
These requests will trigger the call.permission_request webhook.
Users can be banned, when doing that they are not allowed to join or create calls. Banned users also cannot ring or notify other users.
client.moderation.ban({ target_user_id: "<bad user id>", banned_by_id: "<moderator id>", reason: "<reason>",});// remove the ban for a userclient.moderation.unban({ target_user_id: "<user id>",});// ban a user for 30 minutesclient.moderation.ban({ target_user_id: "<bad user id>", banned_by_id: "<moderator id>", timeout: 30,});// ban a user and all users sharing the same IPclient.moderation.ban({ target_user_id: "<bad user id>", banned_by_id: "<moderator id>", reason: "<reason>", ip_ban: true,});
# ban a userclient.ban( target_user_id=bad_user.id, banned_by_id=moderator.id, reason="banned reason here",)# remove the ban for a userclient.unban(target_user_id=bad_user.id)# ban a user for 30 minutesclient.ban( target_user_id=bad_user.id, banned_by_id=moderator.id, timeout=30,)# ban a user and all users sharing the same IPclient.ban( target_user_id=bad_user.id, banned_by_id=moderator.id, reason="Banned user and all users sharing the same IP for half hour", ip_ban=True,)
# Ban a usercurl -X POST https://video.stream-io-api.com/api/v2/moderation/ban?api_key=${API_KEY} \ -H "Authorization: ${TOKEN}" \ -H "stream-auth-type: jwt" \ -H "Content-Type: application/json" \ -d '{ "target_user_id": "sara", "banned_by_id": "john", "reason": "banned reason here" }'# Removes ban for usercurl -X DELETE https://video.stream-io-api.com/api/v2/moderation/ban?api_key=${API_KEY} \ -H "Authorization: ${TOKEN}" \ -H "stream-auth-type: jwt" \ -H "Content-Type: application/json" \ -d '{ "target_user_id": "sara" }'# Ban a user for 30 minutescurl -X POST https://video.stream-io-api.com/api/v2/moderation/ban?api_key=${API_KEY} \ -H "Authorization: ${TOKEN}" \ -H "stream-auth-type: jwt" \ -H "Content-Type: application/json" \ -d '{ "target_user_id": "sara", "banned_by_id": "john", "timeout": 30 }'# Ban a user and all users sharing the same IPcurl -X POST https://video.stream-io-api.com/api/v2/moderation/ban?api_key=${API_KEY} \ -H "Authorization: ${TOKEN}" \ -H "stream-auth-type: jwt" \ -H "Content-Type: application/json" \ -d '{ "target_user_id": "sara", "banned_by_id": "john", "ip_ban": true }'
Deactivated users are no longer able to make any API call or connect to websockets (and receive updates on event of any kind).
client.deactivateUser({ user_id: '<id>',});// reactivateclient.reactivateUsers({ user_ids: ['<id>'],});// deactivating users in bulk is performed asynchronouslyconst deactivateResponse = client.deactivateUsers({ user_ids: ['<id1>', '<id2>'...],});
# deactivate one userclient.deactivate_user(user_id=alice.id)# reactivates the userclient.reactivate_user(user_id=alice.id)# deactivating users in bulk is performed asynchronouslyresponse = client.deactivate_users(user_ids=[alice.id, bob.id])
// deactivate one userresponse, err := client.DeactivateUser(ctx, "alice", &getstream.DeactivateUserRequest{})// reactivates the user_, err = client.ReactivateUser(ctx, "alice", &getstream.ReactivateUserRequest{})// deactivates users in bulk, this is an async operation_, err = client.DeactivateUsers(ctx, &getstream.DeactivateUsersRequest{ UserIds: []string{"alice", "bob"},})
// deactivate one userclient.deactivateUser("john", DeactivateUserRequest.builder().build()).execute();// reactivates the userclient.reactivateUser("john", ReactivateUserRequest.builder().build()).execute();// deactivates users in bulk, this is an async operationclient.deactivateUsers(DeactivateUsersRequest.builder().userIds(List.of("<id1>", "<id2>")).build()).execute();
Deactivating users in bulk can take some time, this is how you can check the progress:
// Example of monitoring the status of an async task// The logic is same for all async tasksconst response = await client.exportUsers({ user_ids: ["<user id1>", "<user id1>"],});// you need to poll this endpointconst taskResponse = await client.getTask({ id: response.task_id });console.log(taskResponse.status === "completed");
# Example of monitoring the status of an async task# The logic is same for all async tasksresponse = client.export_users(user_ids=["<user id1>", "<user id1>"])task_id = response.data.task_id# get information about the tasktask_status = client.get_task(task_id)# just an example, in reality it can take a few seconds for a task to be processedif task_status.data.status == "completed": print(task_status.data.result)
// Example of monitoring the status of an async task// The logic is same for all async tasksresponse, err := client.ExportUsers(ctx, &getstream.ExportUsersRequest{ UserIds: []string{"<user id1>", "<user id1>"},})taskID := response.Data.TaskID// get information about the tasktaskStatus, err := client.GetTask(ctx, taskID, &getstream.GetTaskRequest{})// just an example, in reality it can take a few seconds for a task to be processedif taskStatus.Data.Status == "completed" { println("Export is completed")}
var response = client.exportUsers(ExportUsersRequest.builder().userIds(List.of("user-id1", "user-id2")).build()).execute();var taskID = response.getData().getTaskID();// get information about the taskvar taskStatus = client.getTask(taskID).execute();// just an example, in reality it can take a few seconds for a task to be processedif (taskStatus.getData().getStatus().equals("completed")) { System.out.println("Export is completed");}
# When an operation is async, a task_id will be included in the API response# That task_id can be used to monitor the status of the task# When finished, task status will be completedcurl -X GET https://video.stream-io-api.com/api/v2/tasks/${TASK_ID}?api_key=${API_KEY} \ -H "Authorization: ${TOKEN}" \ -H "stream-auth-type: jwt"
# alice blocks bobclient.block_users(blocked_user_id=bob.id, user_id=alice.id)# list blocked users by aliceresponse = client.get_blocked_users(user_id=alice.id)# alice unblocks bobclient.unblock_users(blocked_user_id=bob.id, user_id=alice.id)
// alice blocks bobclient.BlockUsers(ctx, &getstream.BlockUsersRequest{ BlockedUserID: "bob.ID", UserID: &alice.ID,})// list blocked users by aliceresponse, err := client.GetBlockedUsers(ctx, &getstream.GetBlockedUsersRequest{ UserID: &alice.ID,})// alice unblocks bobclient.UnblockUsers(ctx, &getstream.UnblockUsersRequest{ BlockedUserID: bob.ID, UserID: &alice.ID,})