{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/peppolstatus-com/json-schema/peppolstatus-com-ap-provider-detail-schema.json",
  "title": "ApProviderDetail",
  "x-generated": "2026-11-20",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/peppolstatus-com-openapi.json#/components/schemas/ApProviderDetail",
  "type": "object",
  "required": [
    "key",
    "name",
    "verified",
    "participant_count",
    "seats",
    "country_mix",
    "scheme_mix",
    "doctypes",
    "transports"
  ],
  "properties": {
    "kind": {
      "type": "string",
      "const": "provider",
      "description": "The row kind. Always `provider` on this shape."
    },
    "key": {
      "type": "string",
      "description": "The canonical provider key (see ApView.key). Always the current one."
    },
    "name": {
      "type": "string"
    },
    "verified": {
      "type": "boolean"
    },
    "commercial_name": {
      "type": [
        "string",
        "null"
      ],
      "description": "Customer-facing brand from the curated seat directory, which can differ from the certificate O= name. Across several member seats the lowest seat id with a value wins. null when uncurated. Additive."
    },
    "website": {
      "type": [
        "string",
        "null"
      ],
      "description": "The provider's own website from the curated seat directory, picked like commercial_name. null when unknown. Additive."
    },
    "participant_count": {
      "type": "integer",
      "description": "AP-cert roster size: participants whose signing-cert identity attributes them to this Provider, independent of who hosts their SMP."
    },
    "hosted_participant_count": {
      "type": [
        "integer",
        "null"
      ],
      "description": "SMP-hosting footprint of the linked registry provider (the /v1/providers participant_count): participants whose current SMP binding resolves to one of that provider's hosts. For a multi-tenant SMP operator this far exceeds participant_count above. null/absent when no registry provider link exists. Additive."
    },
    "smp_hostnames": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "string"
      },
      "description": "The linked registry provider's mapped SMP hostnames backing hosted_participant_count (from provider_host), capped at 10 — the /v1/participants `smp=` filter values, for deep-linking the hosted footprint to the pre-filtered participants list. null/absent when unlinked/unmapped. Additive."
    },
    "smp_hostname_count": {
      "type": [
        "integer",
        "null"
      ],
      "description": "TRUE total of the linked registry provider's mapped SMP hostnames, behind the capped smp_hostnames sample above. null/absent when no registry provider link exists. Additive."
    },
    "hostnames": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "string"
      },
      "description": "The host machines the member seats are currently sighted operating on (seat_sighting, across AP and SMP signing certs — distinct, sorted, capped at 20). The reverse of the host detail page's Seat(s) list, for linking each host to its /hosts/{hostname} page. null/absent when no member seat is sighted on an open host. Additive."
    },
    "hostname_count": {
      "type": [
        "integer",
        "null"
      ],
      "description": "TRUE total of distinct currently-sighted hostnames, behind the capped hostnames sample above. null/absent when none is sighted. Additive."
    },
    "software": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/ApSoftwareRow"
      },
      "description": "The sighted hostnames grouped by registrable domain, each with the crawled software identity of that domain — who operates the machines and what product answers there. An `infrastructure` row reads \"runs on X\", never \"is X\". Sorted host_count desc, then domain. null/absent when no domain passes the surfacing rule (curated, or confidence >= 0.8). Additive."
    },
    "sub_providers": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "object",
        "required": [
          "seat_id",
          "sub_provider",
          "participants"
        ],
        "properties": {
          "seat_id": {
            "type": "string",
            "description": "The member seat the bucket belongs to."
          },
          "sub_provider": {
            "type": "string",
            "description": "Curated sub-provider (reseller) slug, e.g. `codabox`."
          },
          "participants": {
            "type": "integer",
            "description": "Distinct participants on that seat whose SMP ServiceDescription matches the slug."
          },
          "name": {
            "type": "string",
            "description": "The curated Vendor label of the slug."
          },
          "vendor_key": {
            "type": [
              "string",
              "null"
            ],
            "description": "The key of the Vendor's own row (`/v1/aps/{key}`, Market tier); null when the Vendor has none, because all its traffic is on Seats of its own company."
          }
        }
      },
      "description": "Sub-providers (resellers) detected behind the member seats via the SMP ServiceDescription fingerprint (seat_sub_provider_rollup) — who resells or brands the traffic behind a shared seat, e.g. CodaBox behind the Flowin / Wolters Kluwer seat. Only curated allow-list matches surface (the free-text long tail is never exposed raw); an ADDITIVE annotation — the signing cert and seat remain the operator ground truth. Sorted participants desc, capped at 20. null/absent when nothing matches. Additive."
    },
    "smp_tenants": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/ApSmpTenant"
      },
      "description": "The Access Points that serve the participants on this Provider's SMP hosts: the hosted footprint (`hosted_participant_count`) grouped by each participant's current serving seat, from a precomputed rollup. On a multi-tenant SMP most of the hosted footprint is served by OTHER APs, each signing with its own seat; the Provider's own seats carry `self: true`. Sorted participants desc, then seat_id, capped at 25. Participants with no current AP are not a row (see `smp_tenant_no_ap`). null/absent when no registry provider is linked or before the first rollup. Additive."
    },
    "smp_tenant_count": {
      "type": [
        "integer",
        "null"
      ],
      "description": "True number of distinct serving seats behind the capped `smp_tenants`."
    },
    "smp_tenant_other": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Participants summed over the seats folded out of `smp_tenants` by the cap."
    },
    "smp_tenant_no_ap": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Participants on this Provider's SMP hosts with no current serving AP."
    },
    "smp_hosted_by": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/ApSmpHost"
      },
      "description": "Reverse direction: the registry providers whose SMP hosts carry participants that this Provider's member seats serve (e.g. a SaaS AP whose participants sit on a third-party SMP). The Provider's own SMP is excluded. Sorted participants desc, capped at 10. null/absent when none or before the first rollup. Additive."
    },
    "unique_organizations": {
      "type": "integer",
      "description": "Unique organizations across the roster (sum of member seats' distinct company_key counts). Additive; absent on a pre-#451 rollup."
    },
    "ids_per_organization": {
      "type": [
        "number",
        "null"
      ],
      "description": "participant_count / unique_organizations; null under the <100-participant noise guard, absent on a pre-#451 rollup."
    },
    "seats": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/SeatRef"
      }
    },
    "country_mix": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ApMixBucket"
      }
    },
    "scheme_mix": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ApMixBucket"
      }
    },
    "entity_type_mix": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ApMixBucket"
      },
      "description": "Roster composition by company entity type (company | natural_person | association | public). Company enrichment covers part of the roster only, so the buckets sum BELOW participant_count — the difference is the unenriched remainder, which a client should show as its own bucket rather than drop. Absent when nothing in the roster is enriched. Additive."
    },
    "sector_mix": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ApMixBucket"
      },
      "description": "Roster composition by 2-digit NACE Rev. 2.1 division. Same sparsity caveat as entity_type_mix; absent when nothing is enriched. Additive."
    },
    "size_mix": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ApMixBucket"
      },
      "description": "Roster composition by company size band code, each bucket with its `label`. The register data has a size for FR (INSEE trancheEffectifs codes; `NN` = unknown) and NO (the same code set plus `1-4`) only, so absent for a roster with no such participant. Additive."
    },
    "region_mix": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ApMixBucket"
      },
      "description": "Roster composition by company region code, each bucket with its `label`. The register data has a region for FR (bare INSEE région code) and BE, NO, SK (ISO 3166-2) only, so absent for a roster with no such participant. Additive."
    },
    "doctypes": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Distinct Peppol document type URNs present in this provider's roster (sorted). The roster-scoped option set for the doctype filter; empty on a pre-rollup row, where the client falls back to the global doctype catalog."
    },
    "transports": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Distinct transport profile ids present in this provider's roster (sorted). The roster-scoped option set for the transport filter; empty → global fallback."
    }
  },
  "$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`."
        }
      }
    },
    "ApSmpHost": {
      "type": "object",
      "description": "One SMP-hosting registry provider that carries part of an AP's roster (issue #865).",
      "required": [
        "provider_key",
        "ap_key",
        "name",
        "participants"
      ],
      "properties": {
        "provider_key": {
          "type": "string",
          "description": "Registry provider natural key (the SMP host's operator)."
        },
        "ap_key": {
          "type": [
            "string",
            "null"
          ],
          "description": "The access point key of that Provider; null when unresolved."
        },
        "name": {
          "type": "string",
          "description": "Display name; falls back to the provider_key."
        },
        "participants": {
          "type": "integer",
          "description": "Participants on that provider's SMP hosts that this AP's member seats serve."
        }
      }
    },
    "ApSmpTenant": {
      "type": "object",
      "description": "One serving Access Point on a Provider's SMP hosts (issue #865).",
      "required": [
        "seat_id",
        "ap_key",
        "ap_name",
        "participants",
        "self"
      ],
      "properties": {
        "seat_id": {
          "type": "string",
          "description": "The serving seat id (e.g. `PFR000964`)."
        },
        "ap_key": {
          "type": [
            "string",
            "null"
          ],
          "description": "The access point key of the Provider that holds this seat, for a `/v1/aps/{key}` lookup; null when unresolved."
        },
        "ap_name": {
          "type": [
            "string",
            "null"
          ],
          "description": "Display name of that Provider; null when unresolved."
        },
        "participants": {
          "type": "integer",
          "description": "Participants on the SMP hosts whose current serving seat is `seat_id`."
        },
        "self": {
          "type": "boolean",
          "description": "true when the seat is one of this Provider's own member seats."
        }
      }
    },
    "ApSoftwareRow": {
      "type": "object",
      "description": "One registrable domain behind an access point's sighted hosts, with its software identity and how many of those hosts live on it.",
      "required": [
        "profile",
        "host_count",
        "hostnames"
      ],
      "properties": {
        "profile": {
          "$ref": "#/$defs/HostProfileView"
        },
        "host_count": {
          "type": "integer",
          "description": "TRUE count of distinct sighted hostnames on this domain."
        },
        "hostnames": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "A sorted SAMPLE of those hostnames (capped at 5) for deep-linking /hosts/{hostname}; see host_count for the total."
        }
      }
    },
    "HostProfileView": {
      "type": "object",
      "description": "Crawled software identity of the host's registrable domain (eTLD+1), so every `smp.acme.com` / `ap.acme.com` shares one profile. Only rows that pass the surfacing rule appear: a curator confirmed the identity (`curated: true`), or extraction confidence reached 0.8 — then the row is AUTO-GENERATED and UNVERIFIED and must be labelled as such.",
      "required": [
        "domain",
        "status",
        "company_name",
        "product_name",
        "tagline",
        "category",
        "confidence",
        "curated",
        "screenshot_url",
        "crawled_at"
      ],
      "properties": {
        "domain": {
          "type": "string",
          "description": "The registrable domain the profile describes."
        },
        "status": {
          "type": "string",
          "enum": [
            "identified",
            "infrastructure"
          ],
          "description": "`identified` — the domain's own company/product. `infrastructure` — a multi-tenant platform the host RUNS ON (read it as \"runs on X\", never \"is X\")."
        },
        "company_name": {
          "type": [
            "string",
            "null"
          ]
        },
        "product_name": {
          "type": [
            "string",
            "null"
          ]
        },
        "tagline": {
          "type": [
            "string",
            "null"
          ]
        },
        "category": {
          "type": [
            "string",
            "null"
          ]
        },
        "confidence": {
          "type": [
            "number",
            "null"
          ],
          "description": "Extraction confidence 0..1; null for a curated row with no stored score."
        },
        "curated": {
          "type": "boolean",
          "description": "True when a curator confirmed the identity. False means auto-generated and unverified — annotate, never assert."
        },
        "screenshot_url": {
          "type": [
            "string",
            "null"
          ],
          "description": "Same-origin path to the homepage screenshot (`/v1/hosts/asset/{domain}/screenshot.jpg`, free tier); null when none captured."
        },
        "crawled_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        }
      }
    },
    "SeatProvider": {
      "type": "object",
      "description": "Embedded provider for a seat, verified mapping or unverified CN fallback.",
      "required": [
        "slug",
        "name",
        "country",
        "verified"
      ],
      "properties": {
        "slug": {
          "type": [
            "string",
            "null"
          ]
        },
        "name": {
          "type": [
            "string",
            "null"
          ]
        },
        "country": {
          "type": [
            "string",
            "null"
          ]
        },
        "verified": {
          "type": "boolean"
        },
        "key": {
          "type": [
            "string",
            "null"
          ],
          "description": "The curated provider's OpenPeppol registry natural key, when the mapping carries one. It decides whether the seat's operator and a host's owner are the same party; it is not a /v1/aps route key and not the slug. Optional: absent on a cached response minted before the field shipped."
        }
      }
    },
    "SeatRef": {
      "type": "object",
      "required": [
        "seat_id",
        "provider"
      ],
      "properties": {
        "seat_id": {
          "type": "string"
        },
        "provider": {
          "$ref": "#/$defs/SeatProvider"
        }
      }
    }
  }
}