{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/cms-gov/json-schema/cms-gov-flattened-enrollment-group-schema.json",
  "title": "FlattenedEnrollmentGroup",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cms-gov-enrollments-api-openapi.yml#/components/schemas/FlattenedEnrollmentGroup",
  "properties": {
    "id": {
      "type": "string"
    },
    "csr": {
      "$ref": "#/$defs/CostSharingReductionEnum"
    },
    "enrollees": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ExtendedEnrollee"
      }
    },
    "grouping_reason": {
      "type": "string"
    },
    "year": {
      "x-example": 2019,
      "type": "number",
      "format": "integer"
    },
    "subscriber_id": {
      "type": "string"
    },
    "relationships": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/RelationshipEdge"
      }
    },
    "effective_date": {
      "type": "string",
      "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
      "x-example": "2020-01-01"
    }
  },
  "$defs": {
    "Address": {
      "properties": {
        "city": {
          "type": "string"
        },
        "state": {
          "type": "string"
        },
        "street_1": {
          "type": "string"
        },
        "street_2": {
          "type": "string"
        },
        "zipcode": {
          "type": "string"
        },
        "countyfips": {
          "description": "5-digit county FIPS code",
          "type": "string"
        }
      },
      "type": "object"
    },
    "CostSharingReductionEnum": {
      "type": "string",
      "description": "Cost-sharing reduction (CSR)",
      "enum": [
        "Exchange variant (no CSR)",
        "Zero Cost Sharing Plan Variation",
        "Limited Cost Sharing Plan Variation",
        "73% AV Level Silver Plan CSR",
        "87% AV Level Silver Plan CSR",
        "94% AV Level Silver Plan CSR",
        "Non-Exchange variant",
        "Unknown CSR"
      ],
      "properties": {}
    },
    "CurrentEnrollment": {
      "description": "Current/existing enrollment information used to determine tobacco status for CiC enrollments. This will ensure rate calculation is done correctly.",
      "required": [
        "plan_id",
        "effective_date",
        "uses_tobacco"
      ],
      "properties": {
        "plan_id": {
          "$ref": "#/$defs/PlanID"
        },
        "effective_date": {
          "description": "Date plan went into effect (ISO-8601 YYYY-MM-DD)",
          "type": "string",
          "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
          "x-example": "2020-01-01"
        },
        "uses_tobacco": {
          "type": "boolean"
        }
      },
      "type": "object"
    },
    "ExtendedEnrollee": {
      "properties": {
        "id": {
          "description": "The enrollee's id (uuid)",
          "type": "string",
          "pattern": "^[a-f0-9-]+$"
        },
        "name": {
          "description": "The enrollee's name",
          "type": "string"
        },
        "gender": {
          "$ref": "#/$defs/GenderEnum"
        },
        "dob": {
          "description": "The enrollee's date of birth (iso8601 date)",
          "type": "string",
          "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
        },
        "location": {
          "$ref": "#/$defs/Address"
        },
        "csr": {
          "$ref": "#/$defs/CostSharingReductionEnum"
        },
        "is_filer": {
          "type": "boolean"
        },
        "effective_age": {
          "type": "integer",
          "description": "Effective age of the enrollee at time of enrollment."
        },
        "has_hardship": {
          "type": "boolean"
        },
        "relationship": {
          "$ref": "#/$defs/Relationship"
        },
        "allowed_metal_levels": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/MetalLevelEnum"
          }
        },
        "allowed_plan_ids": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/PlanID"
          }
        },
        "current_enrollment": {
          "$ref": "#/$defs/CurrentEnrollment"
        }
      }
    },
    "GenderEnum": {
      "enum": [
        "Male",
        "Female"
      ],
      "type": "string"
    },
    "MetalLevelEnum": {
      "enum": [
        "Catastrophic",
        "Silver",
        "Bronze",
        "Gold",
        "Platinum"
      ],
      "type": "string",
      "properties": {}
    },
    "PlanID": {
      "type": "string",
      "pattern": "^[0-9]{5}[A-Z]{2}[0-9]{7}$",
      "properties": {}
    },
    "Relationship": {
      "description": "Should match one of the [listed valid relationships](#introduction/more-information-about-households).",
      "type": "string",
      "properties": {}
    },
    "RelationshipEdge": {
      "properties": {
        "super_id": {
          "type": "string",
          "description": "enrollee id"
        },
        "sub_id": {
          "type": "string",
          "description": "enrollee id"
        },
        "relationship": {
          "$ref": "#/$defs/Relationship"
        }
      }
    }
  }
}