Search code examples
microsoft-graph-apiazure-ad-graph-api

Retrieve information of a deleted user in Azure AD using graph API


Is there any way to retrieve information on a deleted user in Azure AD using Graph API?

I need the deleted date of that user.


Solution

  • You can use /directory/deletedItems/microsoft.graph.user endpoint.

    https://graph.microsoft.com/v1.0/directory/deletedItems/microsoft.graph.user?$select=id,deletedDateTime,displayName
    

    deletedDateTime is not returned by default, so it must be specified in the $select.

    Users are permanently deleted automatically 30 days after they are deleted. The endpoint will return only users deleted in last 30 days.

    Resource:

    List deleted items