Permanently delete an item (directory object)
Namespace: microsoft.graph
Permanently delete a recently deleted application, group, servicePrincipal, or user object from deleted items. After an item is permanently deleted, it cannot be restored.
Administrative units cannot be permanently deleted by using the deletedItems API. Soft-deleted administrative units will be permanently deleted 30 days after initial deletion unless they are restored.
This API is available in the following national cloud deployments.
Global service | US Government L4 | US Government L5 (DOD) | China operated by 21Vianet |
---|---|---|---|
✅ | ✅ | ✅ | ✅ |
Permissions
The following table shows the least privileged permission or permissions required to call this API on each supported resource type. Follow best practices to request least privileged permissions. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.
Supported resource | Delegated (work or school account) | Delegated (personal Microsoft account) | Application |
---|---|---|---|
application | Application.ReadWrite.All | Not supported. | Application.ReadWrite.OwnedBy |
group | Group.ReadWrite.All | Not supported. | Not supported. |
servicePrincipal | Application.ReadWrite.All | Not supported. | Application.ReadWrite.OwnedBy |
user | User.ReadWrite.All | Not supported. | Not supported. |
In delegated scenarios with work or school accounts, the signed-in user must be assigned a supported Microsoft Entra role or a custom role with a supported role permission. The following least privileged roles are supported for this operation.
- To permanently delete deleted applications or service principals: Application Administrator, Cloud Application Administrator, or Hybrid Identity Administrator.
- To permanently delete deleted users: User Administrator.
- To permanently delete deleted groups: Groups Administrator.
HTTP request
DELETE /directory/deletedItems/{id}
Request headers
Name | Description |
---|---|
Authorization | Bearer {token}. Required. Learn more about authentication and authorization. |
Accept | application/json |
Request body
Don't supply a request body for this method.
Response
If successful, this method returns 204 No Content
response code. It doesn't return anything in the response body.
Example
Request
DELETE https://graph.microsoft.com/v1.0/directory/deletedItems/{object-id}
Response
Note: The response object shown here might be shortened for readability.
HTTP/1.1 204 No Content
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for