{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/live-earnings-com/json-schema/live-earnings-com-metric-history-schema.json",
  "title": "MetricHistory",
  "x-generated": "2026-11-17",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/live-earnings-com-openapi.yaml#/components/schemas/MetricHistory",
  "type": "object",
  "properties": {
    "company_id": {
      "type": "string"
    },
    "metric_id": {
      "type": "string"
    },
    "display_name": {
      "type": "string"
    },
    "as_of": {
      "type": "string"
    },
    "definitions": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "definition_version_id": {
            "type": "string"
          },
          "version": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "text": {
            "type": "string"
          },
          "effective_from_period": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "definition_version_id",
          "version",
          "text",
          "effective_from_period"
        ],
        "additionalProperties": false
      }
    },
    "observations": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "observation_id": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "actual",
              "guidance"
            ]
          },
          "period_label": {
            "type": "string",
            "description": "As printed, e.g. \"Q2 2026\" or \"FY 2026\"."
          },
          "period_type": {
            "type": "string",
            "enum": [
              "quarter",
              "year"
            ]
          },
          "fiscal_year": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "fiscal_quarter": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "operator": {
            "type": "string",
            "enum": [
              "eq",
              "approx",
              "range",
              "point_plus_minus",
              "gte",
              "gt",
              "lte",
              "lt"
            ]
          },
          "lower": {
            "type": [
              "number",
              "null"
            ]
          },
          "upper": {
            "type": [
              "number",
              "null"
            ]
          },
          "point": {
            "description": "In the metric's base scale (e.g. € millions).",
            "type": [
              "number",
              "null"
            ]
          },
          "printed": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {},
            "description": "The figure exactly as printed: tokens, scale word, decimals."
          },
          "origin": {
            "type": "string",
            "const": "printed",
            "description": "The company's own figure."
          },
          "provenance": {
            "type": "string",
            "enum": [
              "release_table",
              "release_text",
              "call",
              "derived"
            ]
          },
          "status": {
            "type": "string"
          },
          "role": {
            "type": "string",
            "enum": [
              "current",
              "reprint",
              "prior_as_stated"
            ]
          },
          "issued_at": {
            "type": "string"
          },
          "source": {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "enum": [
                  "sec_exhibit",
                  "live_transcript"
                ]
              },
              "url": {
                "type": "string",
                "description": "The document: the immutable SEC Archives URL, or the call's transcript turn."
              },
              "accession": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "published_at": {
                "type": "string",
                "description": "When the company published it (EDGAR acceptance for an exhibit)."
              }
            },
            "required": [
              "kind",
              "url",
              "accession",
              "published_at"
            ],
            "additionalProperties": false
          },
          "locator": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {},
            "description": "Where in the source: table, row and column headers, or sentence line, or transcript turn."
          },
          "verbatim": {
            "type": "string",
            "description": "The row or sentence exactly as published."
          },
          "checked_by": {
            "type": "object",
            "properties": {
              "by": {
                "type": "string",
                "enum": [
                  "table_map",
                  "person",
                  "model_review"
                ],
                "description": "table_map: a cell under the company's table map, which a person approved; person: approved item by item."
              },
              "channel": {
                "type": "string",
                "enum": [
                  "cli",
                  "chat"
                ]
              }
            },
            "required": [
              "by",
              "channel"
            ],
            "additionalProperties": false
          },
          "restated_later": {
            "type": "boolean"
          },
          "call_slug": {
            "type": [
              "string",
              "null"
            ]
          },
          "definition_version_id": {
            "type": "string"
          },
          "superseded_by": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "observation_id",
          "kind",
          "period_label",
          "period_type",
          "fiscal_year",
          "fiscal_quarter",
          "operator",
          "lower",
          "upper",
          "point",
          "printed",
          "origin",
          "provenance",
          "status",
          "role",
          "issued_at",
          "source",
          "locator",
          "verbatim",
          "checked_by",
          "restated_later",
          "call_slug",
          "definition_version_id",
          "superseded_by"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": [
    "company_id",
    "metric_id",
    "display_name",
    "as_of",
    "definitions",
    "observations"
  ],
  "additionalProperties": false
}