Skip to content

Commit 1a34501

Browse files
authored
Merge pull request #28180 from microsoftgraph/user/liluong/add_graphdocs_itemretentionlabel_delete
Update Remove Retention Label To Beta Graph Docs
2 parents 6be46bc + 255073e commit 1a34501

3 files changed

Lines changed: 81 additions & 6 deletions

File tree

api-reference/beta/api/driveitem-removeretentionlabel.md

Lines changed: 59 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
---
22
title: "driveItem: removeRetentionLabel"
3-
description: "Remove a retention label from a driveItem."
3+
description: "Remove the retention label from a driveItem."
44
author: "kyracatwork"
55
ms.localizationpriority: medium
66
ms.subservice: "onedrive"
77
doc_type: apiPageType
8-
ms.date: 11/06/2025
8+
ms.date: 02/03/2026
99
---
1010

1111
# driveItem: removeRetentionLabel
@@ -14,7 +14,7 @@ Namespace: microsoft.graph
1414

1515
[!INCLUDE [beta-disclaimer](../../includes/beta-disclaimer.md)]
1616

17-
Remove a retention label from a [driveItem](../resources/driveitem.md).
17+
Remove the retention label from a [driveItem](../resources/driveitem.md). This operation clears the retention label and all associated retention settings enforced on the item.
1818

1919
For information about retention labels from an administrator's perspective, see [Use retention labels to manage the lifecycle of documents stored in SharePoint](/microsoft-365/compliance/auto-apply-retention-labels-scenario).
2020

@@ -28,7 +28,8 @@ Choose the permission or permissions marked as least privileged for this API. Us
2828
[!INCLUDE [permissions-table](../includes/permissions/driveitem-removeretentionlabel-permissions.md)]
2929

3030
> [!NOTE]
31-
> `Sites.FullControl.All` is the least privileged permission required to remove retention labels that classify the content as records.
31+
> * `Sites.FullControl.All` is the least privileged permission required to remove retention labels that classify the content as records.
32+
> * The removal of a *Record* retention label isn't supported when using app-only authentication. This operation requires a delegated user context.
3233
3334
[!INCLUDE [app-permissions](../includes/sharepoint-embedded-app-driveitem-permissions.md)]
3435

@@ -40,6 +41,9 @@ Choose the permission or permissions marked as least privileged for this API. Us
4041
-->
4142
```http
4243
DELETE /drives/{drive-id}/items/{item-id}/retentionLabel
44+
DELETE /groups/{group-id}/drive/items/{item-id}/retentionLabel
45+
DELETE /me/drive/items/{item-id}/retentionLabel
46+
DELETE /users/{user-id}/drive/items/{item-id}/retentionLabel
4347
```
4448

4549
## Request headers
@@ -56,9 +60,19 @@ Don't supply a request body for this method.
5660

5761
If successful, this method returns a `204 No Content` response code. It doesn't return anything in the response body.
5862

63+
### Error responses
64+
65+
| Error code | HTTP status | Description |
66+
|:-----------------|:------------|:-------------------------------------------------------------------|
67+
| notSupported | 400 | App-only callers aren't supported for SharePoint Embedded containers. |
68+
| accessDenied | 403 | The caller doesn't have permission to remove the retention label. |
69+
| itemNotFound | 404 | The item can't be found or is no longer accessible. |
70+
5971
## Examples
6072

61-
### Request
73+
### Example 1: Remove the retention label from a driveItem
74+
The following example shows how to remove the retential label from a **driveItem** object.
75+
#### Request
6276

6377
The following example shows a request.
6478

