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

# Get Conversation Statistics

> Get call outcome, disposition code, and full transcript for one conversation

**What it does:** Returns everything about **one call** — whether the phone connected, the business outcome code, and the full transcript.

**You need:** A `conversationId` from [Get Conversation Logs](https://docs.gnani.ai/Platform/Get_Conversation_Logs.md) or a post-call webhook (`conversation_id`). After [Trigger Call](https://docs.gnani.ai/Platform/Trigger_Call.md), poll Logs with your `clientReferenceId` to find the `conversationId`.

## Required Permission

`conversations`

## Path Parameters

| Name | Required | Description |
| - | - | - |
| `conversationId` | Yes | From Logs or webhook. Not returned directly by Trigger Call. |

## Minimum working example

```bash theme={null}
curl "https://api.inya.ai/platform/v1/conversations/1786433682702486082/stats" \
  -H "x-api-key: <your_api_key>"
```

## The three fields developers ask about

Calls produce three different kinds of outcome data. They answer different questions:

| Field | Plain English | Example | Use it for |
| - | - | - | - |
| **`callStatus`** | Did the phone connect? | `"ANSWERED"`, `"NO ANSWER"` | Telephony dashboards — was the call picked up? |
| **`overallCallDisposition`** | What was the **business result**? Short code. | `"PTP"`, `"RNR"`, `"DSCN"` | CRM updates, campaign reports, filtering |
| **`callSummary.disposition`** | LLM-written label in plain language. **May be `null`.** | `"resolved"`, `"escalated"` | Human-readable summaries for QA review |
| **`utteranceAnalytics`** | What was **actually said**, turn by turn. | `[{ role, content, timestamp, … }]` | Transcripts, compliance, debugging |

```text theme={null}
Call ends
   │
   ├─ callStatus              → "Did they pick up?"          (telephony)
   ├─ overallCallDisposition  → "What happened commercially?" (short code — PTP, RNR…)
   ├─ callSummary.disposition → "How would an LLM describe it?" (optional, may be null)
   └─ utteranceAnalytics      → "What was said word for word?"  (full transcript)
```

### `overallCallDisposition` — what is it?

A **short outcome code** assigned after the call, based on your agent's disposition configuration. It is **not** a sentence — it is a token you map in your CRM and reporting pipeline.

## Disposition codes

Standard `overallCallDisposition` values:

| Code | Meaning |
| - | - |
| `PTP` | Promise to Pay |
| `RTP` | Refused to Pay |
| `AP` | Already Paid |
| `CLBK` | Callback Requested |
| `WRNG` | Wrong Number |
| `DSCN` | Call Disconnected |
| `RNR` | No Answer |
| `DND` | Do Not Disturb |

> [!TIP]
>
> Your agent's disposition prompt may produce additional codes beyond this list. Treat unknown values as opaque strings and log them for mapping. The same code appears as `STAGE_CODE` and inside `disposition_result` in post-call webhooks (snake\_case) — see [Update Agent — Post-call webhook](https://docs.gnani.ai/Platform/Update_Agent.md#post-call-webhook).

### `callSummary` — what is it?

An optional LLM-generated wrapper. When present, `callSummary.disposition` gives a human-readable label (e.g. `"resolved"`). When analytics have not finished processing, **`callSummary` is `null`** — this is normal on recent calls.

Use `overallCallDisposition` for programmatic logic. Use `callSummary.disposition` only when you need a readable label and the object is present.

### `utteranceAnalytics` — what is it?

The full conversation transcript as an array of turns. Each entry has:

| Sub-field | On | Description |
| - | - | - |
| `role` | All turns | `"assistant"` or `"user"` |
| `content` | All turns | What was spoken |
| `timestamp` | All turns | Unix timestamp (seconds, may include fractions) |
| `detectedLanguage` | User turns | Language detected — e.g. `"english"` |
| `totalResults` | User turns | Transcript in each configured language |
| `userInterruptionFlag` | User turns | Whether the user interrupted the agent |

Same shape as `transcript` in Logs, but Stats always returns the complete record.

> [!NOTE]
>
> Post-call webhooks deliver the same data in **snake\_case** (`conversation_id`, `detected_language`, `STAGE_CODE`). See [Update Agent — Post-call webhook](https://docs.gnani.ai/Platform/Update_Agent.md#post-call-webhook) for the webhook payload and field mapping.

## Response

### Success (200)

Verified example:

```json theme={null}
{
  "status": "success",
  "message": "Conversation details fetched successfully",
  "response": [
    {
      "userId": "29be0f97-51c6-49aa-a515-e0433649e69d",
      "bot": "fbec81f5c97c4a62b0103e87f53c0d56",
      "botName": "Muthoot-sanity_outbound_",
      "conversationId": "1786433682702486082",
      "startTime": 1786433683,
      "endTime": 1786433770,
      "callStatus": "ANSWERED",
      "callDuration": 81,
      "overallCallDisposition": "PTP",
      "utteranceAnalytics": [
        {
          "role": "assistant",
          "content": "Hi,shyam1234 how are you doing just want to known did you pay the EMI due amount?",
          "timestamp": 1786433683.312441
        },
        {
          "role": "user",
          "content": "how much is my due amount",
          "timestamp": 1786433699.931499,
          "totalResults": {
            "en-IN": "how much is my due amount",
            "hi-IN": "हाउ मच इज़ माइ ड्यू अमाउंट"
          },
          "detectedLanguage": "english",
          "userInterruptionFlag": false
        },
        {
          "role": "assistant",
          "content": "Hello, am I speaking with Nani?",
          "timestamp": 1786433700.549843
        },
        {
          "role": "user",
          "content": "yes you are",
          "timestamp": 1786433705.403072,
          "totalResults": {
            "en-IN": "yes you are",
            "hi-IN": "येस शुर"
          },
          "detectedLanguage": "english",
          "userInterruptionFlag": false
        },
        {
          "role": "assistant",
          "content": "I'm Viraj calling from Muthoot Capital. I'm just calling to check in with you. Your loan payment of [due_amount] was due on [due_date], and we noticed it hasn't come through yet. I wanted to understand if there was any delay or difficulty from your side?",
          "timestamp": 1786433706.562911
        },
        {
          "role": "user",
          "content": "actually i will be paying it today",
          "timestamp": 1786433722.501854,
          "totalResults": {
            "en-IN": "actually i will be paying it today",
            "hi-IN": "अक्चवली आई विल बी पेइंग इट टुडे"
          },
          "detectedLanguage": "english",
          "userInterruptionFlag": false
        },
        {
          "role": "assistant",
          "content": "That is great to hear. Just to check, was there any specific reason for the delay this time?",
          "timestamp": 1786433723.086668
        },
        {
          "role": "user",
          "content": "my salary got delayed",
          "timestamp": 1786433734.365692,
          "totalResults": {
            "en-IN": "my salary got delayed",
            "hi-IN": "माय सैलरी गॉट डिलेड"
          },
          "detectedLanguage": "english",
          "userInterruptionFlag": false
        },
        {
          "role": "assistant",
          "content": "I understand. Salary delays can happen sometimes. Thank you for letting me know. Just to keep you informed, When a payment is missed, It may have a small impact on your credit score. Also, As per the loan terms, Late payment charges may be applied. That is why we reach out early, So you can avoid any extra charges.",
          "timestamp": 1786433735.428127
        },
        {
          "role": "user",
          "content": "okay thank you for that bye",
          "timestamp": 1786433757.258117,
          "totalResults": {
            "en-IN": "okay thank you for that bye",
            "hi-IN": "ओके थैंक यू फॉर दैट बाई"
          },
          "detectedLanguage": "english",
          "userInterruptionFlag": false
        },
        {
          "role": "assistant",
          "content": "Since you mentioned you will be paying today, I will just make a small note of it. Thank you for your time, Nani. If you need any assistance, Please feel free to reach out. Have a good day. Thank you, Have a nice day.",
          "timestamp": 1786433761.166623
        }
      ],
      "botId": "fbec81f5c97c4a62b0103e87f53c0d56"
    }
  ],
  "requestId": "ed1c4163-8841-4316-9b27-68f20296537c"
}
```

> [!NOTE]
>
> `callSummary`, `averageAgentLatency`, `callProcessed`, and `lastProcessedOn` are not shown above because they are populated asynchronously and may be absent on recent calls. When present:
>
> ```json theme={null}
> "callSummary": { "disposition": "resolved" },
> "averageAgentLatency": 1.2,
> "callProcessed": true,
> "lastProcessedOn": "2026-08-11T10:30:00Z"
> ```

## All response fields

| Field | Type | Description |
| - | - | - |
| `conversationId` | string | Unique call identifier. |
| `botId` | string | Agent that handled this call. |
| `botName` | string | Agent display name. |
| `callDuration` | number | Length in seconds. `0` when the call was not answered. |
| `startTime` / `endTime` | number | Unix timestamps (seconds). |
| `callStatus` | string | Telephony outcome — `ANSWERED`, `NO ANSWER`, etc. |
| `overallCallDisposition` | string | Business outcome code — see [Disposition codes](#disposition-codes). |
| `callSummary` | object \| null | LLM summary. `null` until analytics finish. |
| `callSummary.disposition` | string | Human-readable LLM label when present. |
| `utteranceAnalytics` | array | Full turn-by-turn transcript. |
| `averageAgentLatency` | number \| null | Mean agent response time in seconds. May be absent. |
| `callProcessed` | boolean \| null | `true` when analytics pipeline finished. May be absent. |
| `lastProcessedOn` | string \| null | ISO 8601 timestamp of last analytics run. |

## Edge cases

| Scenario | What happens |
| - | - |
| Call just ended | `overallCallDisposition` and `utteranceAnalytics` available; `callSummary` may still be `null` |
| Call not answered | `callStatus: "NO ANSWER"`, `callDuration: 0`, disposition often `RNR` |
| Analytics still running | Retry after 30–60 seconds, or use post-call webhook for immediate push |
| `averageAgentLatency` above 2s | Often indicates LLM or TTS settings worth tuning |

## Errors

**403 Forbidden**

```json theme={null}
{
  "status": "failure",
  "requestId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "message": "User does not have access to this conversation"
}
```

**404 Not Found**

```json theme={null}
{
  "status": "failure",
  "requestId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "message": "Conversation not found"
}
```

> [!NOTE]
>
> Save the `requestId` from every response. You will need it if you contact Gnani support to trace a specific request.


## OpenAPI

````yaml GET /v1/conversations/{conversationId}/stats
openapi: 3.0.3
info:
  title: Platform Agents API
  description: API endpoints for creating, managing, and interacting with voice agents
  version: 2.1.0
servers:
  - url: https://api.inya.ai/platform
    description: Production server
security:
  - ApiKeyAuth: []
tags:
  - name: Agents
    description: Agent management operations
  - name: AgentFAQ
    description: Agent FAQ management
  - name: AgentCallTriggers
    description: Outbound call triggers
  - name: ChatSDK
    description: Chat Widget configuration
  - name: Conversations
    description: Conversation logs, statistics, and audio
paths:
  /v1/conversations/{conversationId}/stats:
    get:
      tags:
        - Conversations
      summary: Get Conversation Statistics
      description: >-
        Retrieve detailed performance statistics and analytics for a specific
        conversation.
      operationId: getConversationStats
      parameters:
        - name: conversationId
          in: path
          required: true
          schema:
            type: string
          description: Unique identifier of the conversation.
      responses:
        '200':
          description: Conversation statistics retrieved successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: success
                  requestId:
                    type: string
                  message:
                    type: string
                    example: Conversation details fetched successfully
                  response:
                    type: array
                    items:
                      type: object
                      properties:
                        conversationId:
                          type: string
                        botId:
                          type: string
                          example: fb79920229d144608ebf665a10e50275
                        botName:
                          type: string
                          example: Support Agent
                        callDuration:
                          type: integer
                        startTime:
                          type: integer
                        endTime:
                          type: integer
                        callStatus:
                          type: string
                          example: ANSWERED
                        callSummary:
                          type: object
                          nullable: true
                          properties:
                            disposition:
                              type: string
                              example: resolved
                        utteranceAnalytics:
                          type: array
                          description: Full turn-by-turn transcript for the call.
                          items:
                            $ref: '#/components/schemas/UtteranceTurn'
                        overallCallDisposition:
                          type: string
                          description: Short business outcome code assigned after the call.
                          example: PTP
                        averageAgentLatency:
                          type: number
                        callProcessed:
                          type: boolean
                        lastProcessedOn:
                          type: string
                          format: date-time
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      security:
        - ConversationsApiKeyAuth: []
components:
  schemas:
    UtteranceTurn:
      type: object
      description: A single turn in a conversation transcript.
      properties:
        role:
          type: string
          enum:
            - assistant
            - user
          example: user
        content:
          type: string
          example: how much is my due amount
        timestamp:
          type: number
          example: 1786433699.931499
        detectedLanguage:
          type: string
          description: Present on user turns.
          example: english
        totalResults:
          type: object
          additionalProperties:
            type: string
          description: Transcript in each configured language. Present on user turns.
          example:
            en-IN: how much is my due amount
            hi-IN: हाउ मच इज़ माइ ड्यू अमाउंट
        userInterruptionFlag:
          type: boolean
          description: Present on user turns.
          example: false
    ErrorResponse:
      type: object
      properties:
        status:
          type: string
          example: failure
        requestId:
          type: string
          example: a1b2c3d4-e5f6-7890-abcd-ef1234567890
        message:
          type: string
  responses:
    Forbidden:
      description: Permission denied
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    ServerError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: API key with 'agents' permission
    ConversationsApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: API key with 'conversations' permission

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.