> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ouraicalling.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Post-call analysis

> Automatically score sentiment, success, and extract structured data from every call

After a call ends, an **LLM judge** reads the transcript and evaluates it against the assistant's analysis configuration. It can rate the caller's sentiment, decide whether the call met a success criterion, and pull out structured fields (a callback number, an order ID, a yes/no answer). The result is stored on the call and is available in the history filters, the public API, and MCP.

## What it produces

For each analyzed call the judge writes a result with:

* **Sentiment** — `positive`, `neutral`, or `negative` (overall caller sentiment).
* **Success** — `true` / `false` (or `null` when success evaluation is off), plus a short **reason** explaining the verdict.
* **Data** — a map of the structured fields you defined, keyed by field name.
* **Model** and **analyzed\_at** — which judge model ran, and when.

Sentiment and success are also stored as **denormalized columns** on the call so you can filter large call lists quickly (in the history view and via `GET /calls?sentiment=&success=`).

<Note>
  Analysis runs **after** the call and never affects the live conversation. If the judge fails or returns unusable output, the call is untouched — a `analysis_failed` call event is recorded and nothing is written to the call's analysis.
</Note>

## Configuring an assistant

Open the assistant's **Analysis** card and turn on the parts you need. Everything is optional; an empty configuration means no analysis runs.

<Steps>
  <Step title="Sentiment">
    Enabled by default. Turn it off if you don't need per-call sentiment.
  </Step>

  <Step title="Success criterion">
    Enable **Success** and describe, in plain language, what a successful call looks like — e.g. *"The caller booked an appointment"* or *"The caller confirmed their delivery address."* The judge returns a boolean plus a reason.
  </Step>

  <Step title="Structured fields">
    Add fields to extract. Each field has a `name` (snake\_case, unique), a `type` (`string`, `number`, `boolean`, or `enum`), a `description` telling the judge what to pull (max. 500 characters), an optional `required` flag, and — for `enum` — a list of `choices`.
  </Step>
</Steps>

### Example configuration

```json theme={null}
{
  "sentiment": true,
  "success": {
    "enabled": true,
    "criteria": "The caller booked an appointment"
  },
  "fields": [
    { "name": "callback_number", "type": "string", "description": "Phone number the caller wants a callback on" },
    { "name": "appointment_day", "type": "enum", "description": "Requested weekday", "choices": ["mon", "tue", "wed", "thu", "fri"] },
    { "name": "is_existing_customer", "type": "boolean", "description": "Whether the caller is already a customer", "required": true }
  ]
}
```

A resulting `calls.analysis` looks like:

```json theme={null}
{
  "sentiment": "positive",
  "success": true,
  "success_reason": "Caller agreed to a Tuesday appointment and gave a callback number.",
  "data": {
    "callback_number": "+493012345678",
    "appointment_day": "tue",
    "is_existing_customer": false
  },
  "model": "gpt-...",
  "analyzed_at": "2026-07-05T09:12:44Z"
}
```

## Using the results

* **History filters** — filter the call list by sentiment and success to find, say, all negative calls that did *not* succeed.
* **Public API** — every call in `GET /calls` and `GET /calls/{id}` carries `analysis`, `sentiment`, and `success`. Filter the list with `?sentiment=negative` and `?success=false`.
* **MCP** — the same call fields are exposed through the MCP `list_calls` / `get_call` tools.

## Configuring via the API

`analysis_config` is a writable assistant field, so you can manage it programmatically:

```bash theme={null}
curl -X PATCH https://app.famulor.io/api/v1/assistants/{id} \
  -H "Authorization: Bearer fam_..." \
  -H "Content-Type: application/json" \
  -d '{
    "analysis_config": {
      "sentiment": true,
      "success": { "enabled": true, "criteria": "The caller booked an appointment" },
      "fields": [
        { "name": "callback_number", "type": "string", "description": "Callback number" }
      ]
    }
  }'
```

See the [API reference](/api-reference/introduction) (`PATCH /assistants/{id}` and the `AnalysisConfig` schema) for the full field contract.
