|
| 1 | +--- |
| 2 | +title: "Update mailboxProtectionUnit" |
| 3 | +description: "Update the properties of a mailboxProtectionUnit object." |
| 4 | +author: "abbhadauria" |
| 5 | +ms.reviewer: "haputta" |
| 6 | +ms.localizationpriority: medium |
| 7 | +ms.subservice: "m365-backup-storage" |
| 8 | +doc_type: apiPageType |
| 9 | +ms.date: 03/04/2026 |
| 10 | +--- |
| 11 | + |
| 12 | +# Update mailboxProtectionUnit |
| 13 | + |
| 14 | +Namespace: microsoft.graph |
| 15 | + |
| 16 | +[!INCLUDE [beta-disclaimer](../../includes/beta-disclaimer.md)] |
| 17 | + |
| 18 | +Update the properties of a [mailboxProtectionUnit](../resources/mailboxprotectionunit.md) object. |
| 19 | + |
| 20 | +> [!NOTE] |
| 21 | +> This API is currently available only through the Microsoft Graph PowerShell SDK. |
| 22 | +
|
| 23 | +[!INCLUDE [national-cloud-support](../../includes/global-only.md)] |
| 24 | + |
| 25 | +## Permissions |
| 26 | + |
| 27 | +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](/graph/permissions-overview#best-practices-for-using-microsoft-graph-permissions). For details about delegated and application permissions, see [Permission types](/graph/permissions-overview#permission-types). To learn more about these permissions, see the [permissions reference](/graph/permissions-reference). |
| 28 | + |
| 29 | +<!-- { "blockType": "permissions", "name": "mailboxprotectionunit_update" } --> |
| 30 | +[!INCLUDE [permissions-table](../includes/permissions/mailboxprotectionunit-update-permissions.md)] |
| 31 | + |
| 32 | +## HTTP request |
| 33 | + |
| 34 | +<!-- { |
| 35 | + "blockType": "ignored" |
| 36 | +} |
| 37 | +--> |
| 38 | +```http |
| 39 | +PATCH /backupRestore/mailboxProtectionUnits/{mailboxProtectionUnitId} |
| 40 | +``` |
| 41 | + |
| 42 | +## Request headers |
| 43 | + |
| 44 | +|Name|Description| |
| 45 | +|:---|:---| |
| 46 | +|Authorization|Bearer {token}. Required. Learn more about [authentication and authorization](/graph/auth/auth-concepts).| |
| 47 | +|Content-Type|application/json. Required.| |
| 48 | + |
| 49 | +## Request body |
| 50 | + |
| 51 | +This API supports updates only to the **billingPolicyId** property, and only for protection units removed from backup policies (**policyId** is an empty string `""` or `null`). |
| 52 | + |
| 53 | +In the request body, provide a JSON representation of the following property. |
| 54 | + |
| 55 | +|Property|Type|Description| |
| 56 | +|:---|:---|:---| |
| 57 | +|billingPolicyId|String|Optional. The unique identifier of the billing policy assigned to the protection unit. You can update this property only when **policyId** is `null` or an empty string (`""`).| |
| 58 | + |
| 59 | +> **Note:** If **policyId** has a value, the protection unit is attached to a protection policy and **billingPolicyId** can't be updated. |
| 60 | +
|
| 61 | +## Response |
| 62 | + |
| 63 | +If successful, this method returns a `200 OK` response code and an updated [mailboxProtectionUnit](../resources/mailboxprotectionunit.md) object in the response body. |
| 64 | + |
| 65 | +For a list of possible error responses, see [Backup Storage API error responses](/graph/backup-storage-error-codes). |
| 66 | + |
| 67 | +## Examples |
| 68 | + |
| 69 | +### Example 1: Update the billing policy when the protection unit isn't attached to a protection policy |
| 70 | + |
| 71 | +The following example shows how to update the **billingPolicyId** property when the protection unit isn't attached to a protection policy. |
| 72 | + |
| 73 | +#### Request |
| 74 | + |
| 75 | +The following example shows a request. |
| 76 | + |
| 77 | +<!-- { |
| 78 | + "blockType": "request", |
| 79 | + "name": "mailboxprotectionunit_update_unattached_policy" |
| 80 | +} |
| 81 | +--> |
| 82 | +```msgraph-interactive |
| 83 | +PATCH https://graph.microsoft.com/beta/backupRestore/mailboxProtectionUnits/MjUyZTc3ZDEtM2IyYS00ZGMwLTkzYTMtMjkxZDI3NWZlY2YzXzM= |
| 84 | +Content-Type: application/json |
| 85 | +
|
| 86 | +{ |
| 87 | + "billingPolicyId": "fa3d95b5-2878-4de7-94f5-157f4b7607aa" |
| 88 | +} |
| 89 | +``` |
| 90 | + |
| 91 | +#### Response |
| 92 | + |
| 93 | +The following example shows the response. |
| 94 | +<!-- { |
| 95 | + "blockType": "response", |
| 96 | + "truncated": true, |
| 97 | + "@odata.type": "microsoft.graph.mailboxProtectionUnit" |
| 98 | +} |
| 99 | +--> |
| 100 | +```http |
| 101 | +HTTP/1.1 200 OK |
| 102 | +Content-Type: application/json |
| 103 | +
|
| 104 | +{ |
| 105 | + "@odata.type": "#microsoft.graph.mailboxProtectionUnit", |
| 106 | + "id": "MjUyZTc3ZDEtM2IyYS00ZGMwLTkzYTMtMjkxZDI3NWZlY2YzXzM=", |
| 107 | + "directoryObjectId": "bb1b5307-d650-49cf-88cf-05eaf1b3bb33", |
| 108 | + "displayName": "Exo admin", |
| 109 | + "email": "exoadmin@contoso.com", |
| 110 | + "mailboxType": "user", |
| 111 | + "policyId": "", |
| 112 | + "billingPolicyId": "fa3d95b5-2878-4de7-94f5-157f4b7607aa", |
| 113 | + "createdDateTime": "2026-02-04T06:24:19.5736657Z", |
| 114 | + "createdBy": { |
| 115 | + "user": { |
| 116 | + "identity": "6294dedc-d456-4c78-9b2f-b4bae765fb09" |
| 117 | + } |
| 118 | + }, |
| 119 | + "status": "unprotected", |
| 120 | + "protectionSources": "none", |
| 121 | + "lastModifiedDateTime": "2026-02-24T06:44:53.6014453Z", |
| 122 | + "lastModifiedBy": { |
| 123 | + "user": { |
| 124 | + "identity": "6294dedc-d456-4c78-9b2f-b4bae765fb09" |
| 125 | + } |
| 126 | + }, |
| 127 | + "offboardRequestedDateTime": "0001-01-01T00:00:00Z" |
| 128 | +} |
| 129 | +``` |
| 130 | + |
| 131 | +### Example 2: Update the billing policy when the protection unit is attached to a protection policy |
| 132 | + |
| 133 | +The following example shows the response you get if you try to update the **billingPolicyId** property when the protection unit is attached to a protection policy. |
| 134 | + |
| 135 | +#### Request |
| 136 | + |
| 137 | +The following example shows a request. |
| 138 | + |
| 139 | +<!-- { |
| 140 | + "blockType": "request", |
| 141 | + "name": "mailboxprotectionunit_update_attached_policy_error" |
| 142 | +} |
| 143 | +--> |
| 144 | +```http |
| 145 | +PATCH https://graph.microsoft.com/beta/backupRestore/mailboxProtectionUnits/NmFmNTQ2NTUtNTkwYS00YWU2LThkMDQtODRmNDI0OGMwZjU0XzE= |
| 146 | +Content-Type: application/json |
| 147 | +
|
| 148 | +{ |
| 149 | + "billingPolicyId": "f65f082d-a073-4451-9a3b-2355956f2cd7" |
| 150 | +} |
| 151 | +``` |
| 152 | + |
| 153 | +#### Response |
| 154 | + |
| 155 | +The following example shows the response. |
| 156 | +<!-- { |
| 157 | + "blockType": "response", |
| 158 | + "@odata.type": "microsoft.graph.publicError" |
| 159 | +} |
| 160 | +--> |
| 161 | +```http |
| 162 | +HTTP/1.1 403 Operation Not Allowed |
| 163 | +Content-Type: application/json |
| 164 | +
|
| 165 | +{ |
| 166 | + "@odata.type": "#microsoft.graph.publicError", |
| 167 | + "code": "OperationNotAllowed", |
| 168 | + "message": "Only protection units removed from backup policies are allowed for this API.", |
| 169 | + "target": "billingPolicyId", |
| 170 | + "details": [], |
| 171 | + "innerError": { |
| 172 | + "@odata.type": "#microsoft.graph.publicError", |
| 173 | + "code": "OperationNotAllowed", |
| 174 | + "message": "The protection unit is attached to a backup policy.", |
| 175 | + "target": "policyId", |
| 176 | + "details": [], |
| 177 | + "innerError": null |
| 178 | + } |
| 179 | +} |
| 180 | +``` |
| 181 | + |
| 182 | +## Related content |
| 183 | + |
| 184 | +- [mailboxProtectionUnit](../resources/mailboxprotectionunit.md) |
0 commit comments