Skip to content

Latest commit

 

History

History
185 lines (137 loc) · 6.43 KB

File metadata and controls

185 lines (137 loc) · 6.43 KB
title driveItem: archive
description Archive a drive item.
author dcun55
ms.date 01/20/2026
ms.localizationpriority medium
ms.subservice sharepoint
doc_type apiPageType

driveItem: archive

Namespace: microsoft.graph

[!INCLUDE beta-disclaimer]

Archive a driveItem.

When archiving a single active file using a synchronous request, the file is archived immediately.

Note

Archiving a driveItem file is not supported when the request includes the Prefer: respond-async header.

When archiving a folder using an asynchronous request, a monitor URL is returned in the response. Use the monitor URL to track progress until the operation completes.

Note

Archiving a driveItem folder is supported only when the request includes the Prefer: respond-async header

[!INCLUDE national-cloud-support]

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.

[!INCLUDE permissions-table]

HTTP request

POST /drive/root/archive
POST /drives/{drivesId}/root/archive
POST /shares/{sharesId}/root/archive
POST /drives/{drivesId}/items/{driveItemId}/archive
POST /drive/items/{driveItemId}/archive
POST /shares/{sharesId}/driveItem/archive
POST /drive/bundles/{driveItemId}/archive
POST /drive/special/{driveItemId}/archive
POST /drive/following/{driveItemId}/archive

Request headers

Name Description
Authorization Bearer {token}. Required. Learn more about authentication and authorization.
Prefer respond-async. Indicates that the request is an async request. Optional.

Request body

Don't supply a request body for this method.

Response

If successful, this action returns a 204 No Content response code for a driveItem file.

Otherwise, if successful, this action returns a 202 Accepted response code, with a monitor URI, is returned for a driveItem folder.

Examples

Example 1: Archive driveItem file

Request

The following example shows a request.

POST https://graph.microsoft.com/beta/drives/b!fMInbiL5dkK51VbATG0ddrCg6AJpEj9Lm4uGj5HgEi4guyuYp4W5SbH4dPfXTbCF/items/014Y52UITTNSVUQI43PZBJMKLAY6LJBUVE/archive

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]


Response

The following example shows the response.

Note: The response object shown here might be shortened for readability.

HTTP/1.1 204 No Content

Example 2: Archive driveItem folder

Request

The following example shows a request.

POST https://graph.microsoft.com/beta/drives/b!fMInbiL5dkK51VbATG0ddrCg6AJpEj9Lm4uGj5HgEi4guyuYp4W5SbH4dPfXTbCF/items/014Y52UITTNSVUQI43PZBJMKLAY6LJBUVE/archive
Prefer: respond-async

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]


Response

The following example shows the response.

Note: The response object shown here might be shortened for readability.

HTTP/1.1 202 Accepted
Location: https://graph.microsoft.com/monitor/4A3407B5-88FC-4504-8B21-0AABD3412717