| title | driveItem: discardCheckout |
|---|---|
| description | Discard a previously checked out driveItem. |
| author | javieralvarezchiang |
| ms.localizationpriority | medium |
| ms.subservice | sharepoint |
| doc_type | apiPageType |
| ms.date | 12/10/2024 |
Namespace: microsoft.graph
Discard the check out of a driveItem. This action releases a driveItem resource that was previously checked out. Any changes made to the item while it was checked out are discarded.
The same user that performed the checkout must discard it. Another alternative is to use application permissions.
[!INCLUDE national-cloud-support]
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]
[!INCLUDE app-permissions]
POST /drives/{driveId}/items/{itemId}/discardCheckout
POST /groups/{groupId}/drive/items/{itemId}/discardCheckout
POST /me/drive/items/{item-id}/discardCheckout
POST /sites/{siteId}/drive/items/{itemId}/discardCheckout
POST /users/{userId}/drive/items/{itemId}/discardCheckout| 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 204 No Content response code.
The request returns 400 Bad Request if the file isn't checked out. Requests made with delegated access return 423 Locked if another user has the file checked out. Requests made with application access can discard any checkout.
For more information about how errors are returned, see Error responses.
The following example shows a discard checkout request on a file identified by {item-id}.
POST https://graph.microsoft.com/v1.0/drives/{drive-id}/items/{item-id}/discardCheckout[!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]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
The following example shows the response.
HTTP/1.1 204 No content