{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/deputy/json-schema/deputy-access-management-list-role-response-schema.json",
  "title": "Response to list all available roles",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/deputy-access-management-role-api-openapi.yml#/components/schemas/AccessManagementListRoleResponse",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean"
    },
    "roles": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/tenantauthv2modelEmployeeRole"
      }
    }
  },
  "$defs": {
    "modelEmployeeRoleOperations": {
      "type": "object",
      "properties": {
        "view": {
          "type": "boolean",
          "title": "Indicates if the Role can be viewed"
        },
        "edit": {
          "type": "boolean",
          "title": "Indicates if the Role can be edited"
        },
        "delete": {
          "type": "boolean",
          "title": "Indicates if the Role can be deleted"
        },
        "duplicate": {
          "type": "boolean",
          "title": "Indicates if the Role can be duplicated"
        },
        "viewHistory": {
          "type": "boolean",
          "title": "Indicates if the History of the Role can be viewed"
        }
      }
    },
    "tenantauthv2modelEmployeeRole": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "format": "int32",
          "title": "Unique identifier of the role"
        },
        "name": {
          "type": "string",
          "title": "Name of the role"
        },
        "ranking": {
          "type": "integer",
          "format": "int32",
          "title": "Ranking of the role"
        },
        "require2fa": {
          "type": "boolean",
          "title": "Whether 2FA is required for this role"
        },
        "reportsTo": {
          "type": "integer",
          "format": "int32",
          "title": "Unique identifier of the role that this role reports to"
        },
        "alsoReportsTo": {
          "type": "array",
          "items": {
            "type": "integer",
            "format": "int32"
          },
          "title": "Unique identifiers of the roles that this role also reports to"
        },
        "employeeCount": {
          "type": "integer",
          "format": "int32",
          "title": "[read-only] Number of employees assigned to this role"
        },
        "permissionCount": {
          "type": "integer",
          "format": "int32",
          "title": "[read-only] Number of permissions assigned to this role"
        },
        "privilegeNames": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "title": "Privileges assigned to this role"
        },
        "lastUpdatedAt": {
          "type": "string",
          "format": "date-time",
          "title": "Last modification time of the role"
        },
        "operations": {
          "$ref": "#/$defs/modelEmployeeRoleOperations",
          "title": "Operations that can be performed on the Role"
        },
        "acceptsReportees": {
          "type": "boolean",
          "title": "Indicates if the Role can be included in another role's \"report to\" or \"also reports to\" list"
        }
      },
      "title": "Role is assigned to employees and has permissions"
    }
  }
}