tencent cloud


Deleting Group Members

Last updated: 2022-01-14 17:46:17

    Feature Description

    This API is used by app admins to delete group members.

    API Calling Description

    Applicable group types

    Group Type ID Is this RESTful API Supported?
    Private Yes. Same as Work (work group for friends) in the new version.
    Public Yes.
    ChatRoom Yes. Same as Meeting (temporary meeting group) in the new version.
    AVChatRoom No.

    These are the 4 built-in group types in IM. For detailed information, see the Group System.


    AVChatRooms (livestreaming groups) do not support deleting group members. If you attempt to delete members of an AVChatRoom group, error 10004 will be returned. To achieve the effect of deleting members, admins can batch mute and unmute group members.

    Sample request URL


    Request parameters

    The list below contains only the parameters commonly used when calling this API and their descriptions. For more parameters, see RESTful API Overview.

    Parameter Description
    https The request protocol is HTTPS, and the request method is POST.
    xxxxxx The country/region where your SDKAppID is located.
  • China: console.tim.qq.com
  • Singapore: adminapisgp.im.qcloud.com
  • Seoul: adminapikr.im.qcloud.com
  • Frankfurt: adminapiger.im.qcloud.com
  • India: adminapiind.im.qcloud.com
  • v4/group_open_http_svc/delete_group_member Request API
    sdkappid SDKAppID assigned by the IM console when the application is created
    identifier The value must be the app admin account. For more information, see App Admins.
    usersig Signature generated by the app admin account. For details on how to generate the signature, see Generating UserSig.
    random A random 32-bit unsigned integer ranging from 0 to 4294967295
    contenttype Request format. The value is always json.

    Maximum calling frequency

    The maximum calling frequency is 200 calls per second.

    Sample request packet

    • Basic form
      Delete up to 100 group members in one request. The backend sends system deletion notifications to all group members by default, except for Private (work group for friends, same as Work in the new version) groups.
      Even if the user to be deleted is not in the group, the API will still return success.
       "GroupId": "@TGS#2J4SZEAEL", // Target group (required)
       "MemberToDel_Account": [ // List of group members to be deleted. A maximum of 100 members can be deleted.
    • Silent deletion
      When Silence is set to 1, the system will not notify anyone after successfully deleting a member.
       "GroupId": "@TGS#2J4SZEAEL", // Target group (required)
       "Silence": 1, // Whether to delete silently (optional)
       "MemberToDel_Account": [ // List of group members to be deleted. A maximum of 100 members can be deleted.
    • Specify the reason for removal
      Specify the reason for removing a user from a group, which will be reflected in the delivered notification.
       "GroupId": "@TGS#2J4SZEAEL", // Target group (required)
       "Reason": "kick reason", // Reason for removing the member from the group (optional)
       "MemberToDel_Account": [ // List of group members to be deleted. A maximum of 100 members can be deleted.

    Request packet fields

    Field Type Required Description
    GroupId String Required ID of the target group
    Silence Integer Optional Whether to adopt silent deletion. 0: no, 1: yes. Silent deletion means that no members in the group, except the deleted member, will be notified when a group member is deleted. The default value of this field is 0.
    Reason String Optional Reason for removing the member from the group
    MemberToDel_Account Array Required Group members to be deleted

    Sample response packet body

       "ActionStatus": "OK",
       "ErrorInfo": "",
       "ErrorCode": 0

    Response packet fields

    Field Type Description
    ActionStatus String Result of the request. OK indicates that the request was successful, and FAIL indicates that the request failed.
    ErrorCode Integer Error code. 0 indicates that the request was successful, and any non-zero value indicates that the request failed.
    ErrorInfo String Detailed error information

    Error Codes

    Unless a network error (such as error 502) occurs, the returned HTTP status code for this API is always 200. The specific error code and details can be found in the response packet fields such as ErrorCode and ErrorInfo.
    For public error codes (60000 to 79999), see Error Codes.
    The list below contains error codes specific to this API:

    Error Code Description
    10002 An internal server error occurred. Please try again.
    10003 The request command word is invalid.
    10004 A parameter is invalid. Check the error description and troubleshoot the issue.
    10007 The operation permissions are insufficient. For example, to remove someone from a public group requires admin permissions.
    10010 The group does not exist, or once existed but has been disbanded.
    10015 The group ID is invalid. Be sure to use the correct group ID.

    API Debugging Tool

    Use the online debugging tool for RESTful APIs to debug this API.


    Adding a group member (v4/group_open_http_svc/add_group_member)

    Possible Callbacks

    Callback when a group member quits

    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support