Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
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 a mailboxItem from a mailboxFolder in a mailbox.
Use the disposalType query parameter to specify whether to soft-delete or hard-delete the item.
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) | MailboxItem.ReadWrite | Not available. |
| Delegated (personal Microsoft account) | Not supported. | Not supported. |
| Application | MailboxItem.ReadWrite.All | Not available. |
HTTP request
DELETE /admin/exchange/mailboxes/{mailboxId}/folders/{mailboxFolderId}/items/{mailboxItemId}?disposalType={disposalType}
Query parameters
In the request URL, provide the following required query parameter.
| Parameter | Type | Description |
|---|---|---|
| disposalType | String | Required. The type of delete operation to perform. The possible values are: softDelete, hardDelete. Use softDelete to follow Exchange soft-delete semantics, or hardDelete to permanently delete the item. |
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 method returns a 204 No Content response code.
Note
When you use hardDelete, the Exchange service permanently deletes the item only when it's customer data that isn't protected by a legal hold, retention policy, audit, compliance, or system-item restriction. Otherwise, the request fails with a 403 Forbidden error.
Archive mailboxes with autoexpanded folders: When the target item physically resides in an auxiliary (autoexpanded) archive mailbox, this API might return a redirect response that points to the correct mailbox endpoint. For details, see Handle archive mailbox redirects.
Examples
Example 1: Soft-delete a mailbox item
The following example shows how to soft-delete a mailbox item in a folder by using disposalType=softDelete.
Request
The following example shows a request.
DELETE https://graph.microsoft.com/beta/admin/exchange/mailboxes/MBX:e0648f21@aab09c93/folders/inbox/items/AAMkADk0MzI?disposalType=softDelete
Response
The following example shows the response.
HTTP/1.1 204 No Content
Example 2: Hard-delete a mailbox item
The following example shows how to hard-delete an eligible mailbox item in Recoverable Items by using disposalType=hardDelete.
Request
The following example shows a request.
DELETE https://graph.microsoft.com/beta/admin/exchange/mailboxes/MBX:e0648f21@aab09c93/folders/recoverableitemsdeletions/items/AAMkADk0MzI?disposalType=hardDelete
Response
The following example shows the response.
HTTP/1.1 204 No Content