List attributeSets

Namespace: microsoft.graph

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 the attributeSet objects and their properties.

Permissions

One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Permissions.

Permission type Permissions (from least to most privileged)
Delegated (work or school account) CustomSecAttributeDefinition.Read.All, CustomSecAttributeDefinition.ReadWrite.All
Delegated (personal Microsoft account) Not supported.
Application CustomSecAttributeDefinition.Read.All, CustomSecAttributeDefinition.ReadWrite.All

The signed-in user must also be assigned one of the following directory roles:

  • Attribute Assignment Reader
  • Attribute Definition Reader
  • Attribute Assignment Administrator
  • Attribute Definition Administrator

By default, Global Administrator and other administrator roles do not have permissions to read, define, or assign custom security attributes.

HTTP request

GET /directory/attributeSets

Optional query parameters

This method supports the $select, $top, and $orderBy OData query parameters to help customize the response. For general information, see OData query parameters.

Request headers

Name Description
Authorization Bearer {token}. Required.

Request body

Do not supply a request body for this method.

Response

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

Examples

Example 1: Get all attribute sets

The following example gets all attribute sets in a tenant.

Request

GET https://graph.microsoft.com/beta/directory/attributeSets

Response

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

{
    "@odata.context": "https://graph.microsoft.com/beta/$metadata#directory/attributeSets",
    "value": [
        {
            "description": "Attributes for engineering team",
            "id": "Engineering",
            "maxAttributesPerSet": 25
        },
        {
            "description": "Attributes for marketing team",
            "id": "Marketing",
            "maxAttributesPerSet": 25
        }
    ]
}

Example 2: Get top attribute sets

The following example gets the top 10 attribute sets with support for paging.

Request

GET https://graph.microsoft.com/beta/directory/attributeSets?$top=10

Response

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

{
    "@odata.context": "https://graph.microsoft.com/beta/$metadata#directory/attributeSets",
    "@odata.nextLink": "https://graph.microsoft.com/beta/directory/attributeSets?$top=10&$skiptoken={skiptoken}",
    "value": [
        {
            "description": "Attributes for engineering team",
            "id": "Engineering",
            "maxAttributesPerSet": 25
        },
        {
            "description": "Attributes for marketing team",
            "id": "Marketing",
            "maxAttributesPerSet": 25
        }
    ]
}

Example 3: Get attribute sets in order

The following example gets attribute sets ordered by id.

Request

GET https://graph.microsoft.com/beta/directory/attributeSets?$orderBy=id

Response

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

{
    "@odata.context": "https://graph.microsoft.com/beta/$metadata#directory/attributeSets",
    "value": [
        {
            "description": "Attributes for applications",
            "id": "Application",
            "maxAttributesPerSet": 25
        },
        {
            "description": "Attributes for engineering team",
            "id": "Engineering",
            "maxAttributesPerSet": 25
        }
    ]
}