{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/azure-ad/json-schema/azure-ad-microsoft-graph-directory-role-schema.json",
  "title": "microsoft.graph.directoryRole",
  "x-generated": "2026-11-05",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/azure-ad-directoryroles-directoryrole-api-openapi.yml#/components/schemas/microsoft.graph.directoryRole",
  "allOf": [
    {
      "$ref": "#/$defs/microsoft.graph.directoryObject"
    },
    {
      "title": "directoryRole",
      "type": "object",
      "properties": {
        "description": {
          "type": [
            "string",
            "null"
          ],
          "description": "The description for the directory role. Read-only. Supports $filter (eq), $search, $select."
        },
        "displayName": {
          "type": [
            "string",
            "null"
          ],
          "description": "The display name for the directory role. Read-only. Supports $filter (eq), $search, $select."
        },
        "roleTemplateId": {
          "type": [
            "string",
            "null"
          ],
          "description": "The id of the directoryRoleTemplate that this role is based on. The property must be specified when activating a directory role in a tenant with a POST operation. After the directory role has been activated, the property is read-only. Supports $filter (eq), $select."
        },
        "members": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/microsoft.graph.directoryObject"
          },
          "description": "Users that are members of this directory role. HTTP Methods: GET, POST, DELETE. Read-only. Nullable. Supports $expand.",
          "x-ms-navigationProperty": true
        },
        "scopedMembers": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/microsoft.graph.scopedRoleMembership"
          },
          "description": "Members of this directory role that are scoped to administrative units. Read-only. Nullable.",
          "x-ms-navigationProperty": true
        }
      },
      "additionalProperties": {
        "type": "object"
      }
    }
  ],
  "$defs": {
    "microsoft.graph.directoryObject": {
      "allOf": [
        {
          "$ref": "#/$defs/microsoft.graph.entity"
        },
        {
          "title": "directoryObject",
          "type": "object",
          "properties": {
            "deletedDateTime": {
              "pattern": "^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$",
              "type": [
                "string",
                "null"
              ],
              "description": "Date and time when this object was deleted. Always null when the object hasn't been deleted.",
              "format": "date-time"
            }
          },
          "additionalProperties": {
            "type": "object"
          }
        }
      ]
    },
    "microsoft.graph.entity": {
      "title": "entity",
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "The unique identifier for an entity. Read-only."
        }
      },
      "additionalProperties": {
        "type": "object"
      }
    },
    "microsoft.graph.identity": {
      "title": "identity",
      "type": "object",
      "properties": {
        "displayName": {
          "type": [
            "string",
            "null"
          ],
          "description": "The display name of the identity.For drive items, the display name might not always be available or up to date. For example, if a user changes their display name the API might show the new value in a future response, but the items associated with the user don't show up as changed when using delta."
        },
        "id": {
          "type": [
            "string",
            "null"
          ],
          "description": "Unique identifier for the identity or actor. For example, in the access reviews decisions API, this property might record the id of the principal, that is, the group, user, or application that's subject to review."
        }
      },
      "additionalProperties": {
        "type": "object"
      }
    },
    "microsoft.graph.scopedRoleMembership": {
      "allOf": [
        {
          "$ref": "#/$defs/microsoft.graph.entity"
        },
        {
          "title": "scopedRoleMembership",
          "type": "object",
          "properties": {
            "administrativeUnitId": {
              "type": "string",
              "description": "Unique identifier for the administrative unit that the directory role is scoped to"
            },
            "roleId": {
              "type": "string",
              "description": "Unique identifier for the directory role that the member is in."
            },
            "roleMemberInfo": {
              "$ref": "#/$defs/microsoft.graph.identity"
            }
          },
          "additionalProperties": {
            "type": "object"
          }
        }
      ]
    }
  }
}