GET/users/{userId}/groups

Gets a list of groups the member belongs to.

  • membershipType=ALL (default): Also includes groups the member belongs to indirectly through an organization or another group. Also includes cases where the member is a group administrator but not a group member.
  • membershipType=DIRECT: Returns only groups the member is directly registered in.

Authorization

oauth2

OAuth 2.0 authentication.
For more information, see Authentication and Authorization.

Scope

directory
directory.read
user
user.read

HTTP Request

GEThttps://www.worksapis.com/v1.0/users/{userId}/groups

Path Parameters

ParameterTypeDescription
userId string 

Member ID
- Email address
- Resource ID
- External key in "externalKey:{externalKey}" format


required
example : userf7da-f82c-4284-13e7-030f3b4c756x 

Query Parameters

ParameterTypeDescription
count integer 

Number of items to retrieve


default : 100
minimum : 1
maximum : 100
example : 100
format : int32 
cursor string 

Cursor value


example : JlIBsfJogXpzDGY8OscZziqZpYqCAu3RbZbaFzBb1od6lWQtSdPUd2FIdCuaGgu8DA== 
membershipType string 

ALL (default): Also includes groups the member belongs to indirectly through an organization or another group. Also includes cases where the member is a group administrator but not a group member.
DIRECT: Returns only groups the member is directly registered in.


default : ALL
Allowed values : DIRECT, ALL 

Header Parameters

HeadertypeDescription
Authorization string 

Bearer {token}


required 

Response

HTTP 200

OK

PropertyTypeDescription
groups array (UserGroup) 

List of group information

 
responseMetaData object (responseMetaData) 

Response metadata

 

UserGroup

PropertyTypeDescription
groupId string 

Group ID


readOnly : true 
domainId integer 

Domain ID


format : int32 
groupName string 

Group name

 
isGroupAdministrator boolean 

Indicates whether the member is an administrator of the group.

 
isGroupMember boolean 

Indicates whether the member is a member of the group. May be false when membershipType=ALL and the member is a group administrator but not a group member.

 

responseMetaData

PropertyTypeDescription
nextCursor string 

Cursor value for pagination

 

Response Example

example

1{2  "groups": [3    {4      "groupId": "group127-8545-4463-603b-04d550d23bf",5      "domainId": 10000001,6      "groupName": "Group1",7      "isGroupAdministrator": false,8      "isGroupMember": true9    }10  ],11  "responseMetaData": {12    "nextCursor": "JlIBsfJogXpzDGY8OscZziqZpYqCAu3RbZbaFzBb1od6lWQtSdPUd2FIdCuaGgu8DA=="13  }14}

HTTP 403

Forbidden

HTTP 404

Not Found