| title | Get group |
|---|---|
| description | Get the properties and relationships of a group object. |
| author | yuhko-msft |
| ms.reviewer | mbhargav, khotzteam, aadgroupssg |
| ms.localizationpriority | high |
| ms.subservice | entra-groups |
| doc_type | apiPageType |
| ms.date | 06/22/2024 |
Namespace: microsoft.graph
[!INCLUDE beta-disclaimer]
Get the properties and relationships of a group object.
This operation returns by default only a subset of all the available properties, as noted in the Properties section. To get properties that aren't_ returned by default, specify them in a $select OData query option. The hasMembersWithLicenseErrors and isArchived properties are an exception and aren't returned in the $select query. Because the group resource supports extensions, you can also use the GET operation to get custom properties and extension data in a group instance.
[!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]
GET /groups/{id}You can use $select to get specific group properties, including properties that aren't returned by default. Extension properties also support query parameters as follows:
| Extension type | Comments |
|---|---|
| Schema extensions | Returned only with $select. |
| Open extensions | Returned through the Get open extension operation. |
| Directory extensions | Returned by default. |
For more information on OData query options, see OData Query Parameters.
| Name | Type | Description |
|---|---|---|
| Authorization | string | Bearer {token}. Required. Learn more about authentication and authorization. |
Don't supply a request body for this method.
If successful, this method returns a 200 OK response code and group object in the response body. It returns the default properties unless you use $select to specify specific properties.
Here's an example of a GET request.
GET https://graph.microsoft.com/beta/groups/45b7d2e7-b882-4a80-ba97-10b7a63b8fa4
[!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]
Here's an example of the response. It includes only the default properties.
Note: The response object shown here might be shortened for readability. All the default properties are returned in an actual call.
HTTP/1.1 200 OK
Content-type: application/json
{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#groups/$entity",
"@odata.id": "https://graph.microsoft.com/v2/45b7d2e7-b882-4a80-ba97-10b7a63b8fa4/directoryObjects/4de51a22-3289-4ea5-bbdb-8503ea644f1b/Microsoft.DirectoryServices.Group",
"id": "4de51a22-3289-4ea5-bbdb-8503ea644f1b",
"deletedDateTime": null,
"classification": null,
"createdDateTime": "2021-09-13T10:07:01Z",
"createdByAppId": "de8bc8b5-d9f9-48b1-a8ad-b748da725064",
"organizationId": "45b7d2e7-b882-4a80-ba97-10b7a63b8fa4",
"description": "Self help community for library",
"displayName": "Library Assist",
"expirationDateTime": "2022-01-11T10:07:01Z",
"groupTypes": [
"Unified"
],
"infoCatalogs": [],
"isAssignableToRole": null,
"isManagementRestricted": null,
"mail": "library@contoso.com",
"mailEnabled": true,
"mailNickname": "library",
"membershipRule": null,
"membershipRuleProcessingState": null,
"onPremisesDomainName": null,
"onPremisesLastSyncDateTime": null,
"onPremisesNetBiosName": null,
"onPremisesSamAccountName": null,
"onPremisesSecurityIdentifier": null,
"onPremisesSyncEnabled": null,
"preferredDataLocation": "EU",
"preferredLanguage": null,
"proxyAddresses": [
"SPO:SPO_0dbffe23-f6fb-4478-adcd-880daf88bb12@SPO_45b7d2e7-b882-4a80-ba97-10b7a63b8fa4",
"SMTP:library@contoso.com"
],
"renewedDateTime": "2021-09-13T10:07:01Z",
"resourceBehaviorOptions": [],
"resourceProvisioningOptions": [],
"securityEnabled": false,
"securityIdentifier": "S-1-12-1-1306860066-1319449225-59104187-458188010",
"serviceProvisioningErrors": [],
"theme": null,
"visibility": "Public",
"writebackConfiguration": {
"isEnabled": null,
"onPremisesGroupType": null
},
"onPremisesProvisioningErrors": []
}Here's an example of a GET request.
GET https://graph.microsoft.com/beta/groups/b320ee12-b1cd-4cca-b648-a437be61c5cd?$select=allowExternalSenders,autoSubscribeNewMembers,isSubscribedByMail,unseenCount
[!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]
Here's an example of the response that includes the requested nondefault properties.
HTTP/1.1 200 OK
Content-type: application/json
{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#groups(allowExternalSenders,autoSubscribeNewMembers,isSubscribedByMail,unseenCount)/$entity",
"id": "b320ee12-b1cd-4cca-b648-a437be61c5cd",
"allowExternalSenders": false,
"autoSubscribeNewMembers": false,
"isSubscribedByMail": false,
"unseenCount": 0
}The following example shows a request.
GET https://graph.microsoft.com/beta/groups/1cdf9c18-a7dc-46b1-b47f-094d5656376d?$select=id,membershipRule,membershipRuleProcessingState,membershipRuleProcessingStatus
The following example shows the response.
HTTP/1.1 200 OK
Content-type: application/json
{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#groups(id,membershipRule,membershipRuleProcessingState,membershipRuleProcessingStatus)/$entity",
"id": "1cdf9c18-a7dc-46b1-b47f-094d5656376d",
"membershipRule": "accountEnabled eq true",
"membershipRuleProcessingState": "On",
"membershipRuleProcessingStatus": {
"status" : "NotStarted",
"lastMembershipUpdated" : null,
"errorMessage" : null
}
}The following example shows how to check whether the management of a group is restricted.
The following example shows a request.
GET https://graph.microsoft.com/beta/groups/aed0b780-965f-4149-85c5-a8c73e58brt6?$select=isManagementRestricted
[!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
{
"isManagementRestricted": true
}