@@ -73,7 +87,7 @@ The following example shows a request.
7387
DELETE https://graph.microsoft.com/beta/drives/b!t18F8ybsHUq1z3LTz8xvZqP8zaSWjkFNhsME-Fepo75dTf9vQKfeRblBZjoSQrd7/items/01NKDM7HMOJTVYMDOSXFDK2QJDXCDI3WUK/retentionLabel
7488
```
7589

76-
### Response
90+
#### Response
7791

7892
The following example shows the response.
7993

@@ -85,3 +99,42 @@ The following example shows the response.
8599
```http
86100
HTTP/1.1 204 No Content
87101
```
102+
103+
### Example 2: Remove the retention label from a driveItem that fails due to insufficient permissions
104+
The following example shows how to remove the retention label from a **driveItem** object that fails due to insufficient permissions.
105+
#### Request
106+
The following example shows a request.
107+
<!-- {
108+
"blockType": "request",
109+
"name": "driveItem_removeRetentionLabel_spe_permissions_error",
110+
"sampleKeys": ["b!t18F8ybsHUq1z3LTz8xvZqP8zaSWjkFNhsME-Fepo75dTf9vQKfeRblBZjoSQrd7", "01NKDM7HMOJTVYMDOSXFDK2QJDXCDI3WUK"]
111+
}
112+
-->
113+
114+
```http
115+
DELETE https://graph.microsoft.com/beta/drives/b!t18F8ybsHUq1z3LTz8xvZqP8zaSWjkFNhsME-Fepo75dTf9vQKfeRblBZjoSQrd7/items/01NKDM7HMOJTVYMDOSXFDK2QJDXCDI3WUK/retentionLabel
116+
```
117+
118+
#### Response
119+
The following example shows the response.
120+
<!-- {
121+
"blockType": "response",
122+
"truncated": true,
123+
"@odata.type": "microsoft.graph.error"
124+
} -->
125+
126+
```http
127+
HTTP/1.1 403 Forbidden
128+
Content-Type: application/json
129+
130+
{
131+
"error": {
132+
"code": "accessDenied",
133+
"message": "Access Denied: Do not have enough permission.",
134+
"innerError": {
135+
"request-id": "12345678-1234-1234-1234-123456789012",
136+
"date": "2025-02-03T10:30:00"
137+
}
138+
}
139+
}
140+
```

changelog/Microsoft.FileServices.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,23 @@
11
{
22
"changelog": [
3+
{
4+
"ChangeList": [
5+
{
6+
"Id": "7b48d671-3f04-4f2d-90f0-d0026a4818d8",
7+
"ApiChange": "Method",
8+
"ChangedApiName": "removeRetentionLabel",
9+
"ChangeType": "Change",
10+
"Description": "Added support for the `DELETE /groups/{group-id}/drive/items/{item-id}/retentionLabel`, `DELETE /me/drive/items/{item-id}/retentionLabel`, and `DELETE /users/{user-id}/drive/items/{item-id}/retentionLabel` in the [removeRetentionLabel](https://learn.microsoft.com/en-us/graph/api/driveitem-removeretentionlabel?view=graph-rest-beta) of the [driveItem](https://learn.microsoft.com/en-us/graph/api/resources/driveItem?view=graph-rest-beta) resource.",
11+
"Target": "driveItem"
12+
}
13+
],
14+
"Id": "7b48d671-3f04-4f2d-90f0-d0026a4818d8",
15+
"Cloud": "Prod",
16+
"Version": "beta",
17+
"CreatedDateTime": "2026-03-11T20:51:08.101659Z",
18+
"WorkloadArea": "Files",
19+
"SubArea": ""
20+
},
321
{
422
"ChangeList": [
523
{

concepts/whats-new-overview.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ Using the **signInAudience** and **signInAudienceRestrictions** properties to li
4646

4747
Added the `includeNewerItems` member as supported value for the **tags** property on [restorePoint](/graph/api/resources/restorepoint?view=graph-rest-beta&preserve-view=true) to get a restore point within a specified time period that includes any newer items created during that period.
4848

49+
### Files
50+
51+
Added support for the `DELETE /groups/{group-id}/drive/items/{item-id}/retentionLabel`, `DELETE /me/drive/items/{item-id}/retentionLabel`, and `DELETE /users/{user-id}/drive/items/{item-id}/retentionLabel` endpoints to the [driveItem: removeRetentionLabel](/graph/api/driveitem-removeretentionlabel?view=graph-rest-beta&preserve-view=true) API.
52+
4953
### Files | File storage container
5054

5155
[Archive](/graph/api/filestoragecontainer-archive?view=graph-rest-beta&preserve-view=true) or [unarchive](/graph/api/filestoragecontainer-unarchive?view=graph-rest-beta&preserve-view=true) a SharePoint Embedded storage container.

0 commit comments

Comments
 (0)