{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/peppolstatus-com/json-schema/peppolstatus-com-participants-mix-schema.json",
  "title": "ParticipantsMix",
  "description": "The participant breakdowns over a filtered slice, or over the whole network. Either computed (`degraded: false`, every mix non-null) or degraded (`degraded: true`, every count and mix null) — the two states never mix.",
  "x-generated": "2026-11-20",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/peppolstatus-com-openapi.json#/components/schemas/ParticipantsMix",
  "type": "object",
  "required": [
    "source",
    "degraded",
    "participant_count",
    "refreshed_at",
    "country_mix",
    "entity_type_mix",
    "sector_mix",
    "size_mix",
    "region_mix",
    "ap_mix"
  ],
  "properties": {
    "source": {
      "type": "string",
      "enum": [
        "slice",
        "rollup"
      ],
      "description": "Which population the numbers describe: `slice` when the request narrowed and the breakdowns were computed live, `rollup` when it narrowed on nothing and the hourly whole-network facets answered. Callers should show it."
    },
    "degraded": {
      "type": "boolean",
      "description": "True when the breakdowns could not be computed honestly — the request carried a filter this endpoint cannot express, or selected a slice wider than the internal cap. Every mix and the count are then null and the caller falls back to the whole-network breakdown on GET /v1/stats/participants."
    },
    "participant_count": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Exact size of the population the mixes describe (not an estimate, not capped). On `source: \"rollup\"` this is the rollup's `total_count`. Null when degraded."
    },
    "refreshed_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "When the rollup behind a `source: \"rollup\"` answer was last built. Null on a live slice and when degraded."
    },
    "country_mix": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/ApMixBucket"
      },
      "description": "Participants per country, count desc. Card country, falling back to the ICD-implied one."
    },
    "entity_type_mix": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/ApMixBucket"
      },
      "description": "Participants per company legal-form family, count desc. Sparse: sums below participant_count by the un-enriched remainder."
    },
    "sector_mix": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/ApMixBucket"
      },
      "description": "Participants per 2-digit NACE Rev. 2.1 division, count desc. Sparse."
    },
    "size_mix": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/ApMixBucket"
      },
      "description": "Participants per company size band code, count desc; each bucket carries its `label`. Sparse."
    },
    "region_mix": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/ApMixBucket"
      },
      "description": "Participants per company region code, count desc; each bucket carries its `label`. Sparse."
    },
    "ap_mix": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/ParticipantsApMixBucket"
      },
      "description": "Participants per serving Access Point Seat, count desc. The busiest Seats are named; on a live slice the rest fold into one `__other__` bucket, while a rollup answer is truncated to the same length (its facet is already a top-N, so a remainder over it would be unknowable). Participants no Seat serves are not a bucket."
    }
  },
  "$defs": {
    "ApMixBucket": {
      "type": "object",
      "required": [
        "value",
        "count"
      ],
      "properties": {
        "value": {
          "type": "string"
        },
        "count": {
          "type": "integer"
        },
        "label": {
          "type": "string",
          "description": "Display label of `value`, on the buckets of a `size_mix` and a `region_mix` only: the English size band label (21 → \"50–99 employees\") and the region name in the local language (84 → \"Auvergne-Rhône-Alpes\"). Equal to `value` when the code is unknown. Filter on `value`."
        }
      }
    },
    "ParticipantsApMixBucket": {
      "type": "object",
      "description": "One Access Point bucket of the participant mix. `value` is the SeatID, which is what `?ap=` filters on; `label` / `slug` name the curated Provider operating it and are absent when the Seat has no curated mapping.",
      "required": [
        "value",
        "count"
      ],
      "properties": {
        "value": {
          "type": "string"
        },
        "count": {
          "type": "integer"
        },
        "label": {
          "type": "string"
        },
        "slug": {
          "type": "string"
        },
        "remainder": {
          "type": "boolean",
          "description": "Present and true only on the `__other__` bucket folding every Seat outside the named top ones. Not a filterable SeatID."
        }
      }
    }
  }
}