GET/users/{userId}/orgunits

Gets a list of teams the member belongs to.

Includes both primary and concurrent teams.

  • membershipType=ALL (default): Also includes teams the member belongs to indirectly through sub-teams.
  • membershipType=DIRECT: Returns only teams the member is directly registered in.

Authorization

oauth2

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

Scope

user
user.read
directory
directory.read

HTTP Request

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

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 teams the member belongs to indirectly through sub-teams.
DIRECT: Returns only teams 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
orgUnits array (UserOrgUnit) 

List of team information

 
responseMetaData object (responseMetaData) 

Response metadata

 

UserOrgUnit

PropertyTypeDescription
orgUnitId string 

Team ID


readOnly : true 
domainId integer 

Domain ID


format : int32 
orgUnitName string 

Team name

 
isPrimaryOrgUnit boolean 

Indicates whether this is the representative team.

 
isPrimaryOrganization boolean 

Indicates whether the team belongs to the member's primary organization.

 
useTeamFeature boolean 

Indicates whether team features are enabled.

 
visible boolean 

Indicates whether the member is visible in the organization chart.

 
isManager boolean 

Indicates whether the member is the team manager.

 

responseMetaData

PropertyTypeDescription
nextCursor string 

Cursor value for pagination

 

Response Example

example

1{2  "orgUnits": [3    {4      "orgUnitId": "orgunitf-f27f-4af8-27e1-03817a911417",5      "domainId": 10000001,6      "orgUnitName": "Development",7      "isPrimaryOrgUnit": true,8      "isPrimaryOrganization": true,9      "useTeamFeature": true,10      "visible": true,11      "isManager": false12    }13  ],14  "responseMetaData": {15    "nextCursor": "JlIBsfJogXpzDGY8OscZziqZpYqCAu3RbZbaFzBb1od6lWQtSdPUd2FIdCuaGgu8DA=="16  }17}

HTTP 403

Forbidden

HTTP 404

Not Found