PostHog · Schema

ExperimentApiMetric

A/B TestingAnalyticsFeature FlagsOpen SourceProduct AnalyticsSession Recording

Properties

Name Type Description
completion_event object For retention metrics: completion event.
conversion_window integer Conversion window duration.
denominator object For ratio metrics: denominator source.
goal object Whether higher or lower values indicate success.
kind string
metric_type object
name string Human-readable metric name.
numerator object For ratio metrics: numerator source.
retention_window_end integer
retention_window_start integer
retention_window_unit object
series array For funnel metrics: array of EventsNode/ActionsNode steps.
source object For mean metrics: event source.
start_event object For retention metrics: start event.
start_handling object
uuid string Unique identifier. Auto-generated if omitted.
View JSON Schema on GitHub

JSON Schema

posthog-experimentapimetric-schema.json Raw ↑
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "#/components/schemas/ExperimentApiMetric",
  "title": "ExperimentApiMetric",
  "additionalProperties": false,
  "properties": {
    "completion_event": {
      "default": null,
      "description": "For retention metrics: completion event.",
      "allOf": [
        {
          "$ref": "#/components/schemas/ExperimentApiEventSource"
        }
      ],
      "nullable": true
    },
    "conversion_window": {
      "default": null,
      "description": "Conversion window duration.",
      "title": "Conversion Window",
      "type": "integer",
      "nullable": true
    },
    "denominator": {
      "default": null,
      "description": "For ratio metrics: denominator source.",
      "allOf": [
        {
          "$ref": "#/components/schemas/ExperimentApiEventSource"
        }
      ],
      "nullable": true
    },
    "goal": {
      "default": null,
      "description": "Whether higher or lower values indicate success.",
      "allOf": [
        {
          "$ref": "#/components/schemas/ExperimentMetricGoal"
        }
      ],
      "nullable": true
    },
    "kind": {
      "default": "ExperimentMetric",
      "title": "Kind",
      "type": "string",
      "enum": [
        "ExperimentMetric"
      ]
    },
    "metric_type": {
      "$ref": "#/components/schemas/ExperimentMetricType"
    },
    "name": {
      "default": null,
      "description": "Human-readable metric name.",
      "title": "Name",
      "type": "string",
      "nullable": true
    },
    "numerator": {
      "default": null,
      "description": "For ratio metrics: numerator source.",
      "allOf": [
        {
          "$ref": "#/components/schemas/ExperimentApiEventSource"
        }
      ],
      "nullable": true
    },
    "retention_window_end": {
      "default": null,
      "title": "Retention Window End",
      "type": "integer",
      "nullable": true
    },
    "retention_window_start": {
      "default": null,
      "title": "Retention Window Start",
      "type": "integer",
      "nullable": true
    },
    "retention_window_unit": {
      "default": null,
      "allOf": [
        {
          "$ref": "#/components/schemas/FunnelConversionWindowTimeUnit"
        }
      ],
      "nullable": true
    },
    "series": {
      "default": null,
      "description": "For funnel metrics: array of EventsNode/ActionsNode steps.",
      "title": "Series",
      "items": {
        "$ref": "#/components/schemas/ExperimentApiEventSource"
      },
      "type": "array",
      "nullable": true
    },
    "source": {
      "default": null,
      "description": "For mean metrics: event source.",
      "allOf": [
        {
          "$ref": "#/components/schemas/ExperimentApiEventSource"
        }
      ],
      "nullable": true
    },
    "start_event": {
      "default": null,
      "description": "For retention metrics: start event.",
      "allOf": [
        {
          "$ref": "#/components/schemas/ExperimentApiEventSource"
        }
      ],
      "nullable": true
    },
    "start_handling": {
      "default": null,
      "allOf": [
        {
          "$ref": "#/components/schemas/StartHandling"
        }
      ],
      "nullable": true
    },
    "uuid": {
      "default": null,
      "description": "Unique identifier. Auto-generated if omitted.",
      "title": "Uuid",
      "type": "string",
      "nullable": true
    }
  },
  "required": [
    "metric_type"
  ],
  "type": "object"
}