However, when I check the Deleted Items folder in the user's mailbox (via Outlook or OWA), there are no emails in the folder. This discrepancy seems to be caused by the Recoverable Items folder, which is likely affecting the size and item count of the Deleted Items folder in the Graph API response.
Yes, The discrepancy between the sizeInbytes
and totalItemCount
is caused by the Recoverable Items folder being part of the Deleted Items metadata. The Deleted Items folder is affected by items that may have been moved to the Recoverable Items folder.
As of now, Unfortunately, there is no direct way to exclude the Recoverable Items folder when retrieving the size and item count of the Deleted Items folder via the Graph API. So, you need to query them separately by querying deleted item and Recoverable items.
Note: recoverableitemsdeletions
contains soft-deleted items: deleted either from the Deleted Items folder, or by pressing shift+delete in Outlook. Refer this MsDoc.
To list the deleted items from Delete Folder
of mailbox:
GET https://graph.microsoft.com/v1.0/me/mailFolders/deletedItems

To list the deleted items from Delete Folder
with messages of mailbox:
GET https://graph.microsoft.com/v1.0/me/mailFolders/deletedItems/messages?$filter=parentFolderId eq 'deletedItems'&$count=true

To list the RecoverableItemsDeletion
folder of Mailbox:
GET https://graph.microsoft.com/v1.0/me/mailFolders/recoverableitemsdeletions

To list the RecoverableItemsDeletion
folder with messages of mailbox:

To query more endpoints of Recoverable Item Folder Refer this SO thread by Glen Scales
Reference:
SO thread by Glen Scales
MsDocument on recoverableitemsdeletions