| title | groupLifecyclePolicy: addGroup |
|---|---|
| description | Add a group to a lifecycle policy. |
| author | yuhko-msft |
| ms.reviewer | mbhargav, khotzteam, aadgroupssg |
| ms.localizationpriority | medium |
| ms.subservice | entra-groups |
| doc_type | apiPageType |
| ms.date | 04/05/2024 |
Namespace: microsoft.graph
[!INCLUDE beta-disclaimer]
Add a group to a groupLifecyclePolicy. This action is supported only if the managedGroupTypes property of the policy is set to Selected.
[!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]
POST /groupLifecyclePolicies/{id}/addGroup| Name | Description |
|---|---|
| Authorization | Bearer {token}. Required. Learn more about authentication and authorization. |
| Content-Type | application/json |
In the request body, provide a JSON object with the following parameters.
| Parameter | Type | Description |
|---|---|---|
| groupId | String | The identifier of the group to add to the policy. |
When the managedGroupTypes property of groupLifecyclePolicy is set to Selected, you can add up to 500 groups to the list. If you need to add more than 500 groups, the managedGroupTypes property of groupLifecyclePolicy must be set to All.
Only one group can be added per request.
If successful, this method returns 200 OK response code. If the group is added to the policy, a true value is returned in the response body and the expirationDateTime property of the added group is set based on the policy's groupLifetimeInDays value. Otherwise, a false value is returned in the response body.
The following example shows a request.
POST https://graph.microsoft.com/beta/groupLifecyclePolicies/{id}/addGroup
Content-type: application/json
{
"groupId": "ffffffff-ffff-ffff-ffff-ffffffffffff"
}The following example shows the response.
HTTP/1.1 200 OK
Content-type: application/json
{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#Edm.Boolean",
"value": true
}