logo
In-app Chat
ZIMAudio
On this page

MuteGroup

GET

https://zim-api.zego.im/

By calling this API, you can mute or unmute all members or certain group roles in a group.

After the API is successfully called, all users in the group will learn which roles cannot speak in the group or can resume speaking through the following ZIM SDK callback interfaces:

iOSAndroidmacOSWindows
groupMutedInfoUpdatedonGroupMutedInfoUpdatedgroupMutedInfoUpdatedonGroupMutedInfoUpdated
WebMini ProgramFlutterReact Native
groupMutedInfoUpdatedgroupMutedInfoUpdatedonGroupMutedInfoUpdatedgroupMutedInfoUpdated
uni-app | uni-app xHarmonyOS
groupMutedInfoUpdatedgroupMutedInfoUpdated
Note

If IsAllMuted, MuteRoleList, and Duration are all not passed, the mute status of all users in the group will be removed.

If Duration is non-zero and IsAllMuted is set to false, the passed MuteRoleList will overwrite the previously set muted role list.

The parameter FromUserId only supports numbers, English characters, and '!','#','$','%','&','(',')','+','\'',':',';','<','=','.','>','?', '@','[',']','^','_','{','}','|','~'.

If FromUserId is an administrator, MuteRoleList[] cannot contain 1 (group owner).

QPS Limit
20 times/s

Request

Query Parameters

    Action stringrequired

    Possible values: [MuteGroup]

    API prototype parameter

    https://zim-api.zego.im/?Action=MuteGroup

    AppId uint32required

    💡Public parameter. Application ID, assigned by ZEGOCLOUD. Get it from the ZEGOCLOUD Admin Console.

    SignatureNonce stringrequired

    💡Public parameter. A 16-character hexadecimal random string (hex encoding of 8-byte random number). Refer to Signature example for how to generate.

    Timestamp int64required

    💡Public parameter. Current Unix timestamp, in seconds. Refer to Signature example for how to generate, with a maximum error of 10 minutes.

    SignatureVersion stringrequired

    Possible values: [2.0]

    Default value: 2.0

    💡Public parameter. Signature version number.

    Signature stringrequired

    💡Public parameter. Signature, used to verify the legitimacy of the request. Refer to Signing the requests for how to generate an API request signature.

    FromUserId stringrequired

    Possible values: <= 32 characters

    Operator user ID (who has logged in to the ZIM service by calling the login method on the client, or has completed registration by calling the server-side API).

    Note

    Since the mute operation will trigger a group tips message, when FromUserId is not a group member, developers need to hide the message or implement other processing to avoid confusion among group users.

    GroupId stringrequired

    Possible values: <= 32 characters

    Group ID.

    IsAllMuted boolean

    Default value: false

    Whether to mute all members. Defaults to false if not passed.

    MuteRoleList number[]

    List of muted roles. A single request can mute up to 20 group roles. Enumeration as follows:

    • 1: Group owner.
    • 2: Administrator.
    • 3: Group member.
    • Other: Developer-defined group roles, recommended to be greater than 100.

    Only meaningful when IsAllMuted is false or not passed

    Duration number

    Mute duration. Defaults to 0 if not passed.

    • -1: Permanent.
    • 0: Cancel all mutes at the group level.
    • Greater than 0: Mute duration in seconds. Maximum support is 30 days (2,592,000 seconds). During the mute validity period, if the mute duration is set again, the mute status will be extended by the duration set in the most recent request.

Responses

OK
Schema
    Code number

    Return code.

    The following only lists the return codes related to the API business logic. For the complete return codes, please refer to Return codes.

    Return codeDescriptionSuggested Solution
    660000001General business error.Please retry or contact ZEGOCLOUD Technical Support.
    660000002Parameter error.Please check the request parameters.
    660300005The API call frequency exceeds the AppID-level limit.Please try again later.
    660600001Group does not exist.Please confirm if the GroupID is correct.
    660600009Failed to obtain group-related information.Please confirm if the GroupID is correct first. If correct, please contact ZEGOCLOUD Technical Support.
    660600024FromUserId is not in the group.Please check FromUserId or add FromUserId as a group member.
    660600032FromUserId does not have permission.FromUserId must be the group owner or administrator.
    Message string

    Description of the operation result.

    RequestId string

    Request ID.

Previous

Set group member roles

Next

Mute group members

On this page

Back to top