{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/contraforce/json-schema/contraforce-api-response-of-ienumerable-of-user-schema.json",
  "title": "ApiResponseOfIEnumerableOfUser",
  "description": "Standard v2 API response envelope for single-item responses.",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/contraforce-users-api-openapi.yml#/components/schemas/ApiResponseOfIEnumerableOfUser",
  "type": "object",
  "properties": {
    "data": {
      "type": [
        "null",
        "array"
      ],
      "items": {
        "description": "Represents an employee or a user in ContraForce client's tenant and it's built on top of the Microsoft Graph user model and could be extended based on other provider needs",
        "$ref": "#/$defs/User"
      }
    },
    "meta": {
      "$ref": "#/$defs/ResponseMeta"
    }
  },
  "$defs": {
    "AppRole": {
      "enum": [
        "DefaultAccess",
        "Admin",
        "User",
        "Billing",
        "IncidentAnalyst",
        "IncidentResponder",
        "DataSourceAdmin"
      ]
    },
    "OrganizationalRole": {
      "enum": [
        "Admin",
        "UserAdmin",
        "WorkspaceAdmin",
        "AgentAdmin",
        "Member",
        "OrgContentOperator",
        "OrgContentAdmin"
      ]
    },
    "ResponseMeta": {
      "type": "object",
      "properties": {
        "requestId": {
          "type": [
            "null",
            "string"
          ]
        },
        "timestamp": {
          "type": [
            "null",
            "string"
          ]
        }
      }
    },
    "User": {
      "type": "object",
      "properties": {
        "id": {
          "type": [
            "null",
            "string"
          ]
        },
        "displayName": {
          "type": [
            "null",
            "string"
          ]
        },
        "firstName": {
          "type": [
            "null",
            "string"
          ]
        },
        "lastName": {
          "type": [
            "null",
            "string"
          ]
        },
        "profilePictureUrl": {
          "type": [
            "null",
            "string"
          ]
        },
        "email": {
          "type": [
            "null",
            "string"
          ]
        },
        "username": {
          "type": [
            "null",
            "string"
          ]
        },
        "appRole": {
          "$ref": "#/$defs/AppRole"
        },
        "addedOn": {
          "type": "string",
          "format": "date-time"
        },
        "hasLoggedIn": {
          "type": "boolean"
        },
        "isServiceAccount": {
          "type": "boolean"
        },
        "isAgentUser": {
          "type": "boolean"
        },
        "isScimManaged": {
          "type": "boolean",
          "description": "True when Microsoft Entra ID provisions the user through SCIM: their organizational role is derived from the\ndefault role for provisioned users and their groups, and cannot be set in the portal."
        },
        "organizationRole": {
          "$ref": "#/$defs/OrganizationalRole"
        },
        "workspaceRole": {
          "$ref": "#/$defs/WorkspaceRole"
        },
        "groups": {
          "type": [
            "null",
            "array"
          ],
          "items": {
            "$ref": "#/$defs/UserGroup"
          }
        },
        "roleAssignments": {
          "type": [
            "null",
            "array"
          ],
          "items": {
            "$ref": "#/$defs/UserRoleAssignment"
          }
        }
      },
      "description": "Represents an employee or a user in ContraForce client's tenant and it's built on top of the Microsoft Graph user model and could be extended based on other provider needs"
    },
    "UserGroup": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "accountId": {
          "type": "string",
          "format": "uuid"
        },
        "accountName": {
          "type": [
            "null",
            "string"
          ]
        },
        "creationDate": {
          "type": "string",
          "format": "date-time"
        },
        "lastModificationDate": {
          "type": "string",
          "format": "date-time"
        },
        "groupOwner": {
          "type": [
            "null",
            "string"
          ]
        },
        "name": {
          "type": [
            "null",
            "string"
          ]
        },
        "description": {
          "type": [
            "null",
            "string"
          ]
        },
        "members": {
          "type": [
            "null",
            "array"
          ],
          "items": {
            "description": "Represents an employee or a user in ContraForce client's tenant and it's built on top of the Microsoft Graph user model and could be extended based on other provider needs",
            "$ref": "#/$defs/User"
          }
        },
        "role": {
          "$ref": "#/$defs/WorkspaceRole"
        },
        "workspacesAssigned": {
          "type": [
            "null",
            "array"
          ],
          "items": {
            "type": "string"
          }
        },
        "isScimManaged": {
          "type": "boolean",
          "description": "True when Microsoft Entra ID provisions the group through SCIM: its name and members are managed in Entra and\nlocked in the portal, while its description, workspace assignments and organizational role stay editable."
        },
        "orgRole": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "description": "The organizational role members hold for as long as they belong to the group; null when the group grants none.\nOnly SCIM-managed groups grant one.",
              "$ref": "#/$defs/OrganizationalRole"
            }
          ]
        }
      }
    },
    "UserRoleAssignment": {
      "type": "object",
      "properties": {
        "userId": {
          "type": [
            "null",
            "string"
          ]
        },
        "workspaceId": {
          "type": [
            "null",
            "string"
          ]
        },
        "workspaceName": {
          "type": [
            "null",
            "string"
          ]
        },
        "assignmentType": {
          "type": [
            "null",
            "string"
          ]
        },
        "role": {
          "$ref": "#/$defs/WorkspaceRole"
        }
      }
    },
    "WorkspaceRole": {
      "enum": [
        "Owner",
        "ContentAdmin",
        "IncidentResponder",
        "IncidentAnalyst",
        "WorkspaceReader"
      ]
    }
  }
}