{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/microsoft-entra/json-schema/microsoft-entra-group-collection-response-schema.json",
  "title": "GroupCollectionResponse",
  "description": "Paged collection of group objects",
  "x-generated": "2026-11-05",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/microsoft-entra-groups-api-openapi.yml#/components/schemas/GroupCollectionResponse",
  "type": "object",
  "properties": {
    "@odata.context": {
      "type": "string"
    },
    "@odata.count": {
      "type": "integer"
    },
    "@odata.nextLink": {
      "type": "string",
      "format": "uri"
    },
    "value": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Group"
      }
    }
  },
  "$defs": {
    "DirectoryObject": {
      "type": "object",
      "description": "Base type for many directory resources including users, groups, and service principals",
      "properties": {
        "@odata.type": {
          "type": "string",
          "description": "The OData type string for the directory object"
        },
        "id": {
          "type": "string",
          "description": "Unique identifier for the directory object"
        },
        "displayName": {
          "type": [
            "string",
            "null"
          ],
          "description": "The display name of the directory object"
        }
      }
    },
    "Group": {
      "type": "object",
      "description": "Represents a Microsoft Entra group. Groups can be Microsoft 365 groups, security groups, mail-enabled security groups, or distribution groups.",
      "properties": {
        "id": {
          "type": "string",
          "readOnly": true,
          "description": "Unique identifier for the group (GUID)"
        },
        "displayName": {
          "type": "string",
          "description": "The display name for the group. Required on create."
        },
        "description": {
          "type": [
            "string",
            "null"
          ],
          "description": "An optional description for the group"
        },
        "mailEnabled": {
          "type": "boolean",
          "description": "Specifies whether the group is mail-enabled. Required on create. Set to true for Microsoft 365 groups."
        },
        "mailNickname": {
          "type": "string",
          "description": "The mail alias for the group, unique for Microsoft 365 groups. Required on create."
        },
        "securityEnabled": {
          "type": "boolean",
          "description": "Specifies whether the group is a security group. Required on create. Set to false for Microsoft 365 groups."
        },
        "groupTypes": {
          "type": "array",
          "description": "Specifies the group type. Set to [\"Unified\"] for Microsoft 365 groups. Empty array or [\"DynamicMembership\"] for other types.",
          "items": {
            "type": "string",
            "enum": [
              "Unified",
              "DynamicMembership"
            ]
          }
        },
        "visibility": {
          "type": [
            "string",
            "null"
          ],
          "description": "Specifies the group's join policy and content visibility for Microsoft 365 groups",
          "enum": [
            "Public",
            "Private",
            "HiddenMembership",
            null
          ]
        },
        "membershipRule": {
          "type": [
            "string",
            "null"
          ],
          "description": "The rule that determines members for this group if the group is a dynamic group. Example: user.department -eq \"Marketing\""
        },
        "membershipRuleProcessingState": {
          "type": [
            "string",
            "null"
          ],
          "description": "Indicates whether the dynamic membership processing is on or paused. Possible values are On or Paused.",
          "enum": [
            "On",
            "Paused",
            null
          ]
        },
        "mail": {
          "type": [
            "string",
            "null"
          ],
          "readOnly": true,
          "description": "The SMTP address for the group"
        },
        "proxyAddresses": {
          "type": "array",
          "readOnly": true,
          "description": "Email addresses for the group that direct to the same inbox",
          "items": {
            "type": "string"
          }
        },
        "isAssignableToRole": {
          "type": [
            "boolean",
            "null"
          ],
          "description": "Indicates whether this group can be assigned to a Microsoft Entra role. Can only be set at group creation time."
        },
        "onPremisesSyncEnabled": {
          "type": [
            "boolean",
            "null"
          ],
          "readOnly": true,
          "description": "true if this group is synced from an on-premises directory"
        },
        "createdDateTime": {
          "type": "string",
          "format": "date-time",
          "readOnly": true,
          "description": "Timestamp of when the group was created"
        },
        "renewedDateTime": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "readOnly": true,
          "description": "Timestamp of when the group was last renewed (activity that extends expiration)"
        },
        "members": {
          "type": "array",
          "readOnly": true,
          "description": "Direct members of this group. Returned only with $expand.",
          "items": {
            "$ref": "#/$defs/DirectoryObject"
          }
        },
        "owners": {
          "type": "array",
          "readOnly": true,
          "description": "Owners of the group. Returned only with $expand.",
          "items": {
            "$ref": "#/$defs/DirectoryObject"
          }
        }
      }
    }
  }
}