Using classic Outlook for Windows in business environments
Welcome to the Microsoft Q&A and thank you for posting your questions here.
Currently, the Microsoft Graph API does not directly return the sensitivity label information for a draft email through the me/messages/{message_id} endpoint. However, the sensitivity label data is typically stored as part of the email’s metadata and may be available through different properties, depending on your setup and permissions.
One approach is to use Microsoft Information Protection SDK or Exchange Online PowerShell to get the sensitivity label applied to a message. While this isn’t available directly via Graph API for draft emails, the label might be exposed through other API endpoints or via a compliance-related service.
Applying a Different Sensitivity Label:
To apply or change a sensitivity label programmatically, you could use:
- Microsoft Graph API for updating the message, but you’ll need to set the sensitivity header or modify its properties.
- Outlook Add-ins with MIP SDK: You can integrate sensitivity label functionality directly into your custom add-in, which allows you to enforce or modify labels based on your specific logic.
Unfortunately, there's currently no direct API to update a sensitivity label via Graph API but using the MIP SDK would allow you to perform labeling changes on emails.
Hope this helps. Do let us know if you any further queries.
If this answers your query, do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.