{ "components": { "schemas": { "AiConfigResponse": { "properties": { "admin_only": { "description": "Only admins may ask for an explanation on this deployment.", "type": "boolean" }, "enabled": { "description": "Whether this deployment offers AI explanations at all.", "type": "boolean" }, "model": { "description": "The model explanations are asked of.", "type": "string" }, "stand_key": { "description": "The stand pays for explanations with its own key, so nobody stores one.", "type": "boolean" } }, "required": [ "enabled", "model", "stand_key", "admin_only" ], "type": "object" }, "AiCredentialResponse": { "properties": { "configured": { "type": "boolean" }, "hint": { "description": "Last four characters of the stored key; empty when none is stored.", "type": "string" } }, "required": [ "configured", "hint" ], "type": "object" }, "AiSettingsResponse": { "properties": { "is_default": { "description": "True while the tenant has written none of its own.", "type": "boolean" }, "system_prompt": { "type": "string" } }, "required": [ "system_prompt", "is_default" ], "type": "object" }, "AppliedSchedule": { "properties": { "crons": { "description": "The non-empty list recorded from the instance's `CronWorkflow`.", "items": { "type": "string" }, "minItems": 1, "type": "array" }, "origin": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/ScheduleOrigin", "description": "Where the applied schedule came from; absent when unrecorded or unknown." } ] }, "suspended": { "description": "Whether the recorded `CronWorkflow` is suspended.", "type": "boolean" }, "timezone": { "description": "Absent when the `CronWorkflow` uses the Argo controller's timezone.", "type": [ "string", "null" ] } }, "required": [ "crons", "suspended" ], "type": "object" }, "BreakdownValueDto": { "properties": { "compare_to": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/BreakdownWindowValueDto", "description": "This group's reading over `compare_to`; absent when no comparison window\nwas asked for." } ] }, "dimensions": { "items": { "$ref": "#/components/schemas/MetricDimensionDto" }, "type": "array" }, "entity_id": { "type": "string" }, "present": { "description": "Whether this group has any observation inside the primary period.\nPresent only on a windowed response, where the group set spans every\nwindow and a reader has to know which of them each group belongs to.", "type": [ "boolean", "null" ] }, "value": { "format": "double", "type": [ "number", "null" ] } }, "required": [ "entity_id", "dimensions" ], "type": "object" }, "BreakdownWindowValueDto": { "description": "One group's reading over the comparison window.\n\n`value` and `present` are independent: a ratio over a group that IS in the\nwindow reads NULL whenever its denominator is zero, so absence cannot be\ninferred from the value. A reader that wants what a standalone request over\nthat window would have returned keeps the rows with `present` and renders\ntheir `value` as it stands, NULL included.", "properties": { "present": { "type": "boolean" }, "value": { "format": "double", "type": [ "number", "null" ] } }, "required": [ "present" ], "type": "object" }, "Bucket": { "enum": [ "day", "week", "month" ], "type": "string" }, "ComputationDto": { "oneOf": [ { "properties": { "computation": { "enum": [ "sum" ], "type": "string" } }, "required": [ "computation" ], "type": "object" }, { "properties": { "computation": { "enum": [ "ratio" ], "type": "string" }, "scale": { "format": "double", "type": "number" } }, "required": [ "scale", "computation" ], "type": "object" }, { "properties": { "computation": { "enum": [ "median" ], "type": "string" } }, "required": [ "computation" ], "type": "object" }, { "properties": { "computation": { "enum": [ "percentile" ], "type": "string" }, "q": { "description": "The quantile — a probability, matching the definition validation.", "format": "double", "maximum": 1, "minimum": 0, "type": "number" } }, "required": [ "q", "computation" ], "type": "object" }, { "properties": { "computation": { "enum": [ "stddev" ], "type": "string" } }, "required": [ "computation" ], "type": "object" }, { "properties": { "computation": { "enum": [ "distinct_count" ], "type": "string" } }, "required": [ "computation" ], "type": "object" } ] }, "ConnectorHealth": { "properties": { "configured": { "description": "Present in the newest sealed snapshot of the set the controller manages.", "type": "boolean" }, "connector": { "type": "string" }, "last_sync": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/SyncFact", "description": "Absent for a configured connector that has never synced." } ] }, "schedule": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/AppliedSchedule", "description": "Applied schedule recorded on the newest sealed tick. Absent outside its\nconfigured set or when that row records no cron expressions." } ] }, "source_id": { "description": "The installation's own id within that tenant. Absent with `tenant_id`.", "type": [ "string", "null" ] }, "tenant_id": { "description": "Tenant of the installation this row is. Absent together with\n`source_id` on history recorded before the ledger carried the identity\nthat no single instance could be shown to own — unattributed, which is a\ndifferent answer from attributed to something named \"\".", "type": [ "string", "null" ] } }, "required": [ "connector", "configured" ], "type": "object" }, "ConnectorHealthResponse": { "properties": { "as_of": { "description": "When this answer was computed. Dates the answer; `checked_at` dates the\nfacts in it.", "type": "string" }, "checked_at": { "description": "When the mover was last read. Absent before the first sweep sealed.", "type": [ "string", "null" ] }, "connectors": { "items": { "$ref": "#/components/schemas/ConnectorHealth" }, "type": "array" }, "history_available": { "description": "False when nothing has been recorded at all, so the page can say so\ninstead of implying health.", "type": "boolean" }, "typical_read_interval_ms": { "description": "The median gap between the recent sealed ticks. Measured, not\nconfigured — nothing on this path knows what cadence was intended.\nAbsent where too few ticks are recorded to establish one.", "format": "int64", "minimum": 0, "type": [ "integer", "null" ] } }, "required": [ "as_of", "history_available", "connectors" ], "type": "object" }, "ContextEntryResponse": { "properties": { "body": { "type": "string" }, "id": { "type": "string" }, "scope": { "$ref": "#/components/schemas/Scope" }, "title": { "type": "string" }, "updated_at": { "type": "string" } }, "required": [ "id", "scope", "title", "body", "updated_at" ], "type": "object" }, "ContextListResponse": { "properties": { "items": { "items": { "$ref": "#/components/schemas/ContextEntryResponse" }, "type": "array" } }, "required": [ "items" ], "type": "object" }, "CreateContextRequest": { "properties": { "body": { "type": "string" }, "scope": { "$ref": "#/components/schemas/Scope" }, "title": { "type": "string" } }, "required": [ "scope", "title", "body" ], "type": "object" }, "CreateSavedQueryRequest": { "description": "Request to create a saved query.", "properties": { "description": { "type": [ "string", "null" ] }, "name": { "type": "string" }, "sql": { "type": "string" } }, "required": [ "name", "sql" ], "type": "object" }, "CustomMetric": { "description": "A portable custom-metric graph — the create/update body, the export item,\nand the get/list detail shape. `origin` is response-only: always `\"custom\"`\non output, omitted from exports, and ignored on input (writes force\n`custom`).", "properties": { "computation": { "$ref": "#/components/schemas/MetricComputation" }, "description": { "type": [ "string", "null" ] }, "dimensions": { "items": { "type": "string" }, "type": "array" }, "direction": { "$ref": "#/components/schemas/MetricDirection" }, "entity_type": { "type": "string" }, "explanation": { "type": [ "string", "null" ] }, "format": { "$ref": "#/components/schemas/MetricFormat" }, "inputs": { "items": { "$ref": "#/components/schemas/CustomMetricInput" }, "type": "array" }, "label": { "type": "string" }, "measures": { "items": { "type": "string" }, "type": "array" }, "metric_key": { "type": "string" }, "observation_sql": { "type": "string" }, "origin": { "type": [ "string", "null" ] }, "peer_cohort_key": { "type": [ "string", "null" ] }, "scale": { "format": "double", "type": [ "number", "null" ] }, "short_label": { "type": [ "string", "null" ] }, "source_key": { "type": "string" }, "subject": { "description": "The single topic this metric groups under within its family; a\nlowercase snake-case slug. Optional for custom metrics.", "type": [ "string", "null" ] }, "tags": { "description": "Cross-cutting filter labels; lowercase snake-case slugs, unique per\nmetric. Optional — defaults to empty.", "items": { "type": "string" }, "type": "array" }, "transform": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/ValueTransform" } ] }, "unit": { "type": [ "string", "null" ] } }, "required": [ "metric_key", "label", "entity_type", "format", "direction", "computation", "source_key", "observation_sql", "measures", "dimensions", "inputs" ], "type": "object" }, "CustomMetricInput": { "description": "One role→measure binding of a custom metric.", "properties": { "measure_key": { "type": "string" }, "role": { "$ref": "#/components/schemas/MetricInputRole" } }, "required": [ "role", "measure_key" ], "type": "object" }, "CustomMetricListResponse": { "description": "`GET /v1/metrics` envelope.", "properties": { "items": { "items": { "$ref": "#/components/schemas/CustomMetricSummary" }, "type": "array" } }, "required": [ "items" ], "type": "object" }, "CustomMetricSummary": { "description": "List item — display fields only, no SQL body.", "properties": { "computation": { "$ref": "#/components/schemas/MetricComputation" }, "entity_type": { "type": "string" }, "label": { "type": "string" }, "metric_key": { "type": "string" }, "subject": { "description": "Grouping subject, so the management list can partition custom metrics\nby topic like the definitions listing; absent when none is declared.", "type": [ "string", "null" ] } }, "required": [ "metric_key", "label", "computation", "entity_type" ], "type": "object" }, "EntityType": { "enum": [ "person", "tenant" ], "type": "string" }, "EvidenceGranularity": { "enum": [ "event", "source_summary", "derived_population" ], "type": "string" }, "ExplainRequest": { "allOf": [ { "$ref": "#/components/schemas/MetricSnapshot" } ] }, "ExplainResponse": { "properties": { "model": { "description": "The model that produced it.", "type": "string" }, "person_context_entries": { "description": "How many of the caller's own entries fed the prompt.", "minimum": 0, "type": "integer" }, "tenant_context_entries": { "description": "How many organisation entries fed the prompt.", "minimum": 0, "type": "integer" }, "text": { "description": "The answer, as plain prose.", "type": "string" } }, "required": [ "text", "model", "tenant_context_entries", "person_context_entries" ], "type": "object" }, "ExportCustomMetricsResponse": { "description": "`GET /v1/metrics/export` envelope — the tenant's custom metric graphs.", "properties": { "metrics": { "items": { "$ref": "#/components/schemas/CustomMetric" }, "type": "array" } }, "required": [ "metrics" ], "type": "object" }, "FeedbackEntry": { "properties": { "display_name": { "description": "The roster's name when it lists the sender, as People shows it; else\nthe identity rows', empty when they hold none.", "type": "string" }, "email": { "description": "The roster's address; null for a sender the roster does not list.", "type": [ "string", "null" ] }, "feedback_id": { "type": "string" }, "message": { "type": "string" }, "path": { "type": "string" }, "person_id": { "type": "string" }, "ts": { "type": "string" }, "username": { "description": "The roster's handle when it lists the sender; else the identity rows',\nempty when they hold none.", "type": "string" } }, "required": [ "feedback_id", "ts", "person_id", "display_name", "username", "message", "path" ], "type": "object" }, "FeedbackListResponse": { "properties": { "items": { "items": { "$ref": "#/components/schemas/FeedbackEntry" }, "type": "array" }, "since": { "type": "string" }, "until": { "type": "string" } }, "required": [ "since", "until", "items" ], "type": "object" }, "FeedbackRequest": { "properties": { "message": { "type": "string" }, "path": { "description": "The screen the sender was on. Empty when the SPA cannot name one.", "type": "string" } }, "required": [ "message" ], "type": "object" }, "Grain": { "description": "Bucket width. The set is closed and validated server-side: the view is a\n`merge()` over every bronze database, so an operator-supplied interval\nexpression would be a direct route into that scan.", "enum": [ "15m", "1s" ], "type": "string" }, "HistogramBinDto": { "properties": { "count": { "format": "int64", "minimum": 0, "type": "integer" }, "hi": { "format": "double", "type": "number" }, "lo": { "format": "double", "type": "number" } }, "required": [ "lo", "hi", "count" ], "type": "object" }, "HistogramValueDto": { "description": "One histogram row. Per-entity shape: `entity_id` set, `dimensions` absent,\nevery requested entity listed. Pooled shape (dimensioned request):\n`dimensions` set, `entity_id` absent, one row per observed dimension tuple\nover all selected entities' events — no entity grain, like rollup.", "properties": { "bins": { "description": "Empty when a listed entity has no events in the period — the entity is\nstill listed, mirroring the period view's every-requested-entity rule.", "items": { "$ref": "#/components/schemas/HistogramBinDto" }, "type": "array" }, "dimensions": { "items": { "$ref": "#/components/schemas/MetricDimensionDto" }, "type": "array" }, "entity_id": { "type": [ "string", "null" ] } }, "required": [ "bins" ], "type": "object" }, "ImportCustomMetricsRequest": { "description": "`POST /v1/metrics/import` body.", "properties": { "metrics": { "items": { "$ref": "#/components/schemas/CustomMetric" }, "type": "array" } }, "required": [ "metrics" ], "type": "object" }, "ImportCustomMetricsResponse": { "description": "`POST /v1/metrics/import` result — counts landed and the `metric_key`s\nskipped because they already existed for the tenant.", "properties": { "imported": { "minimum": 0, "type": "integer" }, "skipped": { "items": { "type": "string" }, "type": "array" } }, "required": [ "imported", "skipped" ], "type": "object" }, "IngestionIntensityResponse": { "properties": { "from": { "type": "string" }, "grain": { "$ref": "#/components/schemas/Grain", "description": "Echoed resolved, not as asked: the caller may have pinned neither bound." }, "points": { "items": { "$ref": "#/components/schemas/IngestionPoint" }, "type": "array" }, "scope": { "description": "The `source_database` the read was scoped to; absent when org-wide.", "type": [ "string", "null" ] }, "series": { "$ref": "#/components/schemas/Series" }, "to": { "type": "string" }, "truncated": { "description": "The group cap clipped the tail: the window is too wide for this grain\nand series to plot honestly. Never silently true — the UI says so.", "type": "boolean" } }, "required": [ "grain", "series", "from", "to", "truncated", "points" ], "type": "object" }, "IngestionPoint": { "properties": { "bucket": { "description": "Bucket start as `YYYY-MM-DD HH:MM:SS`, always UTC — the reader's own\nzone would re-cut buckets the server already decided.", "type": "string" }, "key": { "description": "Connector slug, stream name, or `all`, per the resolved `series`.", "type": "string" }, "rows": { "format": "int64", "minimum": 0, "type": "integer" } }, "required": [ "bucket", "key", "rows" ], "type": "object" }, "MetricComputation": { "enum": [ "sum", "ratio", "median", "percentile", "stddev", "distinct_count" ], "type": "string" }, "MetricDefinitionListResponse": { "description": "Response body for `GET /v1/metric-definitions`. Metrics are sorted by\n`metric_key` ascending so the payload is byte-stable for caching and\ndiff tooling.", "properties": { "metrics": { "items": { "$ref": "#/components/schemas/MetricDefinitionView" }, "type": "array" } }, "required": [ "metrics" ], "type": "object" }, "MetricDefinitionView": { "description": "One metric definition, display fields only.", "properties": { "description": { "type": [ "string", "null" ] }, "dimensions": { "items": { "type": "string" }, "type": "array" }, "direction": { "$ref": "#/components/schemas/MetricDirection" }, "drilldown": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/MetricDrilldownCapability" } ] }, "entity_type": { "$ref": "#/components/schemas/EntityType" }, "explanation": { "type": [ "string", "null" ] }, "first_observed_date": { "description": "Oldest `metric_date` the definition's input measures currently hold;\nabsent when they hold none — whether nothing was ever observed or\nretention took the last of it, which a sweep cannot tell apart.\n\nThe oldest observation still available, NOT the date collection began:\nit moves forward as retention drops the oldest rows, and is cleared when\na sweep reads the relation and finds nothing. It does not pair with\n`last_observed_date` as an interval of what is readable — that one is a\nhigh-water mark and is never cleared.", "format": "date", "type": [ "string", "null" ] }, "format": { "$ref": "#/components/schemas/MetricFormat" }, "is_enabled": { "type": "boolean" }, "label": { "type": "string" }, "last_observed_date": { "description": "Newest `metric_date` ever observed across the definition's input\nmeasures; absent when no observation has ever been seen. Freshness\nsignal, orthogonal to `schema_status`. Not maintained for `custom`\nmetrics (see `origin`).", "format": "date", "type": [ "string", "null" ] }, "metric_key": { "type": "string" }, "origin": { "$ref": "#/components/schemas/MetricOrigin", "description": "`builtin` metrics read managed observation relations; `custom` metrics\nexecute inline SQL at query time. The validator stamps `schema_status`\nand `last_observed_date` from materialized relations only, so for\n`custom` those fields stay `unchecked` / absent regardless of data —\nreaders must not interpret them as \"never measured\" for custom metrics." }, "revision_window_days": { "description": "Deprecated, kept for consumers written before `settled_through`: how many\ndays back from `last_observed_date` a reading may still be revised.\n\nA duration cannot express a boundary anchored to the billing month, so\nfor a month-anchored measure this is the longest that boundary can ever\nbe — an over-statement, never an under-statement. Absence still means\n\"settles on arrival\", which is why a metric under any rule reports a\nnumber here rather than omitting one it cannot state exactly. Read\n`settled_through` instead.", "format": "int32", "minimum": 0, "type": [ "integer", "null" ] }, "schema_error_code": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/MetricSchemaErrorCode", "description": "Why `schema_status` is `error`; absent otherwise (the DB enforces the\nbiconditional)." } ] }, "schema_status": { "$ref": "#/components/schemas/SchemaStatus" }, "settled_through": { "description": "Newest delivered date considered settled under the declared revision\nrule. Absent where the source declares none, and for `custom` metrics,\nwhich read no managed source — absence means \"settles on arrival\", not\n\"revised forever\".\n\nA rule states how a supplier normally revises, not what it is incapable\nof: a correction outside that behaviour can still reach a date reported\nas settled.\n\nA date rather than the rule that produced it: how far back revision\nreaches depends on the rule's own anchor, and a consumer holding a day\ncount has to re-derive the anchor to use it.", "format": "date", "type": [ "string", "null" ] }, "short_label": { "description": "Compact label for dense surfaces; absent when the full label is\nalready compact enough.", "type": [ "string", "null" ] }, "subject": { "description": "The single topic this metric belongs to within its family, so a surface\nlisting a family can partition it into topics rather than only sorting\nby name. Exactly one per metric; absent only for metrics that declare\nnone.", "type": [ "string", "null" ] }, "tags": { "description": "Cross-cutting labels a surface can filter or search by; many per metric,\nunlike the singular `subject`. Empty when the metric declares none.", "items": { "type": "string" }, "type": "array" }, "unit": { "type": [ "string", "null" ] } }, "required": [ "metric_key", "entity_type", "label", "format", "direction", "dimensions", "tags", "is_enabled", "origin", "schema_status" ], "type": "object" }, "MetricDimensionDto": { "properties": { "href": { "type": [ "string", "null" ] }, "key": { "type": "string" }, "label": { "type": [ "string", "null" ] }, "value": { "type": "string" } }, "required": [ "key", "value" ], "type": "object" }, "MetricDimensionFilterDto": { "properties": { "dimension": { "type": "string" }, "values": { "items": { "type": "string" }, "type": "array" } }, "required": [ "dimension", "values" ], "type": "object" }, "MetricDimensionFilterRequest": { "properties": { "dimension": { "type": "string" }, "values": { "items": { "type": "string" }, "type": "array" } }, "required": [ "dimension", "values" ], "type": "object" }, "MetricDirection": { "enum": [ "higher_is_better", "lower_is_better", "neutral" ], "type": "string" }, "MetricDrilldownCapability": { "properties": { "granularity": { "items": { "$ref": "#/components/schemas/EvidenceGranularity" }, "type": "array" } }, "required": [ "granularity" ], "type": "object" }, "MetricDrilldownColumn": { "properties": { "key": { "type": "string" }, "label": { "type": "string" }, "sortable": { "description": "Whether the query can order by this column. A column the evidence row\ndoes not carry in a form SQL can compare is shown, not sorted.", "type": "boolean" }, "type": { "$ref": "#/components/schemas/MetricDrilldownColumnType" } }, "required": [ "key", "label", "type", "sortable" ], "type": "object" }, "MetricDrilldownColumnType": { "enum": [ "string", "date", "number" ], "type": "string" }, "MetricDrilldownEntity": { "oneOf": [ { "properties": { "id": { "type": "string" }, "type": { "enum": [ "person" ], "type": "string" } }, "required": [ "id", "type" ], "type": "object" }, { "description": "The records behind a figure a surface reports for a GROUP of people —\nan org rollup card, a team total. Every id is authorized individually,\nexactly as the single-person shape is.", "properties": { "ids": { "items": { "type": "string" }, "type": "array" }, "type": { "enum": [ "persons" ], "type": "string" } }, "required": [ "ids", "type" ], "type": "object" }, { "properties": { "type": { "enum": [ "tenant" ], "type": "string" } }, "required": [ "type" ], "type": "object" } ] }, "MetricDrilldownExportFormat": { "enum": [ "csv", "xlsx" ], "type": "string" }, "MetricDrilldownExportRequest": { "properties": { "display_dimensions": { "items": { "type": "string" }, "type": "array" }, "entity": { "$ref": "#/components/schemas/MetricDrilldownEntity" }, "filters": { "items": { "$ref": "#/components/schemas/MetricDrilldownFilter" }, "type": "array" }, "format": { "$ref": "#/components/schemas/MetricDrilldownExportFormat" }, "metric_key": { "type": "string" }, "period": { "$ref": "#/components/schemas/MetricDrilldownPeriod" }, "search": { "type": [ "string", "null" ] }, "sort": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/MetricDrilldownSort" } ] } }, "required": [ "metric_key", "entity", "period", "format" ], "type": "object" }, "MetricDrilldownFilter": { "properties": { "dimension": { "type": "string" }, "values": { "items": { "type": "string" }, "type": "array" } }, "required": [ "dimension", "values" ], "type": "object" }, "MetricDrilldownPeriod": { "properties": { "from": { "type": "string" }, "to": { "type": "string" } }, "required": [ "from", "to" ], "type": "object" }, "MetricDrilldownRequest": { "properties": { "cursor": { "type": [ "string", "null" ] }, "display_dimensions": { "items": { "type": "string" }, "type": "array" }, "entity": { "$ref": "#/components/schemas/MetricDrilldownEntity" }, "filters": { "items": { "$ref": "#/components/schemas/MetricDrilldownFilter" }, "type": "array" }, "limit": { "minimum": 0, "type": [ "integer", "null" ] }, "metric_key": { "type": "string" }, "period": { "$ref": "#/components/schemas/MetricDrilldownPeriod" }, "search": { "type": [ "string", "null" ] }, "sort": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/MetricDrilldownSort" } ] } }, "required": [ "metric_key", "entity", "period" ], "type": "object" }, "MetricDrilldownResponse": { "properties": { "columns": { "items": { "$ref": "#/components/schemas/MetricDrilldownColumn" }, "type": "array" }, "next_cursor": { "type": [ "string", "null" ] }, "not_ready": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/NotReadyReason", "description": "Set when `rows` is empty because the relation behind this evidence has\nnot been built yet. Absent on every answered read, including one that\nlegitimately matched nothing — which is the distinction a reader needs\nto tell \"no records\" from \"not collected yet\"." } ] }, "rows": { "items": { "$ref": "#/components/schemas/MetricDrilldownRow" }, "type": "array" }, "selection": { "$ref": "#/components/schemas/MetricDrilldownSelection" } }, "required": [ "selection", "columns", "rows" ], "type": "object" }, "MetricDrilldownRow": { "properties": { "links": { "additionalProperties": { "type": "string" }, "propertyNames": { "type": "string" }, "type": "object" }, "values": { "additionalProperties": {}, "propertyNames": { "type": "string" }, "type": "object" } }, "required": [ "values", "links" ], "type": "object" }, "MetricDrilldownSelection": { "properties": { "display_dimensions": { "items": { "type": "string" }, "type": "array" }, "entity": { "$ref": "#/components/schemas/MetricDrilldownEntity" }, "filters": { "items": { "$ref": "#/components/schemas/MetricDrilldownFilter" }, "type": "array" }, "metric_key": { "type": "string" }, "period": { "$ref": "#/components/schemas/MetricDrilldownPeriod" }, "search": { "type": [ "string", "null" ] }, "sort": { "$ref": "#/components/schemas/MetricDrilldownSort", "description": "Always the effective order, never the caller's omission — a client that\nfinds this field missing is talking to a server that cannot sort at all." } }, "required": [ "metric_key", "entity", "period", "filters", "display_dimensions", "sort" ], "type": "object" }, "MetricDrilldownSort": { "properties": { "direction": { "$ref": "#/components/schemas/MetricDrilldownSortDirection" }, "key": { "type": "string" } }, "required": [ "key", "direction" ], "type": "object" }, "MetricDrilldownSortDirection": { "enum": [ "asc", "desc" ], "type": "string" }, "MetricFormat": { "enum": [ "integer", "decimal", "currency", "percent" ], "type": "string" }, "MetricGroupLimitRequest": { "properties": { "count": { "minimum": 0, "type": "integer" }, "include_remainder": { "type": "boolean" }, "rank_by_metric": { "type": [ "string", "null" ] } }, "required": [ "count", "include_remainder" ], "type": "object" }, "MetricInputRole": { "enum": [ "value", "numerator", "denominator" ], "type": "string" }, "MetricOrigin": { "enum": [ "builtin", "custom" ], "type": "string" }, "MetricRequest": { "properties": { "filters": { "items": { "$ref": "#/components/schemas/MetricDimensionFilterRequest" }, "type": "array" }, "metric_key": { "type": "string" }, "views": { "items": { "$ref": "#/components/schemas/MetricViewRequest" }, "type": "array" } }, "required": [ "metric_key", "views" ], "type": "object" }, "MetricResultDto": { "allOf": [ { "$ref": "#/components/schemas/ComputationDto" }, { "properties": { "description": { "type": [ "string", "null" ] }, "direction": { "$ref": "#/components/schemas/MetricDirection" }, "drilldown": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/MetricDrilldownCapability" } ] }, "explanation": { "type": [ "string", "null" ] }, "format": { "$ref": "#/components/schemas/MetricFormat" }, "label": { "type": "string" }, "metric_key": { "type": "string" }, "selection": { "$ref": "#/components/schemas/MetricResultSelectionDto" }, "short_label": { "type": [ "string", "null" ] }, "unit": { "type": [ "string", "null" ] }, "views": { "items": { "$ref": "#/components/schemas/MetricResultViewDto" }, "type": "array" } }, "required": [ "metric_key", "label", "format", "direction", "views", "selection" ], "type": "object" } ] }, "MetricResultSelectionDto": { "properties": { "entity": { "$ref": "#/components/schemas/MetricResultsEntityDto" }, "filters": { "items": { "$ref": "#/components/schemas/MetricDimensionFilterDto" }, "type": "array" }, "metric_key": { "type": "string" }, "period": { "$ref": "#/components/schemas/MetricResultsPeriodDto" } }, "required": [ "metric_key", "entity", "period", "filters" ], "type": "object" }, "MetricResultViewDto": { "oneOf": [ { "properties": { "values": { "items": { "$ref": "#/components/schemas/PeriodValueDto" }, "type": "array" }, "view": { "enum": [ "period" ], "type": "string" } }, "required": [ "values", "view" ], "type": "object" }, { "properties": { "bucket": { "$ref": "#/components/schemas/Bucket" }, "series": { "items": { "$ref": "#/components/schemas/TimeseriesDto" }, "type": "array" }, "view": { "enum": [ "timeseries" ], "type": "string" } }, "required": [ "bucket", "series", "view" ], "type": "object" }, { "properties": { "values": { "items": { "$ref": "#/components/schemas/PeerValueDto" }, "type": "array" }, "view": { "enum": [ "peer" ], "type": "string" } }, "required": [ "values", "view" ], "type": "object" }, { "properties": { "dimensions": { "items": { "type": "string" }, "type": "array" }, "values": { "items": { "$ref": "#/components/schemas/BreakdownValueDto" }, "type": "array" }, "view": { "enum": [ "breakdown" ], "type": "string" } }, "required": [ "dimensions", "values", "view" ], "type": "object" }, { "properties": { "dimensions": { "items": { "type": "string" }, "type": "array" }, "values": { "items": { "$ref": "#/components/schemas/RollupValueDto" }, "type": "array" }, "view": { "enum": [ "rollup" ], "type": "string" } }, "required": [ "dimensions", "values", "view" ], "type": "object" }, { "properties": { "dimensions": { "description": "Present only for the pooled (dimensioned) shape; absent for the\nper-entity shape, keeping that wire form unchanged.", "items": { "type": "string" }, "type": "array" }, "values": { "items": { "$ref": "#/components/schemas/HistogramValueDto" }, "type": "array" }, "view": { "enum": [ "histogram" ], "type": "string" } }, "required": [ "values", "view" ], "type": "object" }, { "properties": { "value": { "format": "double", "type": [ "number", "null" ] }, "view": { "enum": [ "unattributed" ], "type": "string" } }, "required": [ "view" ], "type": "object" }, { "description": "This view's computation failed; sibling views and metrics are\nunaffected. `message` detail depends on the caller's role: admins get\nthe underlying description, everyone else a generic one.", "properties": { "code": { "$ref": "#/components/schemas/MetricViewErrorCode" }, "message": { "type": "string" }, "view": { "enum": [ "error" ], "type": "string" } }, "required": [ "code", "message", "view" ], "type": "object" }, { "description": "The data this view reads has not been built yet. It carries no values\nat all, which is what separates it from a view whose every reading is\n`0`: nothing failed, and nothing was measured either.\n\nINVARIANT: a variant rather than a flag on the value-carrying shapes —\n\"not ready\" and \"here are the values\" cannot both be true, so a reader\ncannot render a zero it was never told.", "properties": { "reason": { "$ref": "#/components/schemas/NotReadyReason" }, "view": { "enum": [ "not_ready" ], "type": "string" } }, "required": [ "reason", "view" ], "type": "object" } ] }, "MetricResultsEntity": { "oneOf": [ { "properties": { "ids": { "items": { "type": "string" }, "type": "array" }, "type": { "enum": [ "person" ], "type": "string" } }, "required": [ "ids", "type" ], "type": "object" }, { "properties": { "type": { "enum": [ "tenant" ], "type": "string" } }, "required": [ "type" ], "type": "object" } ] }, "MetricResultsEntityDto": { "oneOf": [ { "properties": { "ids": { "items": { "type": "string" }, "type": "array" }, "type": { "enum": [ "person" ], "type": "string" } }, "required": [ "ids", "type" ], "type": "object" }, { "properties": { "type": { "enum": [ "tenant" ], "type": "string" } }, "required": [ "type" ], "type": "object" } ] }, "MetricResultsPeriod": { "properties": { "from": { "type": "string" }, "to": { "type": "string" } }, "required": [ "from", "to" ], "type": "object" }, "MetricResultsPeriodDto": { "properties": { "from": { "type": "string" }, "to": { "type": "string" } }, "required": [ "from", "to" ], "type": "object" }, "MetricResultsRequest": { "properties": { "compare_to": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/MetricResultsPeriod", "description": "A second window answered alongside `period` in the same response — the\nrange a delta or a half-against-half comparison is measured against.\nCarried by the `period` and `breakdown` views only; every other view\nkind answers over `period` alone." } ] }, "entity": { "$ref": "#/components/schemas/MetricResultsEntity" }, "metrics": { "items": { "$ref": "#/components/schemas/MetricRequest" }, "type": "array" }, "period": { "$ref": "#/components/schemas/MetricResultsPeriod" } }, "required": [ "entity", "period", "metrics" ], "type": "object" }, "MetricResultsResponse": { "properties": { "absence_context": { "items": { "$ref": "#/components/schemas/PersonAbsenceContext" }, "type": "array" }, "metrics": { "items": { "$ref": "#/components/schemas/MetricResultDto" }, "type": "array" } }, "required": [ "metrics", "absence_context" ], "type": "object" }, "MetricSchemaErrorCode": { "enum": [ "table_not_found", "column_not_found", "detail_key_not_found", "dimension_not_covered", "unknown" ], "type": "string" }, "MetricSnapshot": { "description": "The reading as the viewer sees it, handed to the model as the thing to explain.", "properties": { "bucket_starts": { "description": "Bucket start dates every series is indexed by, oldest first.", "items": { "type": "string" }, "type": "array" }, "delta": { "description": "The tile's own change line, empty when it has none.", "type": "string" }, "help": { "description": "The catalog's description of the metric, empty when it has none.", "type": "string" }, "label": { "description": "The label the tile shows.", "type": "string" }, "metric_key": { "description": "Catalog key, e.g. `tasks.closed`.", "type": "string" }, "peer": { "description": "The tile's peer-comparison line, empty when it has none.", "type": "string" }, "period": { "description": "What the period is called on screen, e.g. `month`.", "type": "string" }, "scope": { "$ref": "#/components/schemas/SnapshotScope", "description": "Whose reading this is. Absent means one person's." }, "series": { "description": "The chart's lines, when the reading is a chart rather than a tile.", "items": { "$ref": "#/components/schemas/SnapshotSeries" }, "type": "array" }, "since": { "description": "Inclusive start of the window, `YYYY-MM-DD`.", "type": "string" }, "trend": { "description": "The sparkline's readings, oldest first.", "items": { "format": "double", "type": [ "number", "null" ] }, "type": "array" }, "until": { "description": "Inclusive end of the window, `YYYY-MM-DD`.", "type": "string" }, "value": { "description": "The formatted value the tile shows.", "type": "string" } }, "required": [ "metric_key", "label", "value", "period", "since", "until" ], "type": "object" }, "MetricViewErrorCode": { "enum": [ "RESOURCE_EXHAUSTED", "QUERY_TIMEOUT", "RESULT_PARSE_FAILED", "QUERY_FAILED" ], "type": "string" }, "MetricViewRequest": { "oneOf": [ { "properties": { "view": { "enum": [ "period" ], "type": "string" } }, "required": [ "view" ], "type": "object" }, { "properties": { "cohort_key": { "type": [ "string", "null" ] }, "view": { "enum": [ "peer" ], "type": "string" } }, "required": [ "view" ], "type": "object" }, { "properties": { "bucket": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/Bucket" } ] }, "dimensions": { "items": { "type": "string" }, "type": "array" }, "group_limit": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/MetricGroupLimitRequest" } ] }, "view": { "enum": [ "timeseries" ], "type": "string" } }, "required": [ "view" ], "type": "object" }, { "properties": { "dimensions": { "items": { "type": "string" }, "type": "array" }, "view": { "enum": [ "breakdown" ], "type": "string" } }, "required": [ "dimensions", "view" ], "type": "object" }, { "properties": { "dimensions": { "items": { "type": "string" }, "type": "array" }, "group_limit": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/MetricGroupLimitRequest" } ] }, "view": { "enum": [ "rollup" ], "type": "string" } }, "required": [ "dimensions", "view" ], "type": "object" }, { "properties": { "dimensions": { "items": { "type": "string" }, "type": "array" }, "view": { "enum": [ "histogram" ], "type": "string" } }, "required": [ "view" ], "type": "object" }, { "description": "The tenant-wide sum of the work that resolves to no person: rows with no\nperson account or email, and accounts identity has not bound. Sum\nmetrics only; work bound to the excluded person is not counted.", "properties": { "view": { "enum": [ "unattributed" ], "type": "string" } }, "required": [ "view" ], "type": "object" } ] }, "NotReadyReason": { "description": "The marker an empty answer carries when its emptiness is not a reading.\n\nA relation the warehouse has not built yet is neither a failure nor a zero:\nno connector has synced, or the build has not reached it. A reader that\nsees this renders \"no data yet\"; one that renders `0` reports a measurement\nnobody took.\n\nINVARIANT: only absence sets it. A relation that exists and disagrees with\nthe deployed code (`UNKNOWN_IDENTIFIER`) still fails — that is the defect\nthe schema channel exists to catch, and an empty answer would hide it.", "enum": [ "SOURCE_RELATION_MISSING" ], "type": "string" }, "PeerValueDto": { "properties": { "entity_id": { "type": "string" }, "max": { "format": "double", "type": [ "number", "null" ] }, "median": { "format": "double", "type": [ "number", "null" ] }, "min": { "format": "double", "type": [ "number", "null" ] }, "n": { "format": "int64", "minimum": 0, "type": "integer" }, "p25": { "format": "double", "type": [ "number", "null" ] }, "p75": { "format": "double", "type": [ "number", "null" ] }, "target_value": { "format": "double", "type": [ "number", "null" ] } }, "required": [ "entity_id", "n" ], "type": "object" }, "PeriodValueDto": { "properties": { "compare_to": { "description": "The same reading over `compare_to`. Omitted both when no comparison\nwindow was asked for and when the entity has no value in it — the two\nare not distinguished on the wire, and a reader that asked knows which\ncase it is in.", "format": "double", "type": [ "number", "null" ] }, "entity_id": { "type": "string" }, "value": { "format": "double", "type": [ "number", "null" ] } }, "required": [ "entity_id" ], "type": "object" }, "PersonAbsenceContext": { "properties": { "compare_to_overlap": { "type": [ "boolean", "null" ] }, "period_overlap": { "type": "boolean" }, "person_id": { "type": "string" } }, "required": [ "person_id", "period_overlap" ], "type": "object" }, "Problem": { "description": "RFC 9457 problem+json. `context` varies by error category.", "properties": { "context": { "type": "object" }, "detail": { "type": "string" }, "instance": { "type": "string" }, "status": { "format": "int32", "type": "integer" }, "title": { "type": "string" }, "trace_id": { "type": "string" }, "type": { "type": "string" } }, "required": [ "type", "title", "status", "detail", "context" ], "type": "object" }, "PutCredentialRequest": { "properties": { "token": { "type": "string" } }, "required": [ "token" ], "type": "object" }, "PutSettingsRequest": { "properties": { "system_prompt": { "type": "string" } }, "required": [ "system_prompt" ], "type": "object" }, "ReportCell": { "oneOf": [ { "type": "string" }, { "format": "double", "type": "number" } ] }, "ReportColumnDataType": { "enum": [ "text", "date", "number" ], "type": "string" }, "ReportColumnMetadata": { "properties": { "data_type": { "$ref": "#/components/schemas/ReportColumnDataType" }, "format": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/MetricFormat" } ] }, "key": { "type": "string" }, "label": { "type": "string" }, "unit": { "type": [ "string", "null" ] } }, "required": [ "key", "label", "data_type" ], "type": "object" }, "ReportExportFormat": { "enum": [ "csv", "xlsx" ], "type": "string" }, "ReportExportRequest": { "additionalProperties": false, "properties": { "format": { "$ref": "#/components/schemas/ReportExportFormat" }, "granularity": { "$ref": "#/components/schemas/ReportGranularity" }, "metric_keys": { "items": { "type": "string" }, "maxItems": 100, "type": "array" }, "period": { "$ref": "#/components/schemas/ReportPeriod" }, "subject": { "$ref": "#/components/schemas/ReportSubject" } }, "required": [ "subject", "period", "granularity", "metric_keys", "format" ], "type": "object" }, "ReportGranularity": { "enum": [ "day", "week", "month", "quarter", "year" ], "type": "string" }, "ReportPeriod": { "additionalProperties": false, "properties": { "from": { "type": "string" }, "to": { "type": "string" } }, "required": [ "from", "to" ], "type": "object" }, "ReportPreviewResponse": { "properties": { "columns": { "items": { "$ref": "#/components/schemas/ReportColumnMetadata" }, "type": "array" }, "not_ready": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/NotReadyReason", "description": "Set when the rows stop short because a relation a metric reads has not\nbeen built yet. Absent on every answered preview, including an empty\none." } ] }, "rows": { "items": { "$ref": "#/components/schemas/ReportRow" }, "type": "array" }, "total_rows": { "format": "int64", "minimum": 0, "type": "integer" } }, "required": [ "columns", "rows", "total_rows" ], "type": "object" }, "ReportRecipe": { "additionalProperties": false, "properties": { "granularity": { "$ref": "#/components/schemas/ReportGranularity" }, "metric_keys": { "items": { "type": "string" }, "maxItems": 100, "type": "array" }, "period": { "$ref": "#/components/schemas/ReportPeriod" }, "subject": { "$ref": "#/components/schemas/ReportSubject" } }, "required": [ "subject", "period", "granularity", "metric_keys" ], "type": "object" }, "ReportRow": { "items": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/ReportCell" } ] }, "type": "array" }, "ReportSubject": { "oneOf": [ { "properties": { "ids": { "items": { "format": "uuid", "type": "string" }, "maxItems": 1000, "type": "array" }, "type": { "enum": [ "people" ], "type": "string" } }, "required": [ "ids", "type" ], "type": "object" }, { "properties": { "type": { "enum": [ "tenant" ], "type": "string" } }, "required": [ "type" ], "type": "object" } ] }, "RollupValueDto": { "properties": { "contributing_entity_count": { "format": "int64", "minimum": 0, "type": "integer" }, "dimensions": { "items": { "$ref": "#/components/schemas/MetricDimensionDto" }, "type": "array" }, "label": { "type": [ "string", "null" ] }, "rank": { "format": "int32", "minimum": 0, "type": [ "integer", "null" ] }, "remainder": { "type": [ "boolean", "null" ] }, "value": { "format": "double", "type": [ "number", "null" ] } }, "required": [ "dimensions", "contributing_entity_count" ], "type": "object" }, "RunResponse": { "description": "Result of `POST /v1/queries/{id}/run`.\n\n`rows` carry a per-query dynamic schema (the `SELECT` columns vary), so each\nrow is an untyped JSON object — the same shape as the metric query path.", "properties": { "not_ready": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/NotReadyReason", "description": "Set when `rows` is empty because a relation the query names has not been\nbuilt yet. Absent on every answered run, including one that matched\nnothing." } ] }, "rows": { "items": {}, "type": "array" } }, "required": [ "rows" ], "type": "object" }, "RunSavedQueryRequest": { "description": "Optional parameters for `POST /v1/queries/{id}/run` (#1966).\n\nThe `{tenant}` parameter is always injected from the session context and is\nnever client-settable, so it is absent here. `period` is the first optional\nnamed parameter an author can reference as `{period:}`; it is bound as\na ClickHouse server-side parameter, never interpolated into the SQL text.", "properties": { "period": { "type": [ "string", "null" ] } }, "type": "object" }, "SavedQuery": { "description": "A saved query row.", "properties": { "created_at": { "format": "date-time", "type": "string" }, "description": { "type": [ "string", "null" ] }, "id": { "format": "uuid", "type": "string" }, "insight_tenant_id": { "format": "uuid", "type": "string" }, "name": { "type": "string" }, "sql": { "type": "string" }, "updated_at": { "format": "date-time", "type": "string" } }, "required": [ "id", "insight_tenant_id", "name", "sql", "created_at", "updated_at" ], "type": "object" }, "SavedQueryListResponse": { "description": "Response envelope for `GET /v1/queries` (`{ \"items\": [SavedQuerySummary] }`).", "properties": { "items": { "items": { "$ref": "#/components/schemas/SavedQuerySummary" }, "type": "array" } }, "required": [ "items" ], "type": "object" }, "SavedQuerySummary": { "description": "Summary returned by the list endpoint (no `sql` body).", "properties": { "description": { "type": [ "string", "null" ] }, "id": { "format": "uuid", "type": "string" }, "name": { "type": "string" } }, "required": [ "id", "name" ], "type": "object" }, "ScheduleOrigin": { "enum": [ "annotation", "descriptor", "default" ], "type": "string" }, "SchemaStatus": { "enum": [ "ok", "error", "unchecked" ], "type": "string" }, "Scope": { "description": "Who a context entry belongs to.", "enum": [ "tenant", "person" ], "type": "string" }, "Series": { "description": "What one plotted band counts. `Total` exists because the full-period trend\nplots a single line: grouping it by connector would multiply 400 days of\n15-minute buckets by the connector count for a series the chart then sums\nback down anyway.", "enum": [ "connector", "stream", "total" ], "type": "string" }, "SnapshotScope": { "description": "Whose reading this is.", "enum": [ "person", "organisation" ], "type": "string" }, "SnapshotSeries": { "description": "One line of a chart, as it is drawn.", "properties": { "label": { "type": "string" }, "points": { "description": "Readings per bucket, oldest first; a gap is null.", "items": { "format": "double", "type": [ "number", "null" ] }, "type": "array" } }, "required": [ "label", "points" ], "type": "object" }, "SyncFact": { "properties": { "duration_ms": { "description": "Absent for a job still in flight, and for one the mover gave no usable\npair of stamps for. Never zero to mean absent.", "format": "int64", "minimum": 0, "type": [ "integer", "null" ] }, "job_id": { "description": "The mover's own job identity.", "type": "string" }, "records_reported": { "description": "What the mover states it moved. Absent where it reported no count at\nall, which is a different answer from a reported zero.", "format": "int64", "minimum": 0, "type": [ "integer", "null" ] }, "started_at": { "description": "Absent for a job the mover had not started.", "type": [ "string", "null" ] }, "status": { "description": "The mover's own word for how the sync ended, or `unknown` where the\nrecorded word was outside its documented vocabulary.", "type": "string" } }, "required": [ "job_id", "status" ], "type": "object" }, "SyncHistoryResponse": { "properties": { "connector": { "type": "string" }, "source_id": { "description": "The installation's own id within that tenant. Absent with `tenant_id`.", "type": [ "string", "null" ] }, "syncs": { "description": "A bounded window, newest first — not the full retained history.", "items": { "$ref": "#/components/schemas/SyncFact" }, "type": "array" }, "tenant_id": { "description": "Tenant of the installation the window was narrowed to, echoed back.\nAbsent where the caller asked for the connector rather than one\ninstallation of it, in which case the window spans every instance under\nthat name.", "type": [ "string", "null" ] }, "window": { "description": "How many rows this window holds at most, so the page can say the list\nis a window rather than everything.", "format": "int32", "minimum": 0, "type": "integer" } }, "required": [ "connector", "syncs", "window" ], "type": "object" }, "TelemetryRecord": { "properties": { "context_app_name": { "type": [ "string", "null" ] }, "context_app_version": { "type": [ "string", "null" ] }, "context_session_id": { "type": [ "string", "null" ] }, "data": {}, "name": { "type": [ "string", "null" ] }, "time_sent": { "description": "Epoch milliseconds on the same clock: when the batch was flushed.", "format": "int64", "type": [ "integer", "null" ] }, "time_triggered": { "description": "Epoch milliseconds on the browser's clock: when the event happened.", "format": "int64", "type": [ "integer", "null" ] } }, "type": "object" }, "TimeseriesDto": { "properties": { "dimensions": { "items": { "$ref": "#/components/schemas/MetricDimensionDto" }, "type": "array" }, "entity_id": { "type": "string" }, "label": { "type": [ "string", "null" ] }, "points": { "items": { "$ref": "#/components/schemas/TimeseriesPointDto" }, "type": "array" }, "rank": { "format": "int32", "minimum": 0, "type": [ "integer", "null" ] }, "remainder": { "type": [ "boolean", "null" ] }, "total": { "format": "double", "type": [ "number", "null" ] } }, "required": [ "entity_id", "dimensions", "total", "points" ], "type": "object" }, "TimeseriesPointDto": { "properties": { "bucket_start": { "type": "string" }, "denominator": { "description": "What it was taken from, below the line. Ratio metrics only.", "format": "double", "type": [ "number", "null" ] }, "numerator": { "description": "What the bucket's ratio was taken from, above the line. Ratio metrics\nonly, and absent on a bucket whose numerator measure has no rows —\na share is argued with its denominator, and a reader who can see\n\"6 of 8\" can tell a quiet day from a bad one.", "format": "double", "type": [ "number", "null" ] }, "value": { "format": "double", "type": [ "number", "null" ] } }, "required": [ "bucket_start" ], "type": "object" }, "UpdateContextRequest": { "properties": { "body": { "type": [ "string", "null" ] }, "title": { "type": [ "string", "null" ] } }, "type": "object" }, "UpdateSavedQueryRequest": { "description": "Request to update a saved query.\n\n`description` uses double-Option (absent → unchanged, `null` → clear,\nvalue → set), matching [`super::metric::UpdateMetricRequest`].", "properties": { "description": { "type": [ "string", "null" ] }, "name": { "type": [ "string", "null" ] }, "sql": { "type": [ "string", "null" ] } }, "type": "object" }, "UsageActionsResponse": { "properties": { "items": { "items": { "$ref": "#/components/schemas/UsageEvent" }, "type": "array" }, "since": { "type": "string" }, "until": { "type": "string" } }, "required": [ "since", "until", "items" ], "type": "object" }, "UsageConfigResponse": { "properties": { "enabled": { "description": "Whether this instance records usage at all.", "type": "boolean" } }, "required": [ "enabled" ], "type": "object" }, "UsageDay": { "properties": { "day": { "type": "string" }, "visitors": { "format": "int64", "minimum": 0, "type": "integer" }, "visits": { "format": "int64", "minimum": 0, "type": "integer" } }, "required": [ "day", "visits", "visitors" ], "type": "object" }, "UsageEvent": { "properties": { "event_name": { "type": "string" }, "opens": { "format": "int64", "minimum": 0, "type": "integer" }, "people": { "format": "int64", "minimum": 0, "type": "integer" }, "target": { "type": "string" } }, "required": [ "event_name", "target", "opens", "people" ], "type": "object" }, "UsageIngestRequest": { "description": "SDK v2 body. Fields shared by every record are hoisted out of them into\n`meta`, so a record carries only what differs.", "properties": { "meta": { "$ref": "#/components/schemas/TelemetryRecord" }, "records": { "items": { "$ref": "#/components/schemas/TelemetryRecord" }, "type": "array" } }, "type": "object" }, "UsagePage": { "properties": { "path": { "type": "string" }, "views": { "format": "int64", "minimum": 0, "type": "integer" }, "visitors": { "format": "int64", "minimum": 0, "type": "integer" } }, "required": [ "path", "views", "visitors" ], "type": "object" }, "UsagePagesResponse": { "properties": { "items": { "items": { "$ref": "#/components/schemas/UsagePage" }, "type": "array" }, "since": { "type": "string" }, "until": { "type": "string" } }, "required": [ "since", "until", "items" ], "type": "object" }, "UsagePeopleResponse": { "properties": { "items": { "items": { "$ref": "#/components/schemas/UsagePerson" }, "type": "array" }, "since": { "type": "string" }, "until": { "type": "string" } }, "required": [ "since", "until", "items" ], "type": "object" }, "UsagePerson": { "properties": { "display_name": { "description": "The roster's name when it lists the visitor, as People shows it; else\nthe identity rows', empty when they hold none.", "type": "string" }, "email": { "description": "The roster's address; null for a visitor the roster does not list.", "type": [ "string", "null" ] }, "last_seen": { "type": "string" }, "page_views": { "format": "int64", "minimum": 0, "type": "integer" }, "person_id": { "type": "string" }, "username": { "description": "The roster's handle when it lists the visitor; else the identity rows',\nempty when they hold none.", "type": "string" }, "visits": { "format": "int64", "minimum": 0, "type": "integer" } }, "required": [ "person_id", "display_name", "username", "visits", "page_views", "last_seen" ], "type": "object" }, "UsageSummaryResponse": { "properties": { "by_day": { "items": { "$ref": "#/components/schemas/UsageDay" }, "type": "array" }, "since": { "type": "string" }, "totals": { "$ref": "#/components/schemas/UsageTotals" }, "until": { "type": "string" } }, "required": [ "since", "until", "totals", "by_day" ], "type": "object" }, "UsageTotals": { "properties": { "page_views": { "format": "int64", "minimum": 0, "type": "integer" }, "visitors": { "format": "int64", "minimum": 0, "type": "integer" }, "visits": { "format": "int64", "minimum": 0, "type": "integer" } }, "required": [ "visits", "visitors", "page_views" ], "type": "object" }, "ValueTransform": { "additionalProperties": false, "description": "Affine + clamp shaping for a computed metric value:\n`y = clamp(clamp_min, clamp_max, multiplier * x + offset)`.\nAbsent fields are identity (multiplier 1, offset 0, no bound).", "properties": { "clamp_max": { "default": null, "format": "double", "type": [ "number", "null" ] }, "clamp_min": { "default": null, "format": "double", "type": [ "number", "null" ] }, "multiplier": { "default": null, "format": "double", "type": [ "number", "null" ] }, "offset": { "default": null, "format": "double", "type": [ "number", "null" ] } }, "type": "object" } }, "securitySchemes": { "bearerAuth": { "bearerFormat": "JWT", "scheme": "bearer", "type": "http" }, "internalToken": { "description": "Platform-plane workload credential, validated by the receiving listener", "in": "header", "name": "x-toolkit-internal-token", "type": "apiKey" } } }, "info": { "description": "Read-only query service over ClickHouse. Serves declarative metric definitions, computed metric results and their evidence, plus tenant-authored saved queries. The API Gateway mounts this service at /api/analytics.", "title": "Analytics API", "version": "1.0.0" }, "openapi": "3.1.0", "paths": { "/v1/ai/config": { "get": { "operationId": "analytics_api.ai.config", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AiConfigResponse" } } }, "description": "AI assist state" }, "400": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Bad Request" }, "401": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Unauthorized" }, "403": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Forbidden" }, "404": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Not Found" }, "409": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Conflict" }, "429": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Too Many Requests" }, "500": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Internal Server Error" } }, "security": [ { "bearerAuth": [] } ], "summary": "Whether this instance explains metrics with AI" } }, "/v1/ai/context": { "get": { "operationId": "analytics_api.ai.context.list", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ContextListResponse" } } }, "description": "Context entries" }, "400": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Bad Request" }, "401": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Unauthorized" }, "403": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Forbidden" }, "404": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Not Found" }, "409": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Conflict" }, "429": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Too Many Requests" }, "500": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Internal Server Error" } }, "security": [ { "bearerAuth": [] } ], "summary": "Context entries the caller's explanations read" }, "post": { "operationId": "analytics_api.ai.context.create", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateContextRequest" } } }, "description": "Entry to add", "required": true }, "responses": { "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ContextEntryResponse" } } }, "description": "Created entry" }, "400": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Bad Request" }, "401": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Unauthorized" }, "403": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Forbidden" }, "404": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Not Found" }, "409": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Conflict" }, "429": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Too Many Requests" }, "500": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Internal Server Error" } }, "security": [ { "bearerAuth": [] } ], "summary": "Add a context entry" } }, "/v1/ai/context/{id}": { "delete": { "operationId": "analytics_api.ai.context.delete", "responses": { "204": { "description": "Entry removed" }, "400": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Bad Request" }, "401": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Unauthorized" }, "403": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Forbidden" }, "404": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Not Found" }, "409": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Conflict" }, "429": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Too Many Requests" }, "500": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Internal Server Error" } }, "security": [ { "bearerAuth": [] } ], "summary": "Remove a context entry" }, "patch": { "operationId": "analytics_api.ai.context.update", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateContextRequest" } } }, "description": "Fields to change", "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ContextEntryResponse" } } }, "description": "Updated entry" }, "400": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Bad Request" }, "401": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Unauthorized" }, "403": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Forbidden" }, "404": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Not Found" }, "409": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Conflict" }, "429": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Too Many Requests" }, "500": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Internal Server Error" } }, "security": [ { "bearerAuth": [] } ], "summary": "Edit a context entry" } }, "/v1/ai/credentials": { "delete": { "operationId": "analytics_api.ai.credentials.delete", "responses": { "204": { "description": "Key removed" }, "400": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Bad Request" }, "401": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Unauthorized" }, "403": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Forbidden" }, "404": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Not Found" }, "409": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Conflict" }, "429": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Too Many Requests" }, "500": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Internal Server Error" } }, "security": [ { "bearerAuth": [] } ], "summary": "Forget the caller's Anthropic key" }, "get": { "operationId": "analytics_api.ai.credentials.get", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AiCredentialResponse" } } }, "description": "Stored-key state" }, "400": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Bad Request" }, "401": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Unauthorized" }, "403": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Forbidden" }, "404": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Not Found" }, "409": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Conflict" }, "429": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Too Many Requests" }, "500": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Internal Server Error" } }, "security": [ { "bearerAuth": [] } ], "summary": "Whether the caller has an Anthropic key stored" }, "put": { "operationId": "analytics_api.ai.credentials.put", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PutCredentialRequest" } } }, "description": "The key to store", "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AiCredentialResponse" } } }, "description": "Stored-key state" }, "400": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Bad Request" }, "401": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Unauthorized" }, "403": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Forbidden" }, "404": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Not Found" }, "409": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Conflict" }, "429": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Too Many Requests" }, "500": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Internal Server Error" } }, "security": [ { "bearerAuth": [] } ], "summary": "Store or replace the caller's Anthropic key" } }, "/v1/ai/explain": { "post": { "operationId": "analytics_api.ai.explain", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ExplainRequest" } } }, "description": "The tile to explain", "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ExplainResponse" } } }, "description": "The explanation" }, "400": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Bad Request" }, "401": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Unauthorized" }, "403": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Forbidden" }, "404": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Not Found" }, "409": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Conflict" }, "429": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Too Many Requests" }, "500": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Internal Server Error" } }, "security": [ { "bearerAuth": [] } ], "summary": "Explain one metric reading" } }, "/v1/ai/settings": { "delete": { "operationId": "analytics_api.ai.settings.reset", "responses": { "204": { "description": "Prompt reset" }, "400": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Bad Request" }, "401": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Unauthorized" }, "403": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Forbidden" }, "404": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Not Found" }, "409": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Conflict" }, "429": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Too Many Requests" }, "500": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Internal Server Error" } }, "security": [ { "bearerAuth": [] } ], "summary": "Restore the shipped system prompt" }, "get": { "operationId": "analytics_api.ai.settings.get", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AiSettingsResponse" } } }, "description": "System prompt" }, "400": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Bad Request" }, "401": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Unauthorized" }, "403": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Forbidden" }, "404": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Not Found" }, "409": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Conflict" }, "429": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Too Many Requests" }, "500": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Internal Server Error" } }, "security": [ { "bearerAuth": [] } ], "summary": "The system prompt in force for this tenant" }, "put": { "operationId": "analytics_api.ai.settings.put", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PutSettingsRequest" } } }, "description": "The prompt to store", "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AiSettingsResponse" } } }, "description": "System prompt" }, "400": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Bad Request" }, "401": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Unauthorized" }, "403": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Forbidden" }, "404": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Not Found" }, "409": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Conflict" }, "429": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Too Many Requests" }, "500": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Internal Server Error" } }, "security": [ { "bearerAuth": [] } ], "summary": "Replace this tenant's system prompt" } }, "/v1/connector-health": { "get": { "operationId": "analytics_api.connector_health.summary", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ConnectorHealthResponse" } } }, "description": "One row per connector, ordered by what needs acting on" }, "400": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Bad Request" }, "401": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Unauthorized" }, "403": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Forbidden" }, "404": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Not Found" }, "409": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Conflict" }, "429": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Too Many Requests" }, "500": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Internal Server Error" } }, "security": [ { "bearerAuth": [] } ], "summary": "Recorded sync state of every connector" } }, "/v1/connector-health/{connector}/syncs": { "get": { "operationId": "analytics_api.connector_health.syncs", "parameters": [ { "description": "Connector name, as the descriptors spell it", "in": "path", "name": "connector", "required": true, "schema": { "type": "string" } }, { "description": "Tenant of one installation of the connector. Required alongside source_id; omit both to span every installation", "in": "query", "name": "tenant_id", "required": false, "schema": { "type": "string" } }, { "description": "Source id of one installation, as its Secret annotates it. Required alongside tenant_id", "in": "query", "name": "source_id", "required": false, "schema": { "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SyncHistoryResponse" } } }, "description": "A bounded window of recorded syncs" }, "400": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Bad Request" }, "401": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Unauthorized" }, "403": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Forbidden" }, "404": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Not Found" }, "409": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Conflict" }, "429": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Too Many Requests" }, "500": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Internal Server Error" } }, "security": [ { "bearerAuth": [] } ], "summary": "Recent syncs of one connector, newest first" } }, "/v1/feedback": { "get": { "operationId": "analytics_api.feedback.list", "parameters": [ { "description": "Inclusive first day, YYYY-MM-DD", "in": "query", "name": "since", "required": false, "schema": { "type": "string" } }, { "description": "Inclusive last day, YYYY-MM-DD", "in": "query", "name": "until", "required": false, "schema": { "type": "string" } }, { "description": "desc (default) or asc", "in": "query", "name": "direction", "required": false, "schema": { "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FeedbackListResponse" } } }, "description": "Feedback entries, newest first unless direction says otherwise" }, "400": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Bad Request" }, "401": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Unauthorized" }, "403": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Forbidden" }, "500": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Internal Server Error" } }, "security": [ { "bearerAuth": [] } ], "summary": "Feedback sent in a date range" }, "post": { "operationId": "analytics_api.feedback.submit", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FeedbackRequest" } } }, "description": "A feedback submission", "required": true }, "responses": { "204": { "description": "Recorded" }, "400": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Bad Request" }, "401": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Unauthorized" }, "415": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Unsupported Media Type" }, "500": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Internal Server Error" } }, "security": [ { "bearerAuth": [] } ], "summary": "Send product feedback" } }, "/v1/ingestion/intensity": { "get": { "operationId": "analytics_api.ingestion.intensity", "parameters": [ { "description": "Bucket width: 15m or 1s", "in": "query", "name": "grain", "required": false, "schema": { "type": "string" } }, { "description": "Bronze database to scope to, e.g. bronze_bamboohr", "in": "query", "name": "scope", "required": false, "schema": { "type": "string" } }, { "description": "What one band counts: connector, stream or total", "in": "query", "name": "series", "required": false, "schema": { "type": "string" } }, { "description": "Inclusive lower bound, RFC 3339", "in": "query", "name": "from", "required": false, "schema": { "type": "string" } }, { "description": "Exclusive upper bound, RFC 3339", "in": "query", "name": "to", "required": false, "schema": { "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/IngestionIntensityResponse" } } }, "description": "Extraction intensity buckets" }, "400": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Bad Request" }, "401": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Unauthorized" }, "403": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Forbidden" }, "404": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Not Found" }, "409": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Conflict" }, "429": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Too Many Requests" }, "500": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Internal Server Error" } }, "security": [ { "bearerAuth": [] } ], "summary": "Bronze extraction intensity per bucket" } }, "/v1/metric-definitions": { "get": { "operationId": "analytics_api.metric_definitions.list", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MetricDefinitionListResponse" } } }, "description": "Metric definitions" }, "401": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Unauthorized" }, "500": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Internal Server Error" } }, "security": [ { "bearerAuth": [] } ], "summary": "List unified metric definitions" } }, "/v1/metric-drilldown": { "post": { "operationId": "analytics_api.metric_drilldown.create", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MetricDrilldownRequest" } } }, "description": "Metric evidence selection", "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MetricDrilldownResponse" } } }, "description": "Metric evidence" }, "400": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Bad Request" }, "401": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Unauthorized" }, "403": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Forbidden" }, "404": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Not Found" }, "415": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Unsupported Media Type" }, "429": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Too Many Requests" }, "500": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Internal Server Error" } }, "security": [ { "bearerAuth": [] } ], "summary": "List metric evidence" } }, "/v1/metric-drilldown/export": { "post": { "operationId": "analytics_api.metric_drilldown.export", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MetricDrilldownExportRequest" } } }, "description": "Metric evidence export selection", "required": true }, "responses": { "200": { "content": { "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": { "schema": { "format": "binary", "type": "string" } }, "text/csv": { "schema": { "format": "binary", "type": "string" } } }, "description": "Complete metric evidence export", "headers": { "Content-Disposition": { "description": "Attachment filename", "schema": { "type": "string" } } } }, "400": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Bad Request" }, "401": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Unauthorized" }, "403": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Forbidden" }, "404": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Not Found" }, "409": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Conflict" }, "429": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Too Many Requests" }, "500": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Internal Server Error" } }, "security": [ { "bearerAuth": [] } ], "summary": "Export metric evidence" } }, "/v1/metric-results": { "post": { "operationId": "analytics_api.metric_results.create", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MetricResultsRequest" } } }, "description": "Metric result request", "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MetricResultsResponse" } } }, "description": "Metric results" }, "400": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Bad Request" }, "401": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Unauthorized" }, "403": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Forbidden" }, "415": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Unsupported Media Type" }, "500": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Internal Server Error" } }, "security": [ { "bearerAuth": [] } ], "summary": "Compute metric results" } }, "/v1/metrics": { "get": { "operationId": "analytics_api.metrics.list", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CustomMetricListResponse" } } }, "description": "List of custom metrics" }, "400": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Bad Request" }, "401": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Unauthorized" }, "403": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Forbidden" }, "404": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Not Found" }, "409": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Conflict" }, "429": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Too Many Requests" }, "500": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Internal Server Error" } }, "security": [ { "bearerAuth": [] } ], "summary": "List custom metrics" }, "post": { "operationId": "analytics_api.metrics.create", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CustomMetric" } } }, "description": "Custom metric to create", "required": true }, "responses": { "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CustomMetric" } } }, "description": "Created custom metric" }, "400": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Bad Request" }, "401": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Unauthorized" }, "403": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Forbidden" }, "404": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Not Found" }, "409": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Conflict" }, "429": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Too Many Requests" }, "500": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Internal Server Error" } }, "security": [ { "bearerAuth": [] } ], "summary": "Create a custom metric" } }, "/v1/metrics/export": { "get": { "operationId": "analytics_api.metrics.export", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ExportCustomMetricsResponse" } } }, "description": "Portable custom metric graphs" }, "400": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Bad Request" }, "401": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Unauthorized" }, "403": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Forbidden" }, "404": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Not Found" }, "409": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Conflict" }, "429": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Too Many Requests" }, "500": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Internal Server Error" } }, "security": [ { "bearerAuth": [] } ], "summary": "Export custom metrics" } }, "/v1/metrics/import": { "post": { "operationId": "analytics_api.metrics.import", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ImportCustomMetricsRequest" } } }, "description": "Custom metric graphs to import", "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ImportCustomMetricsResponse" } } }, "description": "Import result" }, "400": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Bad Request" }, "401": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Unauthorized" }, "403": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Forbidden" }, "404": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Not Found" }, "409": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Conflict" }, "429": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Too Many Requests" }, "500": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Internal Server Error" } }, "security": [ { "bearerAuth": [] } ], "summary": "Import custom metrics" } }, "/v1/metrics/{metric_key}": { "delete": { "operationId": "analytics_api.metrics.delete", "responses": { "204": { "description": "Custom metric deleted" }, "400": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Bad Request" }, "401": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Unauthorized" }, "403": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Forbidden" }, "404": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Not Found" }, "409": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Conflict" }, "429": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Too Many Requests" }, "500": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Internal Server Error" } }, "security": [ { "bearerAuth": [] } ], "summary": "Delete a custom metric" }, "get": { "operationId": "analytics_api.metrics.get", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CustomMetric" } } }, "description": "Custom metric" }, "400": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Bad Request" }, "401": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Unauthorized" }, "403": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Forbidden" }, "404": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Not Found" }, "409": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Conflict" }, "429": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Too Many Requests" }, "500": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Internal Server Error" } }, "security": [ { "bearerAuth": [] } ], "summary": "Get a custom metric by key" }, "put": { "operationId": "analytics_api.metrics.update", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CustomMetric" } } }, "description": "Custom metric fields to replace", "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CustomMetric" } } }, "description": "Updated custom metric" }, "400": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Bad Request" }, "401": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Unauthorized" }, "403": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Forbidden" }, "404": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Not Found" }, "409": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Conflict" }, "429": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Too Many Requests" }, "500": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Internal Server Error" } }, "security": [ { "bearerAuth": [] } ], "summary": "Update a custom metric" } }, "/v1/queries": { "get": { "operationId": "analytics_api.queries.list", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SavedQueryListResponse" } } }, "description": "List of saved queries" }, "400": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Bad Request" }, "401": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Unauthorized" }, "403": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Forbidden" }, "404": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Not Found" }, "409": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Conflict" }, "429": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Too Many Requests" }, "500": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Internal Server Error" } }, "security": [ { "bearerAuth": [] } ], "summary": "List saved queries" }, "post": { "operationId": "analytics_api.queries.create", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateSavedQueryRequest" } } }, "description": "Saved query to create", "required": true }, "responses": { "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SavedQuery" } } }, "description": "Created saved query" }, "400": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Bad Request" }, "401": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Unauthorized" }, "403": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Forbidden" }, "404": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Not Found" }, "409": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Conflict" }, "429": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Too Many Requests" }, "500": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Internal Server Error" } }, "security": [ { "bearerAuth": [] } ], "summary": "Create a saved query" } }, "/v1/queries/{id}": { "delete": { "operationId": "analytics_api.queries.delete", "responses": { "204": { "description": "Saved query deleted" }, "400": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Bad Request" }, "401": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Unauthorized" }, "403": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Forbidden" }, "404": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Not Found" }, "409": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Conflict" }, "429": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Too Many Requests" }, "500": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Internal Server Error" } }, "security": [ { "bearerAuth": [] } ], "summary": "Delete a saved query" }, "get": { "operationId": "analytics_api.queries.get", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SavedQuery" } } }, "description": "Saved query" }, "400": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Bad Request" }, "401": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Unauthorized" }, "403": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Forbidden" }, "404": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Not Found" }, "409": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Conflict" }, "429": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Too Many Requests" }, "500": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Internal Server Error" } }, "security": [ { "bearerAuth": [] } ], "summary": "Get a saved query by id" }, "put": { "operationId": "analytics_api.queries.update", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateSavedQueryRequest" } } }, "description": "Saved query fields to update", "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SavedQuery" } } }, "description": "Updated saved query" }, "400": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Bad Request" }, "401": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Unauthorized" }, "403": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Forbidden" }, "404": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Not Found" }, "409": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Conflict" }, "429": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Too Many Requests" }, "500": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Internal Server Error" } }, "security": [ { "bearerAuth": [] } ], "summary": "Update a saved query" } }, "/v1/queries/{id}/run": { "post": { "operationId": "analytics_api.queries.run", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RunSavedQueryRequest" } } }, "description": "Optional named parameters (`period`); `tenant` is always injected from context" }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RunResponse" } } }, "description": "Query result rows" }, "400": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Bad Request" }, "401": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Unauthorized" }, "403": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Forbidden" }, "404": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Not Found" }, "409": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Conflict" }, "429": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Too Many Requests" }, "500": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Internal Server Error" } }, "security": [ { "bearerAuth": [] } ], "summary": "Run a saved query" } }, "/v1/reports/export": { "post": { "operationId": "analytics_api.reports.export", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ReportExportRequest" } } }, "description": "Report export recipe", "required": true }, "responses": { "200": { "content": { "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": { "schema": { "format": "binary", "type": "string" } }, "text/csv": { "schema": { "format": "binary", "type": "string" } } }, "description": "Complete metric report export", "headers": { "Content-Disposition": { "description": "Attachment filename", "schema": { "type": "string" } } } }, "400": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Bad Request" }, "401": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Unauthorized" }, "403": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Forbidden" }, "415": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Unsupported Media Type" }, "429": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Too Many Requests" }, "500": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Internal Server Error" } }, "security": [ { "bearerAuth": [] } ], "summary": "Export a metric report" } }, "/v1/reports/preview": { "post": { "operationId": "analytics_api.reports.preview", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ReportRecipe" } } }, "description": "Report recipe", "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ReportPreviewResponse" } } }, "description": "Report preview" }, "400": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Bad Request" }, "401": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Unauthorized" }, "403": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Forbidden" }, "415": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Unsupported Media Type" }, "429": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Too Many Requests" }, "500": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Internal Server Error" } }, "security": [ { "bearerAuth": [] } ], "summary": "Preview a metric report" } }, "/v1/usage/actions": { "get": { "operationId": "analytics_api.usage.actions", "parameters": [ { "description": "Inclusive first day, YYYY-MM-DD", "in": "query", "name": "since", "required": false, "schema": { "type": "string" } }, { "description": "Inclusive last day, YYYY-MM-DD", "in": "query", "name": "until", "required": false, "schema": { "type": "string" } }, { "description": "opens (default) or people", "in": "query", "name": "sort", "required": false, "schema": { "type": "string" } }, { "description": "desc (default) or asc", "in": "query", "name": "direction", "required": false, "schema": { "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UsageActionsResponse" } } }, "description": "Actions in the requested order" }, "400": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Bad Request" }, "401": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Unauthorized" }, "403": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Forbidden" }, "404": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Not Found" }, "409": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Conflict" }, "429": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Too Many Requests" }, "500": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Internal Server Error" } }, "security": [ { "bearerAuth": [] } ], "summary": "Drill-downs and other actions in a date range" } }, "/v1/usage/config": { "get": { "operationId": "analytics_api.usage.config", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UsageConfigResponse" } } }, "description": "Usage collection state" }, "400": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Bad Request" }, "401": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Unauthorized" }, "403": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Forbidden" }, "404": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Not Found" }, "409": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Conflict" }, "429": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Too Many Requests" }, "500": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Internal Server Error" } }, "security": [ { "bearerAuth": [] } ], "summary": "Whether this instance records usage" } }, "/v1/usage/events": { "post": { "operationId": "analytics_api.usage.ingest", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UsageIngestRequest" } } }, "description": "Telemetry SDK records", "required": true }, "responses": { "204": { "description": "Accepted" }, "401": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Unauthorized" }, "415": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Unsupported Media Type" } }, "security": [ { "bearerAuth": [] } ], "summary": "Record usage events" } }, "/v1/usage/pages": { "get": { "operationId": "analytics_api.usage.pages", "parameters": [ { "description": "Inclusive first day, YYYY-MM-DD", "in": "query", "name": "since", "required": false, "schema": { "type": "string" } }, { "description": "Inclusive last day, YYYY-MM-DD", "in": "query", "name": "until", "required": false, "schema": { "type": "string" } }, { "description": "views (default) or visitors", "in": "query", "name": "sort", "required": false, "schema": { "type": "string" } }, { "description": "desc (default) or asc", "in": "query", "name": "direction", "required": false, "schema": { "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UsagePagesResponse" } } }, "description": "Pages in the requested order" }, "400": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Bad Request" }, "401": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Unauthorized" }, "403": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Forbidden" }, "404": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Not Found" }, "409": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Conflict" }, "429": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Too Many Requests" }, "500": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Internal Server Error" } }, "security": [ { "bearerAuth": [] } ], "summary": "What was opened in a date range" } }, "/v1/usage/people": { "get": { "operationId": "analytics_api.usage.people", "parameters": [ { "description": "Inclusive first day, YYYY-MM-DD", "in": "query", "name": "since", "required": false, "schema": { "type": "string" } }, { "description": "Inclusive last day, YYYY-MM-DD", "in": "query", "name": "until", "required": false, "schema": { "type": "string" } }, { "description": "visits (default), page_views or last_seen", "in": "query", "name": "sort", "required": false, "schema": { "type": "string" } }, { "description": "desc (default) or asc", "in": "query", "name": "direction", "required": false, "schema": { "type": "string" } }, { "description": "Part of a visitor's name or handle, any case", "in": "query", "name": "search", "required": false, "schema": { "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UsagePeopleResponse" } } }, "description": "Visitors in the requested order" }, "400": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Bad Request" }, "401": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Unauthorized" }, "403": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Forbidden" }, "404": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Not Found" }, "409": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Conflict" }, "429": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Too Many Requests" }, "500": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Internal Server Error" } }, "security": [ { "bearerAuth": [] } ], "summary": "Who opened the product in a date range" } }, "/v1/usage/summary": { "get": { "operationId": "analytics_api.usage.summary", "parameters": [ { "description": "Inclusive first day, YYYY-MM-DD", "in": "query", "name": "since", "required": false, "schema": { "type": "string" } }, { "description": "Inclusive last day, YYYY-MM-DD", "in": "query", "name": "until", "required": false, "schema": { "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UsageSummaryResponse" } } }, "description": "Usage summary" }, "400": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Bad Request" }, "401": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Unauthorized" }, "403": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Forbidden" }, "404": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Not Found" }, "409": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Conflict" }, "429": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Too Many Requests" }, "500": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Internal Server Error" } }, "security": [ { "bearerAuth": [] } ], "summary": "Usage summary for a date range" } } }, "x-toolkit-spec-scope": "minimum-conformance" }