List sensitivityLabels

Namespace: microsoft.graph.security

Important

APIs under the /beta version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported. To determine whether an API is available in v1.0, use the Version selector.

Get a list of sensitivityLabel objects associated with a user or organization.

This API is available in the following national cloud deployments.

Global service US Government L4 US Government L5 (DOD) China operated by 21Vianet

Permissions

Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.

Permission type Least privileged permissions Higher privileged permissions
Delegated (work or school account) InformationProtectionPolicy.Read Not available.
Delegated (personal Microsoft account) Not supported. Not supported.
Application InformationProtectionPolicy.Read.All Not available.

HTTP request

To get labels available to the signed-in user (delegated permission) or a specified user (application permission):

GET /users/{usersId}/security/informationProtection/sensitivityLabels
GET /me/security/informationProtection/sensitivityLabels

To get labels available to the organization as a service principal (application permission):

GET /security/informationProtection/sensitivityLabels

Optional query parameters

This method supports some of the OData query parameters to help customize the response. For general information, see OData query parameters.

Request headers

Name Description
Authorization Bearer {token}. Required. Learn more about authentication and authorization.
User-Agent Describes the name and version of the calling application. Details will surface in Azure Information Protection Analytics. Suggested format is ApplicationName/Version. Optional.

Request body

Don't supply a request body for this method.

Response

If successful, this method returns a 200 OK response code and a collection of sensitivityLabel objects in the response body.

Examples

Request

The following example shows a request.

GET https://graph.microsoft.com/beta/users/bob@contoso.com/security/informationProtection/sensitivityLabels

Response

The following example shows the response.

HTTP/1.1 200 OK
Content-Type: application/json

{
  "@odata.context": "https://graph.microsoft.com/beta/$metadata#users('bob%40contoso.com')/security/informationProtection/sensitivityLabels",
  "value": [
    {
      "id": "0d39dc11-75ff-4309-8b32-ff94f0e41607",
      "name": "Any User (No Protection)",
      "description": "",
      "color": "",
      "sensitivity": 7,
      "tooltip": "The most sensitive information stored by Milt0rCorp; product plans, customer information, and other trade secrets. Data labeled for Any User will not be protected and should be used with caution and sparingly.",
      "isActive": true,
      "isAppliable": true,
      "contentFormats": [
        "file",
        "email",
        "schematizeddata"
      ],
      "hasProtection": false,
      "parent@odata.context": "https://graph.microsoft.com/beta/$metadata#users('bob%40constoso.com')/security/informationProtection/sensitivityLabels('0d39dc11-75ff-4309-8b32-ff94f0e41607')/parent/$entity",
      "parent": {
        "id": "566663c7-4d8d-4b8f-b280-784a31971dbe",
        "name": "Highly Confidential",
        "description": "",
        "color": "",
        "sensitivity": 7,
        "tooltip": "The most sensitive information at Milt0rCorp; product plans, customer information, data not shareable even under NDA.",
        "isActive": false,
        "isAppliable": false,
        "contentFormats": [
          "file",
          "email",
          "schematizeddata"
        ],
        "hasProtection": false,
        "parent@odata.context": "https://graph.microsoft.com/beta/$metadata#users('bob%40contoso.com')/security/informationProtection/sensitivityLabels('0d39dc11-75ff-4309-8b32-ff94f0e41607')/parent/parent/$entity",
        "parent": null
      }
    }
  ]
}