How to Fetch Sensitivity Labels for Files in OneDrive/SharePoint and Outlook Emails

Kanwal Singh 20 Reputation points
2025-05-01T17:40:40.69+00:00

I am having difficulty fetching the sensitivity labels for files stored in Office applications like Word and Outlook emails.

For Word: I attempted to use the endpoint https://graph.microsoft.com/v1.0/sites/{site-id}/drive/items/{item-id}/extractSensitivityLabels, but it returns a 404 error, despite the sensitivity label being applied to the document, which is visible when the document is opened.

For Emails: I used the endpoint https://graph.microsoft.com/v1.0/me/messages/{message-id}, but it does not provide any information regarding the sensitivity label. The email I was fetching was sent from another domain where Purview was enabled, and the email was marked with a sensitivity label before it was sent. I have verified that the information exists in the email's internet headers.

I consider that if there were any rights issues, there should have been an insufficient privileges error. I have provided the InformationProtectionPolicy.Read permission to my Azure app, so I believe the rights are set correctly.

Can anyone provide guidance on how to retrieve the sensitivity labels and suggest the best methods to do so?

Best Regards,

Kanwal Singh

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
13,541 questions
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.