logo
In-app Chat
Powered Byspreading
On this page

Mute group members


Overview

This interface allows you to mute or unmute specific members in a group.

After a successful API call, all users in the group will be notified through the following ZIM SDK callback interfaces to know which group members are unable to speak in the group or have their mute status lifted:

iOSAndroidmacOSWindows
groupMemberInfoUpdatedonGroupMemberInfoUpdatedgroupMemberInfoUpdatedonGroupMemberInfoUpdated
WebFlutterReact Native
groupMemberInfoUpdatedgroupMemberInfoUpdatedgroupMemberInfoUpdated

Operation prototype

  • Request method: GET
  • Request endpoint: https://zim-api.zego.im/?Action=MuteGroupMembers
  • Protocol: HTTPS
  • Rate limit: 20 times/second

Request parameters

The following list only shows the request parameters for this interface and some public parameters. For a complete list of public parameters, please refer to [Accessing Server APIs - Public parameters](../Accessing%20Server%20APIs.mdx#Public parameters).

ParameterTypeRequiredDescription
FromUserIdStringYesThe ID of the operating user.
GroupIdStringYesThe ID of the group.
UserIds[]Array of StringYesA list of user IDs to mute or unmute in the group. Up to 20 user IDs can be passed in a single request.
DurationNumberNoThe duration of the mute. If not passed, the default value is 0.
  • -1: Permanent mute.
  • 0: Cancel mute.
  • Greater than 0: Mute duration in seconds. The maximum duration is 30 days (2592000 seconds).
If the mute duration of a group member is still valid, calling this interface again to update the mute duration will restart the mute time from the time of the request.
Note

FromUserId and UserIds only support numbers, English characters, and the following special characters: '!', '#', '$', '%', '&', '(', ')', '+', '', ':', ';', '<', '=', '.', '>', '?', '@', '[', ']', '^', '_', '{', '}', '|', '~'.

Sample request

Untitled
https://zim-api.zego.im/?Action=MuteGroupMembers
&<Common Request Parameters>
&FromUserId=user1   
&GroupId=group
&UserIds[]=user2
&UserIds[]=user3
&Duration=100000
1
Copied!

Response parameters

ParameterTypeDescription
CodeNumberThe return code.
MessageStringThe description of the operation result.
RequestIdStringThe request ID.
ErrorUsersArray of Object

A list of failed users.

  • Code is 0:

    • ErrorUsers is empty, indicating that all specified users have been successfully muted/unmuted.
    • ErrorUsers is not empty, indicating that some users failed to be muted/unmuted. Please refer to SubCode for handling.
  • Code is not 0:

    • ErrorUsers is empty, indicating parameter error, interface rate limit, or system error.
    • ErrorUsers is not empty, indicating that all users failed to be muted/unmuted.
└UserIdStringThe ID of the failed user.
└SubCodeNumberThe specific return code for the failure.

Sample response

Untitled
{
    "Code": 0,
    "Message": "success",
    "RequestId": "343649807833778782"
}
1
Copied!

Return codes

The following list only shows the return codes related to the business logic of the interface. For a complete list of return codes, please refer to Return codes.

Return CodeDescriptionSuggested Action
660000001Business related general error.Please try again or contact ZEGOCLOUD Technical Support.
660000002Invaild parameter.The parameter entered is missing or invaild. Please check the parameters.
660300005The call frequency of the interface exceeds the AppID level limit.Please try again later.
660600001The group does not exist.Please check the GroupID.
660600009Failed to obtain group-related information.Please confirm the GroupID is correct. If it is correct, please contact ZEGO technical support.
660600024FromUserId is not in the group.Please check FromUserId or add FromUserId as a group member.
660600032FromUserId does not have permission.FromUserId needs to be the group owner or administrator.
660600033All specified user operations failed.Please check UserIds.

Previous

Mute a group

Next

Disband a group chat