Edit

Delete mailboxItem

Namespace: microsoft.graph

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 ****** 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.

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/v1.0/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/v1.0/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