LogBrew · Schema

SdkProductAnalyticsRetentionResponse

Complete bounded, identity-safe retention response.

ObservabilityLoggingMonitoringAnalyticsError Tracking

Properties

Name Type Description
cohorts array Non-empty query-relative cohort matrix.
coverage object Capture coverage qualifying the result.
curve array Subject-weighted curve plus equal-cohort comparison.
detail object Version 3: previous-period returns and example users that returned or never returned.
next_action object Stable recommended follow-up.
purpose string Product-level explanation of what this resource answers.
query object Normalized effective query.
schema_version integer Stable response schema for exact machine consumers.
summary object Aggregate subject return outcome.
View JSON Schema on GitHub

JSON Schema

logbrew-sdk-product-analytics-retention-response-schema.json Raw ↑
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/logbrew/json-schema/logbrew-sdk-product-analytics-retention-response-schema.json",
  "title": "SdkProductAnalyticsRetentionResponse",
  "description": "Complete bounded, identity-safe retention response.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/logbrew-product-analytics-api-openapi.yml#/components/schemas/SdkProductAnalyticsRetentionResponse",
  "properties": {
    "cohorts": {
      "description": "Non-empty query-relative cohort matrix.",
      "items": {
        "$ref": "#/$defs/SdkProductAnalyticsRetentionCohortResponse"
      },
      "type": "array"
    },
    "coverage": {
      "$ref": "#/$defs/SdkProductAnalyticsRetentionCoverageResponse",
      "description": "Capture coverage qualifying the result."
    },
    "curve": {
      "description": "Subject-weighted curve plus equal-cohort comparison.",
      "items": {
        "$ref": "#/$defs/SdkProductAnalyticsRetentionPeriodResponse"
      },
      "type": "array"
    },
    "detail": {
      "anyOf": [
        {
          "$ref": "#/$defs/SdkProductAnalyticsDetailResponse"
        },
        {
          "type": "null"
        }
      ],
      "description": "Version 3: previous-period returns and example users that returned or never returned."
    },
    "next_action": {
      "$ref": "#/$defs/SdkProductAnalyticsNextActionResponse",
      "description": "Stable recommended follow-up."
    },
    "purpose": {
      "description": "Product-level explanation of what this resource answers.",
      "type": "string"
    },
    "query": {
      "$ref": "#/$defs/SdkProductAnalyticsRetentionQueryResponse",
      "description": "Normalized effective query."
    },
    "schema_version": {
      "description": "Stable response schema for exact machine consumers.",
      "format": "uint8",
      "maximum": 255,
      "minimum": 0,
      "type": "integer"
    },
    "summary": {
      "$ref": "#/$defs/SdkProductAnalyticsRetentionSummaryResponse",
      "description": "Aggregate subject return outcome."
    }
  },
  "required": [
    "schema_version",
    "query",
    "purpose",
    "summary",
    "coverage",
    "curve",
    "cohorts",
    "next_action"
  ],
  "type": "object",
  "$defs": {
    "SdkProductAnalyticsActivityScope": {
      "description": "Automatic product activity population used instead of an exact event selector.",
      "oneOf": [
        {
          "const": "all_classified_activity",
          "description": "Every supported classified page view, screen view, and interaction in scope.",
          "type": "string"
        }
      ]
    },
    "SdkProductAnalyticsBreakdownValueResponse": {
      "description": "Exact property value that defines one breakdown group.",
      "properties": {
        "property_key": {
          "description": "Standard-context or `tag.`-prefixed property key.",
          "type": "string"
        },
        "value": {
          "description": "Exact captured value; absent for units that never carried the key.",
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "property_key"
      ],
      "type": "object"
    },
    "SdkProductAnalyticsDetailGroupResponse": {
      "description": "One number of the result with its previous-period value and supporting units.",
      "properties": {
        "base_units": {
          "description": "Denominator of `rate` in the selected period, such as entered or eligible units.",
          "format": "uint64",
          "minimum": 0,
          "type": [
            "integer",
            "null"
          ]
        },
        "breakdown": {
          "anyOf": [
            {
              "$ref": "#/$defs/SdkProductAnalyticsBreakdownValueResponse"
            },
            {
              "type": "null"
            }
          ],
          "description": "Property value that defines this group when the result is broken down by a property."
        },
        "change": {
          "description": "`units` minus `previous_units`.",
          "format": "int64",
          "type": "integer"
        },
        "change_rate": {
          "description": "Relative change; absent when the previous value is zero.",
          "format": "double",
          "type": [
            "number",
            "null"
          ]
        },
        "events": {
          "description": "Matching events behind this number, when events are counted separately from units.",
          "format": "uint64",
          "minimum": 0,
          "type": [
            "integer",
            "null"
          ]
        },
        "key": {
          "description": "Stable machine key, unique inside the response.",
          "type": "string"
        },
        "label": {
          "description": "Short human-readable label.",
          "type": "string"
        },
        "previous_rate": {
          "description": "The same rate for the previous period.",
          "format": "double",
          "type": [
            "number",
            "null"
          ]
        },
        "previous_units": {
          "description": "The same number for the previous period of equal length.",
          "format": "uint64",
          "minimum": 0,
          "type": "integer"
        },
        "rate": {
          "description": "`units` divided by `base_units`.",
          "format": "double",
          "type": [
            "number",
            "null"
          ]
        },
        "rate_change_p_value": {
          "description": "Two-sided p-value of a two-proportion z-test of `rate` against `previous_rate`; absent\nwhen either period has no base units, a rate is above 1, or both rates are 0 or 1.",
          "format": "double",
          "type": [
            "number",
            "null"
          ]
        },
        "rate_change_significant": {
          "description": "Whether `rate_change_p_value` is below 0.05.",
          "type": [
            "boolean",
            "null"
          ]
        },
        "units": {
          "description": "Units behind this number in the selected period.",
          "format": "uint64",
          "minimum": 0,
          "type": "integer"
        }
      },
      "required": [
        "key",
        "label",
        "units",
        "previous_units",
        "change",
        "examples"
      ],
      "type": "object"
    },
    "SdkProductAnalyticsDetailResponse": {
      "description": "Previous-period comparison, sample size, and supporting units for one result.",
      "properties": {
        "evidence_hint": {
          "description": "How to read the actions, page views, and traces behind an example.",
          "type": "string"
        },
        "example_limit": {
          "description": "Most examples listed for one group.",
          "format": "uint8",
          "maximum": 255,
          "minimum": 0,
          "type": "integer"
        },
        "groups": {
          "description": "One entry for each number in the result.",
          "items": {
            "$ref": "#/$defs/SdkProductAnalyticsDetailGroupResponse"
          },
          "type": "array"
        },
        "previous_sample_size": {
          "description": "The same population in the previous period.",
          "format": "uint64",
          "minimum": 0,
          "type": "integer"
        },
        "previous_since": {
          "description": "Inclusive start of the previous period, which has the selected period's length.",
          "format": "date-time",
          "type": "string"
        },
        "previous_until": {
          "description": "Exclusive end of the previous period, equal to the selected `since`.",
          "format": "date-time",
          "type": "string"
        },
        "sample_size": {
          "description": "Units in the population behind the headline result.",
          "format": "uint64",
          "minimum": 0,
          "type": "integer"
        },
        "unit": {
          "$ref": "#/$defs/SdkProductAnalyticsUnit",
          "description": "Unit that every group counts and every example names."
        }
      },
      "required": [
        "unit",
        "previous_since",
        "previous_until",
        "sample_size",
        "previous_sample_size",
        "example_limit",
        "groups",
        "evidence_hint"
      ],
      "type": "object"
    },
    "SdkProductAnalyticsEventKind": {
      "description": "Supported version-1 classified product-event kind.",
      "oneOf": [
        {
          "const": "page_view",
          "description": "Browser route view.",
          "type": "string"
        },
        {
          "const": "screen_view",
          "description": "Application-owned screen view.",
          "type": "string"
        },
        {
          "const": "interaction",
          "description": "Explicit application product action.",
          "type": "string"
        }
      ]
    },
    "SdkProductAnalyticsEventRequest": {
      "additionalProperties": false,
      "description": "One exact classified product-event selector.",
      "properties": {
        "event_name": {
          "description": "Stable route template, screen name, or bounded action name.",
          "type": "string"
        },
        "kind": {
          "$ref": "#/$defs/SdkProductAnalyticsEventKind",
          "description": "Supported classified event kind."
        }
      },
      "required": [
        "kind",
        "event_name"
      ],
      "type": "object"
    },
    "SdkProductAnalyticsExampleUnitResponse": {
      "description": "One unit behind a number, with links to its own evidence.",
      "properties": {
        "action_ids": {
          "description": "Up to three product action IDs of this unit inside the selected scope.",
          "items": {
            "format": "uuid",
            "type": "string"
          },
          "type": "array"
        },
        "first_seen_at": {
          "description": "First classified event of this unit inside the selected scope.",
          "format": "date-time",
          "type": [
            "string",
            "null"
          ]
        },
        "last_seen_at": {
          "description": "Last classified event of this unit inside the selected scope.",
          "format": "date-time",
          "type": [
            "string",
            "null"
          ]
        },
        "trace_ids": {
          "description": "Up to three trace IDs of this unit inside the selected scope; page views live here.",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "unit_id": {
          "description": "Opaque session ID or user-subject ID exactly as the application captured it.",
          "type": "string"
        }
      },
      "required": [
        "unit_id",
        "action_ids",
        "trace_ids"
      ],
      "type": "object"
    },
    "SdkProductAnalyticsFixedInterval": {
      "description": "Fixed product-analytics period width.",
      "oneOf": [
        {
          "const": "hour",
          "description": "One hour.",
          "type": "string"
        },
        {
          "const": "day",
          "description": "One fixed 24-hour day.",
          "type": "string"
        },
        {
          "const": "week",
          "description": "One fixed seven-day week.",
          "type": "string"
        },
        {
          "const": "thirty_day",
          "description": "One fixed 30-day period; this is not a calendar month.",
          "type": "string"
        }
      ]
    },
    "SdkProductAnalyticsNextActionResponse": {
      "description": "Stable follow-up guidance for improving or investigating product analytics.",
      "properties": {
        "code": {
          "description": "Stable action code.",
          "type": "string"
        },
        "reason": {
          "description": "Why the follow-up is useful.",
          "type": "string"
        },
        "target": {
          "description": "API or capture resource to use next.",
          "type": "string"
        }
      },
      "required": [
        "code",
        "target",
        "reason"
      ],
      "type": "object"
    },
    "SdkProductAnalyticsRetentionCellResponse": {
      "description": "One period cell inside a query-relative cohort row.",
      "properties": {
        "all_subjects_eligible": {
          "description": "Whether this cohort's complete subject set is eligible.",
          "type": "boolean"
        },
        "eligible_subjects": {
          "description": "Subjects in this cohort eligible for the period.",
          "format": "uint64",
          "minimum": 0,
          "type": "integer"
        },
        "period": {
          "description": "Zero-based subject-relative period.",
          "format": "uint8",
          "maximum": 255,
          "minimum": 0,
          "type": "integer"
        },
        "retained_subjects": {
          "description": "Eligible subjects carrying a qualifying return.",
          "format": "uint64",
          "minimum": 0,
          "type": "integer"
        },
        "retention_rate": {
          "description": "Exact retained fraction among eligible cohort subjects.",
          "format": "double",
          "type": [
            "number",
            "null"
          ]
        }
      },
      "required": [
        "period",
        "eligible_subjects",
        "retained_subjects",
        "all_subjects_eligible"
      ],
      "type": "object"
    },
    "SdkProductAnalyticsRetentionCohortMode": {
      "description": "How each subject receives a cohort anchor.",
      "oneOf": [
        {
          "const": "first_in_range",
          "description": "Use the subject's first matching start event inside the selected query range.",
          "type": "string"
        }
      ]
    },
    "SdkProductAnalyticsRetentionCohortResponse": {
      "description": "One non-empty query-relative cohort and its retention matrix cells.",
      "properties": {
        "cohort": {
          "description": "Zero-based bucket position from the query lower bound.",
          "format": "uint64",
          "minimum": 0,
          "type": "integer"
        },
        "ended_at": {
          "description": "Exclusive cohort bucket end, capped by the query upper bound.",
          "format": "date-time",
          "type": "string"
        },
        "periods": {
          "description": "Ordered retention cells for every requested period.",
          "items": {
            "$ref": "#/$defs/SdkProductAnalyticsRetentionCellResponse"
          },
          "type": "array"
        },
        "started_at": {
          "description": "Inclusive query-relative cohort bucket start.",
          "format": "date-time",
          "type": "string"
        },
        "subjects": {
          "description": "Identified subjects anchored in this cohort bucket.",
          "format": "uint64",
          "minimum": 0,
          "type": "integer"
        },
        "subjects_returned_after_start": {
          "description": "Cohort subjects carrying any strictly post-anchor return in range.",
          "format": "uint64",
          "minimum": 0,
          "type": "integer"
        }
      },
      "required": [
        "cohort",
        "started_at",
        "ended_at",
        "subjects",
        "subjects_returned_after_start",
        "periods"
      ],
      "type": "object"
    },
    "SdkProductAnalyticsRetentionCoverageResponse": {
      "description": "Capture coverage that qualifies a retention result.",
      "properties": {
        "classified_events": {
          "description": "Supported version-1 classified events in the selected scope.",
          "format": "uint64",
          "minimum": 0,
          "type": "integer"
        },
        "event_name_rate": {
          "description": "Fraction of classified events carrying an exact derived event name.",
          "format": "double",
          "type": [
            "number",
            "null"
          ]
        },
        "excluded_return_events": {
          "description": "Return events excluded because an explicit subject ID is absent.",
          "format": "uint64",
          "minimum": 0,
          "type": "integer"
        },
        "excluded_start_events": {
          "description": "Start events excluded because an explicit subject ID is absent.",
          "format": "uint64",
          "minimum": 0,
          "type": "integer"
        },
        "identified_events": {
          "description": "Classified events carrying an explicit opaque subject ID.",
          "format": "uint64",
          "minimum": 0,
          "type": "integer"
        },
        "limitations": {
          "description": "Material interpretation and capture limitations.",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "named_events": {
          "description": "Classified events carrying a stable derived event name.",
          "format": "uint64",
          "minimum": 0,
          "type": "integer"
        },
        "return_events": {
          "description": "Events matching the requested return selector.",
          "format": "uint64",
          "minimum": 0,
          "type": "integer"
        },
        "return_identity_coverage_rate": {
          "description": "Fraction of selected return events usable for identified-user retention.",
          "format": "double",
          "type": [
            "number",
            "null"
          ]
        },
        "start_events": {
          "description": "Events matching the requested start selector.",
          "format": "uint64",
          "minimum": 0,
          "type": "integer"
        },
        "start_identity_coverage_rate": {
          "description": "Fraction of selected start events usable for identified-user retention.",
          "format": "double",
          "type": [
            "number",
            "null"
          ]
        },
        "unnamed_events": {
          "description": "Classified events unavailable to exact event selection.",
          "format": "uint64",
          "minimum": 0,
          "type": "integer"
        },
        "usable_return_events": {
          "description": "Return events carrying an explicit opaque subject ID.",
          "format": "uint64",
          "minimum": 0,
          "type": "integer"
        },
        "usable_start_events": {
          "description": "Start events carrying an explicit opaque subject ID.",
          "format": "uint64",
          "minimum": 0,
          "type": "integer"
        }
      },
      "required": [
        "classified_events",
        "named_events",
        "unnamed_events",
        "identified_events",
        "start_events",
        "usable_start_events",
        "excluded_start_events",
        "return_events",
        "usable_return_events",
        "excluded_return_events",
        "limitations"
      ],
      "type": "object"
    },
    "SdkProductAnalyticsRetentionMode": {
      "description": "How a return qualifies for each requested period.",
      "oneOf": [
        {
          "const": "return_on",
          "description": "Return inside that exact subject-relative period.",
          "type": "string"
        },
        {
          "const": "return_on_or_after",
          "description": "Return at or after that period's subject-relative threshold.",
          "type": "string"
        }
      ]
    },
    "SdkProductAnalyticsRetentionPeriodResponse": {
      "description": "One maturity-aware aggregate retention period.",
      "properties": {
        "all_subjects_eligible": {
          "description": "Whether every cohort subject is eligible for this period.",
          "type": "boolean"
        },
        "eligible_subjects": {
          "description": "Cohort subjects eligible for this period under the selected mode.",
          "format": "uint64",
          "minimum": 0,
          "type": "integer"
        },
        "fully_observed_cohort_average_rate": {
          "description": "Equal-weight mean across fully observed non-empty cohort rates.",
          "format": "double",
          "type": [
            "number",
            "null"
          ]
        },
        "fully_observed_cohorts": {
          "description": "Number of non-empty cohorts whose complete subject set is eligible.",
          "format": "uint64",
          "minimum": 0,
          "type": "integer"
        },
        "period": {
          "description": "Zero-based subject-relative period.",
          "format": "uint8",
          "maximum": 255,
          "minimum": 0,
          "type": "integer"
        },
        "retained_subjects": {
          "description": "Eligible subjects carrying a qualifying return.",
          "format": "uint64",
          "minimum": 0,
          "type": "integer"
        },
        "threshold_seconds": {
          "description": "Inclusive threshold from the subject's anchor, in seconds.",
          "format": "uint64",
          "minimum": 0,
          "type": "integer"
        },
        "weighted_retention_rate": {
          "description": "Subject-weighted retention rate across every eligible subject.",
          "format": "double",
          "type": [
            "number",
            "null"
          ]
        },
        "window_end_seconds": {
          "description": "Exclusive exact-window end, omitted for rolling retention.",
          "format": "uint64",
          "minimum": 0,
          "type": [
            "integer",
            "null"
          ]
        }
      },
      "required": [
        "period",
        "threshold_seconds",
        "eligible_subjects",
        "retained_subjects",
        "fully_observed_cohorts",
        "all_subjects_eligible"
      ],
      "type": "object"
    },
    "SdkProductAnalyticsRetentionQueryResponse": {
      "description": "Normalized retention query echoed in the response.",
      "properties": {
        "activity_scope": {
          "anyOf": [
            {
              "$ref": "#/$defs/SdkProductAnalyticsActivityScope"
            },
            {
              "type": "null"
            }
          ],
          "description": "Version-2 automatic activity population, omitted for exact version-1 queries."
        },
        "cohort_mode": {
          "$ref": "#/$defs/SdkProductAnalyticsRetentionCohortMode",
          "description": "Cohort-anchor semantics."
        },
        "environment": {
          "description": "Optional exact environment filter.",
          "type": [
            "string",
            "null"
          ]
        },
        "interval": {
          "$ref": "#/$defs/SdkProductAnalyticsFixedInterval",
          "description": "Stable fixed interval token."
        },
        "interval_count": {
          "description": "Number of zero-based periods evaluated.",
          "format": "uint8",
          "maximum": 255,
          "minimum": 0,
          "type": "integer"
        },
        "interval_seconds": {
          "description": "Exact fixed interval width.",
          "format": "uint64",
          "minimum": 0,
          "type": "integer"
        },
        "mode": {
          "$ref": "#/$defs/SdkProductAnalyticsRetentionMode",
          "description": "Exact-period or rolling retention semantics."
        },
        "project_id": {
          "description": "Exact project queried.",
          "format": "uuid",
          "type": "string"
        },
        "release": {
          "description": "Optional exact release filter.",
          "type": [
            "string",
            "null"
          ]
        },
        "return_event": {
          "anyOf": [
            {
              "$ref": "#/$defs/SdkProductAnalyticsEventRequest"
            },
            {
              "type": "null"
            }
          ],
          "description": "Exact post-anchor return event."
        },
        "service_name": {
          "description": "Optional exact service filter.",
          "type": [
            "string",
            "null"
          ]
        },
        "since": {
          "description": "Inclusive UTC lower bound.",
          "format": "date-time",
          "type": "string"
        },
        "start_event": {
          "anyOf": [
            {
              "$ref": "#/$defs/SdkProductAnalyticsEventRequest"
            },
            {
              "type": "null"
            }
          ],
          "description": "Exact cohort-anchor event."
        },
        "until": {
          "description": "Exclusive UTC upper bound.",
          "format": "date-time",
          "type": "string"
        }
      },
      "required": [
        "project_id",
        "since",
        "until",
        "interval",
        "interval_seconds",
        "interval_count",
        "mode",
        "cohort_mode"
      ],
      "type": "object"
    },
    "SdkProductAnalyticsRetentionSummaryResponse": {
      "description": "Aggregate subject outcome across the selected observation window.",
      "properties": {
        "cohort_subjects": {
          "description": "Identified subjects with a usable first start event in range.",
          "format": "uint64",
          "minimum": 0,
          "type": "integer"
        },
        "fully_observed_periods": {
          "description": "Requested periods for which every cohort subject is eligible.",
          "format": "uint8",
          "maximum": 255,
          "minimum": 0,
          "type": "integer"
        },
        "non_empty_cohorts": {
          "description": "Non-empty query-relative cohort buckets returned.",
          "format": "uint64",
          "minimum": 0,
          "type": "integer"
        },
        "periods_with_eligible_subjects": {
          "description": "Requested periods carrying at least one eligible subject.",
          "format": "uint8",
          "maximum": 255,
          "minimum": 0,
          "type": "integer"
        },
        "return_rate_after_start": {
          "description": "Fraction of cohort subjects with any strictly post-anchor return.",
          "format": "double",
          "type": [
            "number",
            "null"
          ]
        },
        "subjects_returned_after_start": {
          "description": "Cohort subjects with any strictly post-anchor return before the query upper bound.",
          "format": "uint64",
          "minimum": 0,
          "type": "integer"
        }
      },
      "required": [
        "cohort_subjects",
        "subjects_returned_after_start",
        "non_empty_cohorts",
        "periods_with_eligible_subjects",
        "fully_observed_periods"
      ],
      "type": "object"
    },
    "SdkProductAnalyticsUnit": {
      "description": "Explicit identity boundary used for aggregate analysis.",
      "oneOf": [
        {
          "const": "session",
          "description": "Count explicit application sessions.",
          "type": "string"
        },
        {
          "const": "identified_user",
          "description": "Count explicit opaque user-subject IDs without returning them.",
          "type": "string"
        }
      ]
    }
  }
}

Work with this as data

Every JSON Schema here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for schemas

4 MCP tools reach this
  • find_json_schemasBrowse and filter every JSON Schema in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This JSON Schema
curl "https://apis.io/api/v1/json-schemas/logbrew-sdk-product-analytics-retention-response"
All schemas
curl "https://apis.io/api/v1/json-schemas?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.