# call.analyzed

Sent once per call, after the call has ended, Miraven has processed it, and its recording is ready.

Source: https://www.miraven.com/developers/webhooks/call-analyzed · Updated 2026-11-11

## Payload

```json
{
  "id": "evt_2b7c41e09f6a4b1d8f3e5a7c9d0b1e2f",
  "type": "call.analyzed",
  "created_at": "2026-11-03T19:12:04.000Z",
  "data": {
    "call_id": "6f1d2c3b-8a9e-4f70-b1c2-d3e4f5a6b7c8",
    "agent_id": "39d63614-2b1a-4c5d-9e8f-7a6b5c4d3e2f",
    "caller_phone": "+15551234567",
    "called_phone": "+15557654321",
    "forwarded_from": "+15553334444",
    "funeral_home_phone": "+15553334444",
    "started_at": "2026-11-03T19:05:22.000Z",
    "ended_at": "2026-11-03T19:11:40.000Z",
    "duration_seconds": 378,
    "recording": {
      "url": "https://app.miraven.com/api/recordings/6f1d2c3b-8a9e-4f70-b1c2-d3e4f5a6b7c8?exp=1777835524&sig=EXAMPLE",
      "content_type": "audio/wav",
      "expires_at": "2027-05-04T19:12:04.000Z"
    }
  }
}
```

**data attributes**

- `call_id` (string): Miraven’s ID for the call. Unique and never changes.
- `agent_id` (string): The funeral home agent that answered. Use it to tell funeral homes apart.
- `caller_phone` (string, E.164, or null): The number the call came from. Null when the caller blocked their caller ID.
- `called_phone` (string, E.164): The Miraven number that answered the call.
- `forwarded_from` (string, E.164, or null): The number the caller dialed before the call was forwarded to Miraven, when the phone carrier passes it along. A funeral home with several locations can forward each one, so this tells you which location was called. Null when the carrier didn’t say, which doesn’t mean the caller dialed Miraven directly.
- `funeral_home_phone` (string, E.164, or null): The funeral home’s main number from its Miraven settings, or null if none is set. To get the funeral home number for a call, use forwarded_from when it’s set and this otherwise.
- `started_at` (string, ISO 8601): When the call started, in UTC.
- `ended_at` (string, ISO 8601): When the call ended, in UTC.
- `duration_seconds` (integer): How long the call lasted, in whole seconds.
- `recording` (object): The call’s audio. See [Recordings](https://www.miraven.com/developers/webhooks/call-analyzed#recordings).
  - `url` (string): A link to download the recording. No login or headers needed.
  - `content_type` (string): The file format: `audio/wav`.
  - `expires_at` (string, ISO 8601): When the link stops working, in UTC.

## Value formats

| Type | Format | Example |
| --- | --- | --- |
| ID | A UUID. Compare IDs as whole strings; don’t parse them. | `"8a1d1f6e-3c2b-4e7a-9f10-2b6c4d5e7f80"` |
| Phone number | E.164: a `+`, the country code, then the number, with no spaces or punctuation. | `"+15551234567"` |
| Time | ISO 8601 in UTC, to the millisecond. | `"2026-11-03T19:05:22.000Z"` |
| Duration | A whole number of seconds. | `378` |
| Unknown | Fields marked “or null” are always present, and `null` when Miraven doesn’t know the value. They’re never left out. | `null` |

## Phone numbers

Most funeral homes forward their own number to Miraven, so a call involves up to three of the funeral home’s numbers. Each field holds one of them, and never a guess. In these examples the funeral home’s Miraven number is `+15557654321`, its main number is `+15553334444`, and its second location is `+15553336666`.

| What happened | forwarded_from | funeral_home_phone |
| --- | --- | --- |
| A family calls the main number, and the phone carrier forwards it to Miraven. | `+15553334444` | `+15553334444` |
| A family calls the second location, which also forwards to Miraven. | `+15553336666` | `+15553334444` |
| The call is forwarded, but the carrier or phone system doesn’t say from where. This is common when a business phone system forwards the call. | `null` | `+15553334444` |
| A family dials the Miraven number directly, for example from a website that lists it. | `null` | `+15553334444` |
| The funeral home has no main number saved in Miraven. | `+15553334444` | `null` |

In every case, `called_phone` is `+15557654321` and `caller_phone` is the family’s number, or `null` if they blocked their caller ID.

A `null` `forwarded_from` doesn’t tell you whether the call was forwarded: some carriers never pass it on. To show which funeral home number a family called, use `forwarded_from`, and `funeral_home_phone` when it’s `null`. To tell funeral homes apart, use `agent_id`, which stays the same whichever number was called.

## Which calls are sent

One event per call the agent answers, except:

- calls with no recording, like a caller hanging up before the agent answered;
- calls Miraven filtered as spam or robocalls;
- calls deleted before they were sent.

## Recordings

|   |   |
| --- | --- |
| Format | Two-channel WAV. Channel 1 is the caller and channel 2 is the funeral home’s side. Transcribing each channel separately gives the best accuracy. |
| Download | A plain `GET` to `recording.url`. |
| Expiry | About 6 months, until `recording.expires_at`, or sooner if the funeral home deletes the call. |

curl:

```shell
curl -L -o call.wav \
  "https://app.miraven.com/api/recordings/6f1d2c3b-8a9e-4f70-b1c2-d3e4f5a6b7c8?exp=1777835524&sig=…"
```

Node.js:

```javascript
import { createWriteStream } from "node:fs";
import { Readable } from "node:stream";
import { pipeline } from "node:stream/promises";

const { call_id, recording } = event.data;
const response = await fetch(recording.url);
if (!response.ok) throw new Error(`Recording download failed: ${response.status}`);
await pipeline(Readable.fromWeb(response.body), createWriteStream(`${call_id}.wav`));
```

Python:

```python
import requests

data = event["data"]
with requests.get(data["recording"]["url"], stream=True, timeout=60) as response:
    response.raise_for_status()
    with open(f"{data['call_id']}.wav", "wb") as file:
        for chunk in response.iter_content(chunk_size=1 << 20):
            file.write(chunk)
```

> **Treat links like the recordings themselves**
>
> Anyone with a link can download the recording until it expires. Don’t log links or share them outside your own systems.

## See also

- [Webhooks](https://www.miraven.com/developers/webhooks): Set up an endpoint, handle events, and how delivery works.
- [The event object](https://www.miraven.com/developers/webhooks/events): The envelope every event shares, and every event type.
- [Verify webhook signatures](https://www.miraven.com/developers/webhooks/verifying-signatures): Check that each request came from Miraven.
