Queries the users in a group.

Usage notes

This topic provides an example on how to query the users in the group g-00jqzghi2n3o5hkh****. The returned result shows that the group contains the user Alice and the user user1.


You can call this operation up to 100 times per second per account. This operation is globally limited to 100 times per second across all accounts. If the number of the calls per second exceeds a limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limits when you call this operation.


OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes ListGroupMembers

The operation that you want to perform. Set the value to ListGroupMembers.

GroupId String Yes g-00jqzghi2n3o5hkh****

The ID of the group.

DirectoryId String Yes d-00fc2p61****

The ID of the directory.

NextToken String No K1c3o9K7pFxoTtxH1Nm7MMLb7zrDGvftYBQBPDVv7AD3a8yhRb3Mk8L9ivmN6bFSjfkZNTAg3h4****

The token to return for the next page. If this is your first time to call this operation, you do not need to specify NextToken .

When you call this operation for the first time, if the total number of entries to return exceeds the value of MaxResults, the entries are truncated. Only the entries that match the value of MaxResults are returned, and the excess entries are not returned. In this case, the value of the response parameter IsTruncated is true, and NextToken is returned. In the next call, you can use the value of NextToken and maintain the settings of the other request parameters to query the excess entries. You can repeat the call until the value of IsTruncated becomes false. This way, all entries are returned.

MaxResults Integer No 10

The number of entries to return on each page.

Valid values: 1 to 100.

Default value: 10.

For more information about common request parameters, see Common parameters.

Response parameters

Parameter Type Example Description
NextToken String K1c3o9K7pFxoTtxH1Nm7MMLb7zrDGvftYBQBPDVv7AD3a8yhRb3Mk8L9ivmN6bFSjfkZNTAg3h4****

The token that is returned for the next page.

Note This parameter is returned only when the value of IsTruncated is true.
RequestId String BB759F84-2C64-5C36-B6C6-253172C5C370

The ID of the request.

TotalCounts Integer 2

The total number of entries returned.

MaxResults Integer 10

The number of entries returned per page.

IsTruncated Boolean false

Indicates whether the queried entries are truncated. Valid values:

  • true: The queried entries are truncated.
  • false: The queried entries are not truncated.
GroupMembers Array of GroupMember

The users in the group.

Status String Enabled

The status of the user. Valid values:

  • Enabled: The logon of the user is enabled.
  • Disabled: The logon of the user is disabled.
UserName String Alice

The name of the user.

Email String AliceLee@example.com

The email address of the user.

Description String This is a user.

The description of the user.

UserId String u-00q8wbq42wiltcrk****

The ID of the user.

ProvisionType String Manual

The type of the user. Valid values:

  • Manual: The user is manually created.
  • Synchronized: The user is synchronized from an external identity provider (IdP).
DisplayName String Alice

The display name of the user.

JoinTime String 2021-11-01T06:58:18Z

The time when the user was added to the user group.

GroupId String g-00jqzghi2n3o5hkh****

The ID of the group.


Sample requests

&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK

			<Description>This is a user.</Description>

JSON format

HTTP/1.1 200 OK

  "RequestId" : "BB759F84-2C64-5C36-B6C6-253172C5C370",
  "TotalCounts" : 2,
  "MaxResults" : 10,
  "IsTruncated" : false,
  "GroupMembers" : [ {
    "Status" : "Enabled",
    "UserName" : "Alice",
    "Email" : "AliceLee@example.com",
    "Description" : "This is a user.",
    "UserId" : "u-00q8wbq42wiltcrk****",
    "ProvisionType" : "Manual",
    "DisplayName" : "Alice",
    "JoinTime" : "2021-11-01T06:58:18Z",
    "GroupId" : "g-00jqzghi2n3o5hkh****"
  }, {
    "Status" : "Enabled",
    "UserName" : "user1",
    "Email" : "",
    "Description" : "",
    "UserId" : "u-00pkfll14gwm1mb9****",
    "ProvisionType" : "Manual",
    "DisplayName" : "",
    "JoinTime" : "2021-11-01T07:37:14Z",
    "GroupId" : "g-00jqzghi2n3o5hkh****"
  } ]

Error codes

For a list of error codes, visit the API Error Center.