Queries the groups to which a user is added.

Usage notes

This topic provides an example on how to query the groups to which the user u-00q8wbq42wiltcrk**** is added. The returned result shows that the user is added to both the TestGroup and the group1 groups.


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 ListJoinedGroupsForUser

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

UserId String Yes u-00q8wbq42wiltcrk****

The ID of the user.

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 E9BBB45F-7877-5DE9-96A5-20E6CFA48929

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.
JoinedGroups Array of JoinedGroup

The groups to which the user is added.

GroupName String TestGroup

The name of the group.

Description String This is a group.

The description of the group.

UserId String u-00q8wbq42wiltcrk****

The ID of the user.

ProvisionType String Manual

The type of the group. Valid values:

  • Manual: The group is manually created.
  • Synchronized: The user is synchronized from an external identity provider (IdP).
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 group.</Description>

JSON format

HTTP/1.1 200 OK

  "RequestId" : "E9BBB45F-7877-5DE9-96A5-20E6CFA48929",
  "TotalCounts" : 2,
  "MaxResults" : 10,
  "IsTruncated" : false,
  "JoinedGroups" : [ {
    "GroupName" : "TestGroup",
    "Description" : "This is a group.",
    "UserId" : "u-00q8wbq42wiltcrk****",
    "ProvisionType" : "Manual",
    "JoinTime" : "2021-11-01T06:58:18Z",
    "GroupId" : "g-00jqzghi2n3o5hkh****"
  }, {
    "GroupName" : "group1",
    "Description" : "",
    "UserId" : "u-00q8wbq42wiltcrk****",
    "ProvisionType" : "Synchronized",
    "JoinTime" : "2021-11-01T07:16:44Z",
    "GroupId" : "g-00dd217ozcicxqz0****"
  } ]

Error codes

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