| title | List manager |
|---|---|
| description | Get user's manager. Returns the user or contact assigned as the user's manager. |
| ms.localizationpriority | medium |
| author | yyuank |
| ms.reviewer | iamut |
| ms.subservice | entra-users |
| doc_type | apiPageType |
| ms.date | 04/18/2024 |
Namespace: microsoft.graph
[!INCLUDE beta-disclaimer]
Returns the user or organizational contact assigned as the user's manager. Optionally, you can expand the manager's chain up to the root node.
[!INCLUDE national-cloud-support]
Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.
[!INCLUDE permissions-table]
[!INCLUDE limited-info]
Get the manager:
GET /me/manager
GET /users/{id | userPrincipalName}/manager[!INCLUDE me-apis-sign-in-note]
Get the management chain:
GET /users?$expand=manager
GET /users/{id | userPrincipalName}/?$expand=manager($levels=n)This method supports the $select and $expand OData query parameters to help customize the response. When using the $expand query parameter:
- The
nvalue of$levelscan bemax(to return all managers) or a number between 1 and 1000. - When the
$levelsparameter is not specified, only the immediate manager is returned. - You can specify
$selectinside$expandto select the individual manager's properties:$expand=manager($levels=max;$select=id,displayName). $levelsparameter is only supported on a single user (/users/{id}ormeendpoints) and not on the entire list of users.- Use of
$levelsrequires the ConsistencyLevel header set toeventual. For more information about the use of ConsistencyLevel, see Advanced query capabilities on directory objects.
| Header | Value |
|---|---|
| Authorization | Bearer {token}. Required. Learn more about authentication and authorization. |
| ConsistencyLevel | eventual. Required when the request includes the $levels=n in the $expand query parameter. |
Don't supply a request body for this method.
If successful, this method returns a 200 OK response code and a user object in the response body. If the user isn't assigned a manager, this method returns a 404 Not Found error code.
The following example shows a request to get the manager.
GET https://graph.microsoft.com/beta/users/{id|userPrincipalName}/manager
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
The following example shows the response.
Note: The response object shown here might be shortened for readability.
HTTP/1.1 200 OK
Content-type: application/json
{
"id": "7d54cb02-aaa3-4016-9f9c-a4b49422dd9b",
"displayName": "Sara Davis",
"jobTitle": "Finance VP",
"mail": "SaraD@contoso.com",
"userPrincipalName": "SaraD@contoso.com"
}The following example shows a request to get the manager chain up to the root level.
GET https://graph.microsoft.com/beta/me?$expand=manager($levels=max;$select=id,displayName)&$select=id,displayName
ConsistencyLevel: eventual
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
The following example shows the response. Transitive managers are displayed hierarchically.
Note: The response object shown here might be shortened for readability.
HTTP/1.1 200 OK
Content-type: application/json
{
"id": "a97733ce-92a4-4e7e-8d45-8e1f3e6a69d8",
"displayName": "Individual Contributor",
"manager": {
"id": "7d54cb02-aaa3-4016-9f9c-a4b49422dd9b",
"displayName": "Alex Wilber",
"manager": {
"id": "343a3f95-377c-47a9-b697-480487bfcdf7",
"displayName": "Bianca Pisani",
"manager": {
"id": "8e07b731-5ba7-4081-b482-15e6eca35c45",
"displayName": "Patti Fernandez"
}
}
}
}