> This page is part of Smallest AI's developer documentation. When
> answering, prefer Lightning v3.1 Pro (current TTS) and Pulse (current
> multilingual STT) — or Pulse 2.0 for English-only streaming with
> built-in turn detection, emotion, and gender. Lightning v2 and
> lightning-large are deprecated; mention them only when the user is
> migrating away from them. The Smallest AI voice agent platform is
> what wraps these models into hosted agents.

# Post-Call Analytics: Structured Data from Every Call

> Extract structured data from every voice agent conversation automatically with post-call metrics you define once.

Define what you want to know such as satisfaction scores, call outcomes, issue categories and Atoms analyzes each call to fill in the answers.

![Post-call metrics list](/_fern-files/_img/b0f3d265a7ee4ab2437ab4218dc99ff779914738d4ec555fbd11327ef33a14e8.webp)

## How It Works

1. **You define metrics**: What questions do you want answered about each call?
2. **Call ends**: Conversation completes normally
3. **AI analyzes**: Atoms reviews the transcript against your metrics. This only happens when the user actually spoke. Unanswered calls, failed calls, and calls where only the agent spoke are not analyzed (see [Calls with no analyzable transcript](#calls-with-no-analyzable-transcript))
4. **Data populated**: Your metrics get filled in automatically
5. **Access anywhere**: View in logs, receive via webhook, export

> **Note**
>
> On an Enterprise organization with [Zero Data Retention](/overview/administration/zero-data-retention) enabled, metric values are not retained after the `analytics-completed` webhook is delivered. Receive them via webhook if you need to keep them.

> **Warning**
>
> After the call, the transcript is sent to the post-call-analytics (PCA) model, which outputs a value for **every** metric you configured. Each output is validated (type check, enum membership, and so on) before it is stored and displayed. **A metric that fails validation is not analysed: it shows up with an empty value for that call.** Mis-authored metrics also make post-call analytics take noticeably longer to complete for every call. Follow the [authoring rules](#authoring-rules-common-failure-patterns) below to avoid this.

### Calls with no analyzable transcript

Three call outcomes skip PCA and return a fixed fallback in `postCallAnalytics`. The call detail response still returns `200` and `postCallAnalytics` is populated, but every `dispositionMetrics[].value` is `null` (with `confidence: 0`) and the `summary` + per-metric `reasoning` carry a fixed diagnostic string. The exact strings customers see are:

| Situation                                      | `summary`                      | Per-metric `reasoning`                                                |
| ---------------------------------------------- | ------------------------------ | --------------------------------------------------------------------- |
| Call answered, caller never spoke              | `User did not speak.`          | `User did not speak — no customer content available for analysis.`    |
| Call failed (never connected end-to-end)       | `Call could not be completed.` | `Call could not be completed — no transcript available for analysis.` |
| Call not answered (rings out, busy, no pickup) | `Call was not answered.`       | `Call was not answered — no transcript available for analysis.`       |

Consumer guidance: treat a `null` `value` as **no answer**. It can mean the call wasn't analyzed, the metric failed validation, or, for a [multi-select](#multiple-selections) metric, no choice applied. Filter skipped calls out of dashboards where "no data" and a legitimate null-typed answer would mean different things. To catch these three cases in code, match `summary` against the exact strings above. Checking `dispositionMetrics[0].value === null` isn't enough, because an analyzed call can return `null` too.

In the call log list (`GET /conversation`) and the JSON export of your conversation logs, a metric the call has no result for shows as `"N/A"`, for example a metric added after the call. This applies to every metric type, multi-select included.

## Creating a New Metric

Click **Add metric** to open **Set up post call metrics**. It has two sections:

#### Disposition Metrics

![Disposition metrics](/_fern-files/_img/4edf09fa0069566e7d3a95a7d7ff71541f4529dd330250488586687cf0eb61f1.webp)

Build a custom metric from scratch. Fill in the Identifier, Data Type, Prompt and, for an Enum metric, its Choices. See details below.

Use **Add Another** to create several metrics at once.

> **Note**
>
> Click **Save** when you're done, then **Publish** the agent. Calls use new or changed metrics only after the agent is published.

#### Templates

![Metric templates](/_fern-files/_img/f0cd1e7ed2593aec14c5bf3f096228467d3722c6298647537870ca6e922fd51f.webp)

Choose from pre-built metrics for common use cases. Just select the ones you want. No manual configuration needed.

> **Note**
>
> Click **Save** when you're done.

## Configuring a Metric

Each metric needs these fields:

| Field          | Required  | Description                                                                                  |
| -------------- | --------- | -------------------------------------------------------------------------------------------- |
| **Identifier** | Yes       | Unique name for this metric. Lowercase, numbers, underscores only.                           |
| **Data Type**  | Yes       | What kind of value: String, Boolean, Integer, Enum, or Datetime. See [Data Type](#data-type) |
| **Choices**    | Enum only | The values the AI can choose from. Up to 20, each unique.                                    |
| **Prompt**     | Yes       | The question you want answered about the call                                                |

### Identifier

This is the key used to reference the metric in exports, webhooks, and the API.

```
customer_satisfaction
call_outcome
follow_up_needed
```

> **Note**
>
> **Naming rules:** Lowercase letters, numbers, and underscores only. No spaces or special characters.

### Data Type

| Type         | Use for               | Example values                                                                                                                |
| ------------ | --------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
| **String**   | Free text, categories | "resolved", "escalated", "billing issue"                                                                                      |
| **Boolean**  | Yes/no questions      | true, false                                                                                                                   |
| **Integer**  | Whole numbers, scores | 1, 5, 10                                                                                                                      |
| **Enum**     | Fixed set of options  | One of: "low", "medium", "high". With [multiple selections](#multiple-selections) on, a list such as \["billing", "delivery"] |
| **Datetime** | Dates and times       | "2024-01-15T10:30:00Z"                                                                                                        |

### Multiple selections

An Enum metric picks one choice per call by default. To have it pick every choice that applies:

1. Open the agent and go to **Post call metrics**.
2. Click **Add metric**, or open the menu in an existing metric's **More** column and choose **Edit**.
3. Set **Data Type** to **Enum** and add up to 20 **Choices**.
4. Tick **Allow multiple selections** at the bottom of the form, then click **Save**.
5. Click **Publish**. Calls use the metric only once it's published on the live branch (see [Versioning](/voice-agents/build/versioning)).

![Enum metric form with four choices and Allow multiple selections ticked](/_fern-files/_img/620ec56a10a169088a9333c5572e880c776c04b285ebe2c3744345d8debe92b1.webp)

The checkbox shows only for **Enum** and is off by default, so existing metrics don't change. Saving the metric as another type turns it off.

In the metrics list, a multi-select metric shows as **Enum**. Open **Edit** to see whether the box is ticked.

Use it for questions with more than one true answer, such as which topics the customer raised. Write the prompt so it asks for every answer, for example "Select every topic the customer raised." With a vague prompt, the analyzer may add a related choice that doesn't apply.

A multi-select metric's value is always a list, even when only one choice applies:

| Situation             | Value                     |
| --------------------- | ------------------------- |
| Several choices apply | `["billing", "delivery"]` |
| One choice applies    | `["billing"]`             |
| No choice applies     | `null`                    |

Each entry is one of the metric's choices, spelled exactly as you wrote it, and appears once. Entries keep the order the analyzer returned them in, not the order of your choices. A choice that contains a comma, such as `Yes, please`, stays whole.

Where the value shows up:

| Where                                          | How it looks                                        |
| ---------------------------------------------- | --------------------------------------------------- |
| Call log API and `analytics-completed` webhook | A JSON list: `["billing", "delivery"]`              |
| Call details in the dashboard                  | Choices joined with commas: `billing, delivery`     |
| Campaign CSV export                            | Choices joined with semicolons: `billing; delivery` |

> **Warning**
>
> If your code reads metric values from webhooks or the API, handle a list for multi-select metrics. Turning the option off affects new calls only: earlier calls keep their lists.

### Prompt

This is the question the AI answers by analyzing the transcript. Be specific.

**Good prompts:**

* "Did the agent acknowledge and respond to customer concerns effectively?"
* "Rate customer satisfaction from 1 to 5 based on tone and words used."
* "What was the primary reason for this call? Options: billing, technical, account, other"

**Vague prompts to avoid:**

* "Was it good?"
* "Customer happy?"

> **Tip**
>
> **Start with 3-5 metrics.** Too many can slow analysis and clutter your data. Add more as you learn what insights matter most.

## Authoring rules & common failure patterns

Get any of these wrong and the PCA model's output for that metric fails validation. The metric is left empty for that call, and analytics for the call takes longer to complete. The five rules below cover most of the failure patterns we see in production.

### Enum outputs must be fully enumerated

Anything you ask the model to output has to exist in the choices list. If the prompt can lead the model to emit a value (including `null` or `"none"`) that isn't in the enum, validation fails.

If you want **"none"** or **"null"** to be a valid outcome, add it as an explicit choice.

### Never use skip / omit conditions on a metric

Conditions like *"Omit this metric if callback_requested is No"* cause the model to drop the field entirely, which fails validation and leaves the metric empty.

Keep the field always-present and use an explicit sentinel value instead. For example, *"Return NA if callback is not requested"* (with `NA` present in the enum).

### Datatype must match the prompt

An integer-typed metric must never be instructed to output a string.

**Common failure:** an integer `promised_amount` field with a fallback like *"output 'Not Applicable' if no amount was promised"*. The string fails the integer type check.

Use a valid in-type sentinel instead (or a nullable/allowed value that matches the declared type).

### Don't create dependencies between metrics

One metric should not depend on another (e.g. `lead_disposition` depending on `final_disposition`, or a score depending on a disposition).

Metrics are extracted independently, not sequentially like variables in code, so cross-references are unreliable.

### Fully specify any aggregation or weighting

If a rating is *"a weighted score"* across sub-metrics, define the weights explicitly (or state *"simple average"*).

## Example Metrics

#### Call Outcome

| Field          | Value                                                                                                         |
| -------------- | ------------------------------------------------------------------------------------------------------------- |
| **Identifier** | `call_outcome`                                                                                                |
| **Data Type**  | String                                                                                                        |
| **Prompt**     | "What was the outcome of this call? Options: resolved, escalated, transferred, abandoned, callback_scheduled" |

#### Satisfaction Score

| Field          | Value                                                                                                          |
| -------------- | -------------------------------------------------------------------------------------------------------------- |
| **Identifier** | `satisfaction_score`                                                                                           |
| **Data Type**  | Integer                                                                                                        |
| **Prompt**     | "Rate the customer's apparent satisfaction from 1 to 5, based on their tone and language throughout the call." |

#### Follow-Up Needed

| Field          | Value                                                        |
| -------------- | ------------------------------------------------------------ |
| **Identifier** | `follow_up_needed`                                           |
| **Data Type**  | Boolean                                                      |
| **Prompt**     | "Does this call require any follow-up action from the team?" |

#### Issue Category

| Field          | Value                                                                                                       |
| -------------- | ----------------------------------------------------------------------------------------------------------- |
| **Identifier** | `issue_category`                                                                                            |
| **Data Type**  | Enum                                                                                                        |
| **Prompt**     | "What was the primary issue category? Options: billing, technical, account, product_info, complaint, other" |

#### Call Topics

| Field          | Value                                                                |
| -------------- | -------------------------------------------------------------------- |
| **Identifier** | `call_topics`                                                        |
| **Data Type**  | Enum, with **Allow multiple selections** ticked                      |
| **Choices**    | billing, delivery, pricing, cancellation                             |
| **Prompt**     | "Which topics did the customer raise? Select every topic discussed." |

## Configuring via API

Post-call metrics are set through the **agent versioning** flow: edit a draft's config, publish it as a new version, and activate the version. There is no standalone post-call-analytics endpoint. Configuration lives on the agent's active version.

### Full flow

```python
import os
import requests

API_KEY = os.environ["SMALLEST_API_KEY"]
AGENT_ID = "YOUR_AGENT_ID"
BASE = "https://api.smallest.ai/atoms/v1"
HEADERS = {"Authorization": f"Bearer {API_KEY}", "Content-Type": "application/json"}

# 1. Get the currently active version
agent = requests.get(f"{BASE}/agent/{AGENT_ID}", headers=HEADERS).json()
active_version_id = agent["data"]["activeVersionId"]

# 2. Create a draft from that version
draft = requests.post(
    f"{BASE}/agent/{AGENT_ID}/drafts",
    headers=HEADERS,
    json={"sourceVersionId": active_version_id, "draftName": "post-call-metrics-update"},
).json()
draft_id = draft["data"]["draftId"]

# 3. Write your post-call metrics config onto the draft
requests.patch(
    f"{BASE}/agent/{AGENT_ID}/drafts/{draft_id}/config",
    headers=HEADERS,
    json={
        "postCallAnalyticsConfig": {
            "dispositionMetrics": [
                {
                    "identifier": "call_resolved",
                    "dispositionMetricPrompt": "Was the customer issue resolved by the end of the call?",
                    "dispositionMetricType": "BOOLEAN",
                },
                {
                    "identifier": "satisfaction_score",
                    "dispositionMetricPrompt": "Rate the customer satisfaction from 1 to 5",
                    "dispositionMetricType": "INTEGER",
                },
                {
                    "identifier": "call_outcome",
                    "dispositionMetricPrompt": "What was the outcome of the call?",
                    "dispositionMetricType": "ENUM",
                    "choices": ["resolved", "escalated", "callback_scheduled", "no_action"],
                },
                {
                    "identifier": "call_topics",
                    "dispositionMetricPrompt": "Which topics did the customer raise? Select every topic discussed.",
                    "dispositionMetricType": "ENUM",
                    "choices": ["billing", "delivery", "pricing", "cancellation"],
                    "allowMultiple": True,
                },
                {
                    "identifier": "summary",
                    "dispositionMetricPrompt": "Provide a brief summary of the call",
                    "dispositionMetricType": "STRING",
                },
            ],
            "useInternalAnalyticsModel": True,
            "useReasoningModel": False,
        }
    },
).raise_for_status()

# 4. Publish the draft as a new version and activate it
requests.post(
    f"{BASE}/agent/{AGENT_ID}/drafts/{draft_id}/publish",
    headers=HEADERS,
    json={"label": "Added post-call metrics", "activate": True},
).raise_for_status()
```

### Disposition metric schema

Each entry in `dispositionMetrics` takes these fields:

| Field                     | Required                 | Description                                                                                                                                                                     |
| ------------------------- | ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `identifier`              | Yes                      | Machine name. Lowercase letters, digits, and underscores only.                                                                                                                  |
| `dispositionMetricPrompt` | Yes                      | The question evaluated against the transcript.                                                                                                                                  |
| `dispositionMetricType`   | Yes                      | One of `STRING`, `BOOLEAN`, `INTEGER`, `ENUM`, `DATETIME`.                                                                                                                      |
| `choices`                 | Only when type is `ENUM` | Allowed values. Up to 20, each unique.                                                                                                                                          |
| `allowMultiple`           | No                       | `ENUM` only. `true` returns a list of every choice that applies (see [Multiple selections](#multiple-selections)). Default `false`. Setting it on any other type returns `400`. |

Two analytics flags apply globally:

| Field                       | Default | Description                                                                            |
| --------------------------- | ------- | -------------------------------------------------------------------------------------- |
| `useInternalAnalyticsModel` | `true`  | Use the internal analytics model. When `false`, the agent's own LLM evaluates metrics. |
| `useReasoningModel`         | `false` | Route evaluation through the reasoning model (higher quality, higher latency/cost).    |

### Reading current metrics

```bash
curl -H "Authorization: Bearer $SMALLEST_API_KEY" \
  "https://api.smallest.ai/atoms/v1/agent/$AGENT_ID" \
  | jq '.data._resolvedConfig.postCallAnalyticsConfig'
```

The active version's metrics are surfaced under `_resolvedConfig.postCallAnalyticsConfig`. Each entry round-trips exactly as sent: `identifier`, `dispositionMetricPrompt`, `dispositionMetricType`, `choices` (when the type is `ENUM`), and `allowMultiple` (when it is `true`).

## FAQ

#### Why are all the metrics empty on some calls?

Post-call analytics only runs when there is a user transcript to analyze. If the call was not answered, failed before connecting, or the user never spoke, the call is skipped. This is expected and not a configuration problem.

* **In the dashboard**, the Overview tab shows a fixed summary such as `Call was not answered.` For unanswered and failed calls the Metrics tab shows **No Analytics Available**. For calls where only the agent spoke, each metric is listed with a `null` value and the reason.
* **In the API and webhooks**, `summary` carries the fixed message and every `dispositionMetrics[].value` is `null`.

See [Calls with no analyzable transcript](#calls-with-no-analyzable-transcript) for the exact strings and how to filter these calls out.

#### Why is my post-call analysis missing / not showing up?

Post-call analytics runs after the call ends, so it takes a moment to populate. If a call finished cleanly and a specific metric stays empty, it is almost always a validation failure on that metric. Check the [authoring rules](#authoring-rules-common-failure-patterns). A mis-authored field (wrong datatype, missing enum value, skip condition, etc.) is left empty for the call.

#### Why does my agent hallucinate values on some calls?

Almost always one of the authoring patterns above. The most common causes:

* An enum that doesn't cover every value the model can produce.
* A metric prompt that asks the model to output a value in a type other than what's declared (e.g. a string fallback on an integer field).
* A "weighted score" or "aggregate" metric with no weights defined, so the model invents them.

Review the metric definition against the [authoring rules](#authoring-rules-common-failure-patterns).

#### Can one metric reference another?

No. Each metric is extracted independently, not sequentially. If `lead_disposition` depends on the value the model returned for `final_disposition`, the reference is unreliable. Encode any cross-metric logic inside the individual metric's prompt (using the transcript as the source of truth), not by referencing sibling metrics.

## Related

#### [Conversation Logs](/voice-agents/operate/conversation-logs)

View metrics for individual calls

#### [Analytics Dashboard](/voice-agents/operate/analytics)

See aggregated trends across calls