protectionRuleBase: deleteAndUnprotect
Namespace: microsoft.graph
Important
APIs under the /beta
version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported. To determine whether an API is available in v1.0, use the Version selector.
Delete and unprotect all the artifacts protected by a dynamic rule. This action is only applicable to dynamic rules.
The following points apply when deleting a dynamic rule and unprotecting all artifacts it protects.
- The rule moves to the
deleteRequested
status 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
dynamicRule
protection 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
deleteRequested
state.
Permissions
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.
Permission type | Least privileged permissions | Higher privileged permissions |
---|---|---|
Delegated (work or school account) | BackupRestore-Configuration.ReadWrite.All | Not available. |
Delegated (personal Microsoft account) | Not supported. | Not supported. |
Application | BackupRestore-Configuration.ReadWrite.All | Not available. |
HTTP request
POST /solutions/backupRestore/oneDriveForBusinessProtectionPolicies/{oneDriveForBusinessProtectionPolicyId}/driveInclusionRules/{driveProtectionRuleId}/deleteAndUnprotect
POST /solutions/backupRestore/exchangeProtectionPolicies/{exchangeProtectionPolicyId}/mailboxInclusionRules/{mailboxProtectionRuleId}/deleteAndUnprotect
Request headers
Name | Description |
---|---|
Authorization | Bearer {token}. Required. Learn more about authentication and authorization. |
Request body
Don't supply a request body for this method.
Response
If successful, this action returns a 202 Accepted
response code and a protectionRuleBase in the response body.
Examples
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.
Request
The following example shows a request.
POST https://graph.microsoft.com/beta/solutions/backupRestore/oneDriveForBusinessProtectionPolicies/71633878-8321-4950-bfaf-ed285bdd1461/driveInclusionRules/61633878-8321-4950-bfaf-ed285bdd1461/deleteAndUnprotect
Response
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
{
"value": {
"@odata.type": "https://graph.microsoft.com/beta/$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.
Request
The following example shows a request.
POST https://graph.microsoft.com/beta/solutions/backupRestore/exchangeProtectionPolicies/6b0991b9-e7d4-4794-86fa-2a3f2a4e3177/mailboxInclusionRules/52147fb9-2682-47bc-a8f6-6c38c1ff498d/deleteAndUnprotect
Response
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
{
"value": {
"@odata.type": "https://graph.microsoft.com/beta/$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,
"driveExpression": "(memberOf -any (group.id -in ['4e8e9b15-bfc8-40a2-aed0-3f65a22e2bd4']))",
"createdBy": {
"user": {
"identity": "8aaaaec3-5dcb-4b47-9ef9-0dda3e95b9f4"
}
},
"lastModifiedBy": {},
"error": {}
}
}