Share via

How to add a sensitivity label to SharePoint document library using GraphAPI

Harsha Jha 66 Reputation points
2026-03-31T01:24:10.1233333+00:00

In the SharePoint UI, I can configure a default sensitivity label for a document library by going to Library Settings → Default sensitivity labels and selecting a label (e.g., General \ Anyone (unrestricted)). This applies the label automatically to all newly created or edited Office files within that library.

I'd like to automate this via the Microsoft Graph API instead of doing it manually through the UI.

I am unable to find Graph API request URL to run the API
User's image

Microsoft Security | Microsoft Graph
0 comments No comments

1 answer

Sort by: Most helpful
  1. Anthony Porter 150 Reputation points
    2026-04-14T23:48:13.68+00:00

    There is currently no Microsoft Graph API that can configure the Default sensitivity label for a SharePoint document library.

    That library-level setting (Library Settings → Default sensitivity labels) is not exposed via Graph. Graph only supports:

    • Reading sensitivity labels
    • Assigning labels to individual files/items (for example, assignSensitivityLabel)

    The SharePoint UI sets this using a SharePoint list property called DefaultSensitivityLabelForLibrary, which is only configurable via:

    • SharePoint REST API, or
    • PnP PowerShell (Set-PnPList -DefaultSensitivityLabelForLibrary)

    If you need to automate this today, you must use SharePoint REST or PnP. Graph cannot do this at the library level at this time.

    https://learn.microsoft.com/en-us/graph/api/resources/security-sensitivitylabel?view=graph-rest-1.0

    0 comments No comments

Your answer

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