{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/microsoft-graph/json-schema/microsoft-graph-microsoft-graph-role-definition-schema.json",
  "title": "microsoft.graph.roleDefinition",
  "x-generated": "2026-11-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/microsoft-graph-devicemanagement-deviceandappmanagementroleassignment-api-openapi.yml#/components/schemas/microsoft.graph.roleDefinition",
  "allOf": [
    {
      "$ref": "#/$defs/microsoft.graph.entity"
    },
    {
      "title": "roleDefinition",
      "required": [
        "@odata.type"
      ],
      "type": "object",
      "properties": {
        "description": {
          "type": [
            "string",
            "null"
          ],
          "description": "Description of the Role definition."
        },
        "displayName": {
          "type": [
            "string",
            "null"
          ],
          "description": "Display Name of the Role definition."
        },
        "isBuiltIn": {
          "type": "boolean",
          "description": "Type of Role. Set to True if it is built-in, or set to False if it is a custom role definition."
        },
        "rolePermissions": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/microsoft.graph.rolePermission"
          },
          "description": "List of Role Permissions this role is allowed to perform. These must match the actionName that is defined as part of the rolePermission."
        },
        "roleAssignments": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/microsoft.graph.roleAssignment"
          },
          "description": "List of Role assignments for this role definition.",
          "x-ms-navigationProperty": true
        },
        "@odata.type": {
          "type": "string"
        }
      },
      "description": "The Role Definition resource. The role definition is the foundation of role based access in Intune. The role combines an Intune resource such as a Mobile App and associated role permissions such as Create or Read for the resource. There are two types of roles, built-in and custom. Built-in roles cannot be modified. Both built-in roles and custom roles must have assignments to be enforced. Create custom roles if you want to define a role that allows any of the available resources and role permissions to be combined into a single role."
    }
  ],
  "$defs": {
    "microsoft.graph.entity": {
      "title": "entity",
      "required": [
        "@odata.type"
      ],
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "The unique identifier for an entity. Read-only."
        },
        "@odata.type": {
          "type": "string"
        }
      }
    },
    "microsoft.graph.resourceAction": {
      "title": "resourceAction",
      "required": [
        "@odata.type"
      ],
      "type": "object",
      "properties": {
        "allowedResourceActions": {
          "type": "array",
          "items": {
            "type": [
              "string",
              "null"
            ]
          },
          "description": "Allowed Actions"
        },
        "notAllowedResourceActions": {
          "type": "array",
          "items": {
            "type": [
              "string",
              "null"
            ]
          },
          "description": "Not Allowed Actions."
        },
        "@odata.type": {
          "type": "string"
        }
      },
      "description": "Set of allowed and not allowed actions for a resource."
    },
    "microsoft.graph.roleAssignment": {
      "allOf": [
        {
          "$ref": "#/$defs/microsoft.graph.entity"
        },
        {
          "title": "roleAssignment",
          "required": [
            "@odata.type"
          ],
          "type": "object",
          "properties": {
            "description": {
              "type": [
                "string",
                "null"
              ],
              "description": "Indicates the description of the role assignment. For example: 'All administrators, employees and scope tags associated with the Houston office.' Max length is 1024 characters."
            },
            "displayName": {
              "type": [
                "string",
                "null"
              ],
              "description": "Indicates the display name of the role assignment. For example: 'Houston administrators and users'. Max length is 128 characters."
            },
            "resourceScopes": {
              "type": "array",
              "items": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "description": "Indicates the list of resource scope security group Entra IDs. For example: {dec942f4-6777-4998-96b4-522e383b08e2}."
            },
            "roleDefinition": {
              "anyOf": [
                {
                  "$ref": "#/$defs/microsoft.graph.roleDefinition"
                },
                {
                  "type": [
                    "object",
                    "null"
                  ]
                }
              ],
              "description": "Indicates the role definition for this role assignment.",
              "x-ms-navigationProperty": true
            },
            "@odata.type": {
              "type": "string"
            }
          },
          "description": "The Role Assignment resource. Role assignments tie together a role definition with members and scopes. There can be one or more role assignments per role. This applies to custom and built-in roles."
        }
      ]
    },
    "microsoft.graph.roleDefinition": {
      "allOf": [
        {
          "$ref": "#/$defs/microsoft.graph.entity"
        },
        {
          "title": "roleDefinition",
          "required": [
            "@odata.type"
          ],
          "type": "object",
          "properties": {
            "description": {
              "type": [
                "string",
                "null"
              ],
              "description": "Description of the Role definition."
            },
            "displayName": {
              "type": [
                "string",
                "null"
              ],
              "description": "Display Name of the Role definition."
            },
            "isBuiltIn": {
              "type": "boolean",
              "description": "Type of Role. Set to True if it is built-in, or set to False if it is a custom role definition."
            },
            "rolePermissions": {
              "type": "array",
              "items": {
                "$ref": "#/$defs/microsoft.graph.rolePermission"
              },
              "description": "List of Role Permissions this role is allowed to perform. These must match the actionName that is defined as part of the rolePermission."
            },
            "roleAssignments": {
              "type": "array",
              "items": {
                "$ref": "#/$defs/microsoft.graph.roleAssignment"
              },
              "description": "List of Role assignments for this role definition.",
              "x-ms-navigationProperty": true
            },
            "@odata.type": {
              "type": "string"
            }
          },
          "description": "The Role Definition resource. The role definition is the foundation of role based access in Intune. The role combines an Intune resource such as a Mobile App and associated role permissions such as Create or Read for the resource. There are two types of roles, built-in and custom. Built-in roles cannot be modified. Both built-in roles and custom roles must have assignments to be enforced. Create custom roles if you want to define a role that allows any of the available resources and role permissions to be combined into a single role."
        }
      ]
    },
    "microsoft.graph.rolePermission": {
      "title": "rolePermission",
      "required": [
        "@odata.type"
      ],
      "type": "object",
      "properties": {
        "resourceActions": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/microsoft.graph.resourceAction"
          },
          "description": "Resource Actions each containing a set of allowed and not allowed permissions."
        },
        "@odata.type": {
          "type": "string"
        }
      },
      "description": "Contains the set of ResourceActions determining the allowed and not allowed permissions for each role."
    }
  }
}