| title | List directReports |
|---|---|
| description | Get a user's direct reports. |
| ms.localizationpriority | high |
| author | yyuank |
| ms.reviewer | iamut |
| ms.subservice | entra-users |
| doc_type | apiPageType |
| ms.date | 07/30/2024 |
Namespace: microsoft.graph
Get a user's direct reports. Returns the users and contacts for whom this user is assigned as manager. This API doesn't support getting the direct report chain beyond the specified user's direct reports.
[!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]
To retrieve the direct reports of a user:
GET /me/directReports
GET /users/{id | userPrincipalName}/directReports[!INCLUDE me-apis-sign-in-note]
To retrieve the user and their direct reports, use the $expand query parameter:
Note:
$expandreturns a maximum of 20 objects. For details, see query parameter limitations.
GET /me?$expand=directReports
GET /users/{id | userPrincipalName}?$expand=directReports[!INCLUDE me-apis-sign-in-note]
This method supports the $select, $count, $expand, and $filter OData query parameters to help customize the response. You can use $select nested in the $expand expression. For example, me?$expand=($select=id,displayName). Some queries are supported only when you use the ConsistencyLevel header set to eventual and $count. For more information, see Advanced query capabilities on directory objects.
| Header | Value |
|---|---|
| Authorization | Bearer {token}. Required. Learn more about authentication and authorization. |
| Content-Type | application/json |
| ConsistencyLevel | eventual. This header and $count are required when using $search, or in specific usage of $filter. For more information about the use of ConsistencyLevel and $count, see Advanced query capabilities on directory objects. |
Don't supply a request body for this method.
If successful, this method returns a 200 OK response code and a collection of directoryObject objects in the response body.
The following example shows a request.
GET https://graph.microsoft.com/v1.0/me/directReports
[!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
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#directoryObjects",
"value": [
{
"@odata.type": "#microsoft.graph.user",
"id": "6ea91a8d-e32e-41a1-b7bd-d2d185eed0e0",
"businessPhones": [],
"displayName": "Conf Room Adams",
"givenName": null,
"jobTitle": null,
"mail": "Adams@contoso.com",
"mobilePhone": null,
"officeLocation": null,
"preferredLanguage": null,
"surname": null,
"userPrincipalName": "Adams@contoso.com"
}
]
}