Forum Discussion
TRGx
Feb 24, 2026Copper Contributor
Rollback Script for Purview Auto Labels Using PnP/Graph – Anyone Done This?
Hi , I have been working on a rollback script using PnP and Microsoft Graph API to remove a sensitivity label from SharePoint and OneDrive documents through an Enterprise App (service principal). T...
milgo
Microsoft
Feb 26, 2026Hello and thanks for reaching out.
I would expect this error because some Microsoft Graph APIs are metered. Label assignment/removal for SharePoint and OneDrive via Graph uses protected (metered) APIs such as assignSensitivityLabel, which require enabling metered APIs and linking the app to an Azure subscription (PAYG). This is explicitly a paid, premium capability. Here is an overview of metered APIs
Assign Sensitivity Label is mentioned as a Metered API