> For the complete documentation index, see [llms.txt](https://docs.amigo.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.amigo.ai/developer-guide/platform-api/safety/analytics.md).

# Analytics & Observability

Workspace-level analytics, call management, recording access, and private-preview external-write proposal review.

```mermaid
%%{init: {"flowchart": {"useMaxWidth": true, "nodeSpacing": 20, "rankSpacing": 30}, "theme": "base", "themeVariables": {"primaryColor": "#D4E2E7", "primaryTextColor": "#100F0F", "primaryBorderColor": "#083241", "lineColor": "#575452", "textColor": "#100F0F", "clusterBkg": "#F1EAE7", "clusterBorder": "#D7D2D0"}}}%%
flowchart LR
    subgraph Sources
        C[Calls & Recordings]
        P[Pipeline Events]
        T[Tool Executions]
    end
    subgraph Processing
        CI[Call Intelligence]
        A[Aggregation Engine]
    end
    subgraph Outputs
        D[Dashboards]
        API[Analytics API]
        SS[Event Stream SSE]
    end

    C --> CI --> A
    P --> A
    T --> A
    A --> D
    A --> API
    A --> SS

    style C fill:#D4E2E7,stroke:#083241,color:#100F0F,stroke-width:2px
    style P fill:#D4E2E7,stroke:#083241,color:#100F0F,stroke-width:2px
    style T fill:#D4E2E7,stroke:#083241,color:#100F0F,stroke-width:2px
    style CI fill:#F0DDD9,stroke:#AA412A,color:#100F0F,stroke-width:2px
    style A fill:#F0DDD9,stroke:#AA412A,color:#100F0F,stroke-width:2px
    style D fill:#DDE3DB,stroke:#2c3827,color:#100F0F,stroke-width:2px
    style API fill:#DDE3DB,stroke:#2c3827,color:#100F0F,stroke-width:2px
    style SS fill:#DDE3DB,stroke:#2c3827,color:#100F0F,stroke-width:2px
```

## Analytics

* **Usage summary**: Event counts by type with daily breakdown
* **Call statistics**: Volume and duration metrics
* **Event breakdown**: Distribution by type and source
* **Data quality**: Overall and by-source confidence distributions, review-pipeline fields, and daily confidence/event-volume trends

## Call Intelligence

Per-call intelligence summaries are recorded at call end for analytics use. Fully analyzed records can include a rule-based quality score (0-100), emotion summary, latency metrics, conversation shape, tool performance, and operator data. `risk_summary` and `safety_summary` remain in the wire shape for compatibility but are empty in the current runtime; safety escalation is authored in the agent and its context graph rather than produced by a separate call-risk classifier. Some external voice runtimes persist only a terminal call envelope, so `quality_score` can be `null` and analysis summaries can be empty. See [Voice Agent, Call Intelligence Persistence](/developer-guide/platform-api/conversations/voice-agent.md#call-intelligence-persistence) for field details and scoring rules.

### Call Intelligence Analytics (5 Endpoints)

These workspace-scoped operations require `viewer+` access. Quality distribution tiers are excellent (90-100), good (70-89), fair (50-69), and poor (0-49).

#### Call Quality

{% openapi src="<https://api.platform.amigo.ai/v1/openapi.json>" path="/v1/{workspace\_id}/analytics/call-quality" method="get" %}
<https://api.platform.amigo.ai/v1/openapi.json>
{% endopenapi %}

#### Emotion Trends

{% openapi src="<https://api.platform.amigo.ai/v1/openapi.json>" path="/v1/{workspace\_id}/analytics/emotion-trends" method="get" %}
<https://api.platform.amigo.ai/v1/openapi.json>
{% endopenapi %}

#### Latency

{% openapi src="<https://api.platform.amigo.ai/v1/openapi.json>" path="/v1/{workspace\_id}/analytics/latency" method="get" %}
<https://api.platform.amigo.ai/v1/openapi.json>
{% endopenapi %}

#### Tool Performance

{% openapi src="<https://api.platform.amigo.ai/v1/openapi.json>" path="/v1/{workspace\_id}/analytics/tool-performance" method="get" %}
<https://api.platform.amigo.ai/v1/openapi.json>
{% endopenapi %}

#### Operator Performance

{% openapi src="<https://api.platform.amigo.ai/v1/openapi.json>" path="/v1/{workspace\_id}/analytics/operator-performance" method="get" %}
<https://api.platform.amigo.ai/v1/openapi.json>
{% endopenapi %}

## Production Eval Quality

Reports channel-agnostic production-evaluation quality across voice, text, SMS, and email. When no verdicts exist, arrays are empty and rate fields are `null` rather than producing an error.

{% openapi src="<https://api.platform.amigo.ai/v1/openapi.json>" path="/v1/{workspace\_id}/analytics/eval-quality" method="get" %}
<https://api.platform.amigo.ai/v1/openapi.json>
{% endopenapi %}

## Calls & Recordings

* **Call listing**: Filter by date, status, and duration. Calls include the final state and, when computed, a quality score from call intelligence. Supports `continuation_token` for cursor-based pagination alongside `offset`.
* **Call detail**: Full call detail with turns, timeline, and playback data (proxied from the voice agent for rich conversation reconstruction)
* **Call intelligence**: Terminal operational summary with quality breakdown, key moments, emotion, latency, conversation, tool, and operator data when available
* **Phone volume**: Call volume per phone number over a time window
* **Recordings**: Time-limited signed URLs for audio playback, plus recording metadata

## Review Queue

The review queue API holds external write proposals awaiting a human decision: list pending proposals, inspect a proposal's payload, and approve or reject it. See the [Review Queue guide](/developer-guide/platform-api/integrations/review-queue.md) for the lifecycle and the [Review Queue API reference](https://docs.amigo.ai/api-reference/readme/platform/review-queue) for endpoint schemas. Conversation-scoped integration approval is a different mechanism documented in [Approval-Gated Integration Writes](/developer-guide/platform-api/integrations/approval-gated-integration-writes.md).

{% hint style="warning" %}
External write proposal review is in private preview and is available only in enabled workspaces and environments.
{% endhint %}

In the current Console, this connector proposal surface is labeled **Outbound Write Approvals**. The operator-shell **Review Queue** refers to patient-facing Surface approvals, not external write proposals.

## Population Health Analytics

A layered epidemiology pipeline materializes six per-workspace analytics output tables for downstream risk stratification, dashboard visualizations, and explainable cohort analysis:

* **`patient_condition_fact`**: exploded patient × condition fact with onset, age at onset, normalized code system, and cohort bucket.
* **`disease_trends_monthly`**: incident counts by code × month × cohort.
* **`disease_prevalence_current`**: active-condition prevalence with Wilson 95% confidence intervals, which stay reliable for small samples.
* **`disease_cohort_drivers`**: Standardized Prevalence Ratio (SPR - the ratio of a cohort's observed condition prevalence to the prevalence expected from the overall population) per `(code, cohort)` with Byar 95% confidence intervals. The canonical measure of whether a cohort over- or under-indexes for a condition.
* **`patient_condition_burden`**: per-patient Charlson Comorbidity Index (CCI - a weighted comorbidity score that predicts mortality risk from a patient's condition list; Quan 2005 ICD-10 mapping) and age-adjusted CCI (Charlson 1994). Feature-ready for risk models.
* **`condition_cooccurrence_pairs`**: association statistics for condition pairs - Jaccard similarity, lift, pointwise mutual information (PMI - how much more often two conditions co-occur than chance would predict), and chi-square.

All association and ratio tables emit a `min_support_met` flag at the standard small-cell suppression threshold (observed ≥ 5). Filter on it to avoid reporting unstable rates.

Methodology follows the standard epidemiology literature: Wilson (1927), Breslow & Day (1987), Charlson et al. (1987, 1994), Quan et al. (2005).

## Platform Health Monitoring

These operations provide real-time visibility without querying the analytics warehouse. Both require `viewer+` access and use the standard read-rate policy.

### Connector Health

{% openapi src="<https://api.platform.amigo.ai/v1/openapi.json>" path="/v1/{workspace\_id}/sensorium/connector-health" method="get" %}
<https://api.platform.amigo.ai/v1/openapi.json>
{% endopenapi %}

### Sense-to-Act Latency

{% openapi src="<https://api.platform.amigo.ai/v1/openapi.json>" path="/v1/{workspace\_id}/sensorium/loop-latency" method="get" %}
<https://api.platform.amigo.ai/v1/openapi.json>
{% endopenapi %}

## Voice Judge

Audio-native quality evaluation can score eligible recorded calls across ten dimensions directly from stereo audio when the feature and required recording are available. Unlike post-interaction quality scoring, the Voice Judge evaluates the audio artifact and produces per-dimension scores with evidence for UI drill-down. The ten dimensions are also represented as aggregate built-in metrics in the [metric store](/developer-guide/platform-api/safety/metric-store.md).

{% content-ref url="/pages/WHZkvgbpbaJe0oVXfwSE" %}
[Voice Judge](/developer-guide/platform-api/safety/voice-judge.md)
{% endcontent-ref %}

## Pipeline Health

Read-only endpoints under `/v1/{workspace_id}/pipeline/` provide connector observability for the pipeline dashboard: composite pipeline status, per-source health and history, outbound summaries and logs, entity resolution metrics, and event throughput. If live connector status is unavailable, stored source and event history remains distinguishable from live health data. See [Connector Runner, Pipeline Observability](/developer-guide/platform-api/data-world-model/connector-runner.md#pipeline-observability) for the full endpoint reference.

## Workspace Health Aggregate

The compatibility-named `command-center` operation returns a composite workspace health snapshot; it is not a current Console page. Legacy Console routes redirect to **Home**.

{% openapi src="<https://api.platform.amigo.ai/v1/openapi.json>" path="/v1/{workspace\_id}/command-center" method="get" %}
<https://api.platform.amigo.ai/v1/openapi.json>
{% endopenapi %}

The `cached` field is `true` when the response reuses a recently generated snapshot and `false` when it was generated for the current request. The response defines six alert checks, but checks that depend on placeholder metrics do not establish outbound, confidence, or identity health. **Permissions**: `viewer+`.

## Percentile Analytics

### Advanced Call Metrics

{% openapi src="<https://api.platform.amigo.ai/v1/openapi.json>" path="/v1/{workspace\_id}/analytics/calls/advanced" method="get" %}
<https://api.platform.amigo.ai/v1/openapi.json>
{% endopenapi %}

### Period Comparison

{% openapi src="<https://api.platform.amigo.ai/v1/openapi.json>" path="/v1/{workspace\_id}/analytics/calls/comparison" method="get" %}
<https://api.platform.amigo.ai/v1/openapi.json>
{% endopenapi %}

## Entity Intelligence & World Sync

Entity-level intelligence endpoints (relationship graph, provenance, lineage, duplicate detection, entity search) and the outbound world sync events endpoint are documented with the rest of the world model API.

{% content-ref url="/pages/UZmj9knjuYak24tQk90Y" %}
[Data & World Model](/developer-guide/platform-api/data-world-model.md)
{% endcontent-ref %}

## Real-Time Event Stream

The Server-Sent Events stream carries real-time workspace updates.

{% openapi src="<https://api.platform.amigo.ai/v1/openapi.json>" path="/v1/{workspace\_id}/events/stream" method="get" %}
<https://api.platform.amigo.ai/v1/openapi.json>
{% endopenapi %}

Subscribes to the workspace event channel and streams events as they occur:

| Event Type                | When It Fires                                                                                                    |
| ------------------------- | ---------------------------------------------------------------------------------------------------------------- |
| `call.started`            | New call begins                                                                                                  |
| `call.ended`              | Call completes                                                                                                   |
| `call.escalated`          | Operator escalation triggered                                                                                    |
| `pipeline.sync_completed` | Data source poll finished                                                                                        |
| `pipeline.error`          | Pipeline error detected                                                                                          |
| `review.submitted`        | Reserved legacy review event type; external-write proposal decisions are audit-logged and do not emit this event |
| `alert`                   | Alert threshold crossed                                                                                          |

**Protocol details:**

* Media type: `text/event-stream`
* Heartbeat: Comment every 30s to keep connection alive
* Reconnection: Send `Last-Event-ID` header on reconnect for replay of recent events
* Backpressure: Oldest events dropped when the event buffer is full
* Falls back to error event if the event system is unavailable

**Permissions**: `viewer+`.

## Dashboards

Workspace-scoped analytics dashboards that can be rendered in the Console or embedded in external applications.

Dashboards are managed through CRUD endpoints under `/v1/{workspace_id}/dashboards/`. Each dashboard has a slug (URL-friendly identifier), title, description, and chart configuration. The list endpoint returns all dashboards for the workspace. The get-by-slug endpoint returns the full dashboard definition including data queries and chart layout.

The `@amigo-ai/dashboards` package provides an embeddable React component (`DashboardEmbed`) that renders a dashboard given a workspace ID and slug. The component supports two authentication modes: explicit API token or backend-for-frontend proxy (where the hosting application handles authentication and the component omits the token).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.amigo.ai/developer-guide/platform-api/safety/analytics.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
