| title | protectionRuleBase: deleteAndUnprotect |
|---|---|
| description | Delete and unprotect all the artifacts protected by a dynamic rule. |
| author | rigera |
| ms.reviewer | rigera |
| ms.date | 10/09/2025 |
| ms.localizationpriority | medium |
| ms.subservice | m365-backup-storage |
| doc_type | apiPageType |
Namespace: microsoft.graph
Delete and unprotect all the artifacts protected by a dynamic rule. This action is only applicable to dynamic rules.
The following points apply when you delete a dynamic rule and unprotect all artifacts it protects.
- The rule moves to the
deleteRequestedstatus when this action is performed on a dynamic rule. - Unprotecting artifacts and deleting rules are asynchronous operations, and they might not complete immediately.
- This action resets the
dynamicRuleprotection source. If the artifact is also protected by another protection source, it's only protected by that source afterward. - No operation is allowed on a dynamic rule once a rule is in the
deleteRequestedstate.
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 /solutions/backupRestore/oneDriveForBusinessProtectionPolicies/{oneDriveForBusinessProtectionPolicyId}/driveInclusionRules/{driveProtectionRuleId}/deleteAndUnprotect
POST /solutions/backupRestore/exchangeProtectionPolicies/{exchangeProtectionPolicyId}/mailboxInclusionRules/{mailboxProtectionRuleId}/deleteAndUnprotect| Name | Description |
|---|---|
| Authorization | Bearer {token}. Required. Learn more about authentication and authorization. |
Don't supply a request body for this method.
If successful, this action returns a 202 Accepted response code and a protectionRuleBase object in the response body.
Example 1: Delete and unprotect a driveInclusionRule associated with a onedriveForBusiness protection policy
The following example shows how to delete a driveInclusionRule associated with a onedriveForBusinessProtectionPolicy and unprotect the units it protects.
The following example shows a request.
POST https://graph.microsoft.com/v1.0/solutions/backupRestore/oneDriveForBusinessProtectionPolicies/71633878-8321-4950-bfaf-ed285bdd1461/driveInclusionRules/61633878-8321-4950-bfaf-ed285bdd1461/deleteAndUnprotect[!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 202 Accepted
Content-Type: application/json
{
"value": {
"@odata.type": "https://graph.microsoft.com/v1.0/$metadata#microsoft.graph.protectionRuleBase",
"id": "61633878-8321-4950-bfaf-ed285bdd1461",
"status": "deleteRequested",
"createdDateTime": "2025-01-15T15:07:44.3043505Z",
"lastModifiedDateTime": "2025-01-15T14:42:12.6779064Z",
"isAutoApplyEnabled": true,
"driveExpression": "(memberOf -any (group.id -in ['4e8e9b15-bfc8-40a2-aed0-3f65a22e2bd4']))",
"createdBy": {
"user": {
"identity": "8aaaaec3-5dcb-4b47-9ef9-0dda3e95b9f4"
}
},
"lastModifiedBy": {}
}
}Example 2: Delete and unprotect a mailboxInclusionRule associated with an Exchange protection policy
The following example shows how to delete a mailboxInclusionRule associated with an exchangeProtectionPolicy.
The following example shows a request.
POST https://graph.microsoft.com/v1.0/solutions/backupRestore/exchangeProtectionPolicies/6b0991b9-e7d4-4794-86fa-2a3f2a4e3177/mailboxInclusionRules/52147fb9-2682-47bc-a8f6-6c38c1ff498d/deleteAndUnprotect[!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 202 Accepted
Content-Type: application/json
{
"value": {
"@odata.type": "https://graph.microsoft.com/v1.0/$metadata#microsoft.graph.protectionRuleBase",
"id": "52147fb9-2682-47bc-a8f6-6c38c1ff498d",
"status": "deleteRequested",
"createdDateTime": "2025-01-15T15:07:44.3043505Z",
"lastModifiedDateTime": "2025-01-15T14:42:12.6779064Z",
"isAutoApplyEnabled": true,
"mailboxExpression": "(memberOf -any (group.id -in ['4e8e9b15-bfc8-40a2-aed0-3f65a22e2bd4']))",
"createdBy": {
"user": {
"identity": "8aaaaec3-5dcb-4b47-9ef9-0dda3e95b9f4"
}
},
"lastModifiedBy": {},
"error": {}
}
}