{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/inforcer/json-schema/inforcer-get-user-response-schema.json",
  "title": "getUserResponse",
  "description": "The response to a request to get a single tenant user",
  "x-generated": "2026-12-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/inforcer-openapi.json#/components/schemas/getUserResponse",
  "type": "object",
  "additionalProperties": false,
  "allOf": [
    {
      "$ref": "#/$defs/baseResponseEnvelope"
    },
    {
      "type": "object",
      "properties": {
        "data": {
          "$ref": "#/$defs/user"
        }
      }
    }
  ],
  "$defs": {
    "appRoleAssignment": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "appRoleId": {
          "type": [
            "string",
            "null"
          ],
          "format": "guid"
        },
        "principalDisplayName": {
          "type": [
            "string",
            "null"
          ]
        },
        "principalId": {
          "type": [
            "string",
            "null"
          ],
          "format": "guid"
        },
        "principalType": {
          "type": [
            "string",
            "null"
          ]
        },
        "resourceDisplayName": {
          "type": [
            "string",
            "null"
          ]
        },
        "resourceId": {
          "type": [
            "string",
            "null"
          ],
          "format": "guid"
        }
      }
    },
    "baseResponseEnvelope": {
      "type": "object",
      "description": "The common properties of responses",
      "additionalProperties": false,
      "properties": {
        "success": {
          "type": "boolean",
          "description": "Whether the request was successful"
        },
        "message": {
          "type": [
            "string",
            "null"
          ],
          "description": "An optional message"
        },
        "errors": {
          "type": "array",
          "description": "Any errors that occurred during the request",
          "default": [],
          "items": {
            "type": "string"
          }
        }
      },
      "required": [
        "success",
        "message",
        "errors"
      ]
    },
    "directoryObject": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": [
            "string",
            "null"
          ],
          "format": "guid"
        }
      }
    },
    "role": {
      "type": "object",
      "description": "A directory role assigned to the user",
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": [
            "string",
            "null"
          ],
          "format": "guid"
        },
        "displayName": {
          "type": [
            "string",
            "null"
          ]
        },
        "roleTemplateId": {
          "type": [
            "string",
            "null"
          ],
          "format": "guid"
        }
      }
    },
    "user": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": [
            "string",
            "null"
          ],
          "format": "guid",
          "description": "The user ID"
        },
        "displayName": {
          "type": [
            "string",
            "null"
          ],
          "description": "The display name of the user"
        },
        "givenName": {
          "type": [
            "string",
            "null"
          ],
          "description": "The user's first name"
        },
        "surname": {
          "type": [
            "string",
            "null"
          ],
          "description": "The user's last name"
        },
        "userPrincipalName": {
          "type": [
            "string",
            "null"
          ],
          "description": "The user principal name (UPN)"
        },
        "userType": {
          "type": [
            "string",
            "null"
          ],
          "description": "The user type (e.g. Member or Guest)"
        },
        "jobTitle": {
          "type": [
            "string",
            "null"
          ],
          "description": "The user's job title"
        },
        "department": {
          "type": [
            "string",
            "null"
          ],
          "description": "The user's department"
        },
        "mail": {
          "type": [
            "string",
            "null"
          ],
          "description": "The user's email address"
        },
        "mobilePhone": {
          "type": [
            "string",
            "null"
          ],
          "description": "The user's mobile phone number"
        },
        "businessPhones": {
          "type": [
            "array",
            "null"
          ],
          "description": "List of business phone numbers",
          "items": {
            "type": "string"
          }
        },
        "officeLocation": {
          "type": [
            "string",
            "null"
          ],
          "description": "The user's office location"
        },
        "streetAddress": {
          "type": [
            "string",
            "null"
          ],
          "description": "The user's street address"
        },
        "city": {
          "type": [
            "string",
            "null"
          ],
          "description": "The user's city"
        },
        "state": {
          "type": [
            "string",
            "null"
          ],
          "description": "The user's state"
        },
        "postalCode": {
          "type": [
            "string",
            "null"
          ],
          "description": "The user's postal code"
        },
        "country": {
          "type": [
            "string",
            "null"
          ],
          "description": "The user's country"
        },
        "preferredLanguage": {
          "type": [
            "string",
            "null"
          ],
          "description": "The user's preferred language"
        },
        "accountEnabled": {
          "type": [
            "boolean",
            "null"
          ],
          "description": "Whether the user account is enabled"
        },
        "usageLocation": {
          "type": [
            "string",
            "null"
          ],
          "description": "The user's usage location"
        },
        "createdDateTime": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "When the user was created"
        },
        "lastPasswordChangeDateTime": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "When the user last changed their password"
        },
        "lastSignInDateTime": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "When the user last signed in"
        },
        "companyName": {
          "type": [
            "string",
            "null"
          ],
          "description": "The user's company name"
        },
        "employeeId": {
          "type": [
            "string",
            "null"
          ],
          "description": "The user's employee ID"
        },
        "employeeType": {
          "type": [
            "string",
            "null"
          ],
          "description": "The user's employee type"
        },
        "employeeHireDate": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "The user's hire date"
        },
        "mailNickname": {
          "type": [
            "string",
            "null"
          ],
          "description": "The user's mail alias"
        },
        "preferredDataLocation": {
          "type": [
            "string",
            "null"
          ],
          "description": "The user's preferred data location"
        },
        "onPremisesSyncEnabled": {
          "type": [
            "boolean",
            "null"
          ],
          "description": "Whether the user is synced from on-premises"
        },
        "otherMails": {
          "type": [
            "array",
            "null"
          ],
          "description": "Other email addresses for the user",
          "items": {
            "type": "string"
          }
        },
        "proxyAddresses": {
          "type": [
            "array",
            "null"
          ],
          "description": "Proxy addresses for the user",
          "items": {
            "type": "string"
          }
        },
        "creationType": {
          "type": [
            "string",
            "null"
          ],
          "description": "The type of user creation"
        },
        "passwordPolicies": {
          "type": [
            "string",
            "null"
          ],
          "description": "Password policies applied to the user"
        },
        "signInSessionsValidFromDateTime": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "Date and time from which sign-in sessions are valid"
        },
        "imAddresses": {
          "type": [
            "array",
            "null"
          ],
          "description": "Instant messaging addresses",
          "items": {
            "type": "string"
          }
        },
        "legalAgeGroupClassification": {
          "type": [
            "string",
            "null"
          ],
          "description": "Legal age group classification"
        },
        "onPremisesLastSyncDateTime": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "Last on-premises sync date and time"
        },
        "onPremisesDistinguishedName": {
          "type": [
            "string",
            "null"
          ],
          "description": "The on-premises distinguished name"
        },
        "onPremisesDomainName": {
          "type": [
            "string",
            "null"
          ],
          "description": "The on-premises domain name"
        },
        "onPremisesImmutableId": {
          "type": [
            "string",
            "null"
          ],
          "description": "The on-premises immutable ID"
        },
        "onPremisesSecurityIdentifier": {
          "type": [
            "string",
            "null"
          ],
          "description": "The on-premises security identifier"
        },
        "onPremisesSamAccountName": {
          "type": [
            "string",
            "null"
          ],
          "description": "The on-premises SAM account name"
        },
        "onPremisesUserPrincipalName": {
          "type": [
            "string",
            "null"
          ],
          "description": "The on-premises user principal name"
        },
        "manager": {
          "$ref": "#/$defs/directoryObject",
          "nullable": true,
          "description": "The user's manager"
        },
        "groups": {
          "type": [
            "array",
            "null"
          ],
          "description": "Groups the user is a transitive member of",
          "items": {
            "$ref": "#/$defs/userGroup"
          }
        },
        "roles": {
          "type": [
            "array",
            "null"
          ],
          "description": "Directory roles assigned to the user",
          "items": {
            "$ref": "#/$defs/role"
          }
        },
        "devices": {
          "type": [
            "array",
            "null"
          ],
          "description": "Devices owned by the user",
          "items": {
            "$ref": "#/$defs/userDevice"
          }
        },
        "isGlobalAdmin": {
          "type": [
            "boolean",
            "null"
          ],
          "description": "Whether the user is a global administrator"
        },
        "isCloudOnly": {
          "type": [
            "boolean",
            "null"
          ],
          "description": "Whether the user is a cloud-only user"
        },
        "isHybrid": {
          "type": [
            "boolean",
            "null"
          ],
          "description": "Whether the user is a hybrid user"
        },
        "isMfaRegistered": {
          "type": [
            "boolean",
            "null"
          ],
          "description": "Whether the user is registered for MFA. Null if not licensed."
        },
        "isMfaCapable": {
          "type": [
            "boolean",
            "null"
          ],
          "description": "Whether the user is capable of MFA. Null if not licensed."
        },
        "isAllDevicesCompliant": {
          "type": [
            "boolean",
            "null"
          ],
          "description": "Whether all devices owned by the user are compliant"
        },
        "riskState": {
          "type": [
            "string",
            "null"
          ],
          "description": "The risk state of the user. Null if not licensed."
        },
        "riskDetail": {
          "type": [
            "string",
            "null"
          ],
          "description": "The risk detail of the user. Null if not licensed."
        },
        "riskLevel": {
          "type": [
            "string",
            "null"
          ],
          "description": "The risk level of the user. Null if not licensed."
        },
        "appRoleAssignments": {
          "type": [
            "array",
            "null"
          ],
          "description": "App role assignments for the user",
          "items": {
            "$ref": "#/$defs/appRoleAssignment"
          }
        },
        "assignedLicenses": {
          "type": [
            "array",
            "null"
          ],
          "description": "Licenses assigned to the user",
          "items": {
            "$ref": "#/$defs/userLicense"
          }
        }
      }
    },
    "userDevice": {
      "type": "object",
      "description": "A device owned by the user",
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "string",
          "format": "guid",
          "description": "The unique identifier of the device"
        },
        "complianceExpiryDateTime": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "deviceCategory": {
          "type": [
            "string",
            "null"
          ]
        },
        "deviceOwnership": {
          "type": [
            "string",
            "null"
          ]
        },
        "displayName": {
          "type": [
            "string",
            "null"
          ]
        },
        "isCompliant": {
          "type": [
            "boolean",
            "null"
          ]
        },
        "isManaged": {
          "type": [
            "boolean",
            "null"
          ]
        },
        "isManagementRestricted": {
          "type": [
            "boolean",
            "null"
          ]
        },
        "isRooted": {
          "type": [
            "boolean",
            "null"
          ]
        },
        "managementType": {
          "type": [
            "string",
            "null"
          ]
        },
        "manufacturer": {
          "type": [
            "string",
            "null"
          ]
        },
        "model": {
          "type": [
            "string",
            "null"
          ]
        },
        "operatingSystem": {
          "type": [
            "string",
            "null"
          ]
        },
        "operatingSystemVersion": {
          "type": [
            "string",
            "null"
          ]
        },
        "profileType": {
          "type": [
            "string",
            "null"
          ]
        },
        "registrationDateTime": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "trustType": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "userGroup": {
      "type": "object",
      "description": "A group the user is a member of",
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "string",
          "format": "guid",
          "description": "The unique identifier of the group"
        },
        "displayName": {
          "type": "string",
          "description": "The display name of the group"
        },
        "description": {
          "type": [
            "string",
            "null"
          ],
          "description": "The description of the group"
        },
        "groupTypes": {
          "type": "array",
          "description": "A string list of the types of groups",
          "items": {
            "type": "string"
          }
        }
      },
      "required": [
        "id",
        "displayName",
        "groupTypes"
      ]
    },
    "userLicense": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "sku": {
          "type": "string",
          "description": "The unique string identifier for the SKU, also known as the part number e.g. \"EXCHANGESTANDARD\" or \"Microsoft_365_E3_(no_Teams)\"."
        },
        "skuId": {
          "type": "string",
          "format": "guid",
          "description": "The unique identifier of the license SKU"
        },
        "name": {
          "type": [
            "string",
            "null"
          ],
          "description": "The display-friendly SKU name e.g. \"Exchange Online (Plan 1)\" or \"Microsoft 365 Business Standard (no Teams)\". May be null if a display name mapping could not be found."
        },
        "capabilityStatus": {
          "type": [
            "string",
            "null"
          ],
          "description": "The capability status of the license"
        },
        "isExpired": {
          "type": "boolean",
          "description": "Is the license expired"
        },
        "isCancelled": {
          "type": "boolean",
          "description": "Is the license cancelled"
        },
        "state": {
          "type": "string",
          "description": "The state of the license assignment"
        }
      }
    }
  }
}