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

# Retrieve Analysis

> Retrieve analysis results

Retrieve a queued or completed analysis by ID. Paths use the plural **`/v1/analyses`** segment.

## Path Parameters

<ParamField path="id" type="string" required>
  The analysis identifier returned from [`POST /v1/sessions/{session_id}/analysis`](/api-reference/analysis/create) (prefix `anl_`).
</ParamField>

## Response

<ResponseField name="id" type="string">
  Analysis identifier.
</ResponseField>

<ResponseField name="object" type="string">
  Always `analysis`.
</ResponseField>

<ResponseField name="session_id" type="string">
  Session analyzed.
</ResponseField>

<ResponseField name="call_id" type="string">
  Linked call id when available.
</ResponseField>

<ResponseField name="profile" type="string">
  Analysis profile supplied at creation (default `default`).
</ResponseField>

<ResponseField name="status" type="string">
  `processing`, `completed`, or `failed`.
</ResponseField>

<ResponseField name="summary" type="string">
  Natural-language summary when analysis finished successfully.
</ResponseField>

<ResponseField name="sentiment" type="object">
  Optional condensed sentiment summaries.

  <Expandable title="sentiment properties">
    <ResponseField name="customer" type="string">
      Short summary for the customer channel.
    </ResponseField>

    <ResponseField name="agent" type="string">
      Short summary for the agent channel.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="compliance" type="object">
  Optional compliance rollup.

  <Expandable title="compliance properties">
    <ResponseField name="status" type="string">
      Overall compliance status string.
    </ResponseField>

    <ResponseField name="flags" type="array">
      Machine-readable compliance flags.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="performance" type="object">
  Optional quality summary.

  <Expandable title="performance properties">
    <ResponseField name="score" type="number">
      Aggregate performance score when available.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="error" type="string">
  Plain-text failure explanation when `status` is `failed`.
</ResponseField>

<ResponseField name="created_at" type="string">
  Creation time (ISO 8601).
</ResponseField>

<ResponseField name="completed_at" type="string">
  Completion time (ISO 8601) once finished.
</ResponseField>

## Request Examples

```bash cURL theme={null}
curl https://api.kallglot.com/v1/analyses/anl_01HDEF456789012 \
  -H "Authorization: Bearer sk_live_your_api_key"
```

```javascript Node.js theme={null}
const response = await fetch('https://api.kallglot.com/v1/analyses/anl_01HDEF456789012', {
  headers: { Authorization: 'Bearer sk_live_your_api_key' }
});

const analysis = await response.json();

if (analysis.status === 'completed') {
  console.log(analysis.summary);
  console.log(analysis.sentiment);
}
```

```python Python theme={null}
import requests

response = requests.get(
    'https://api.kallglot.com/v1/analyses/anl_01HDEF456789012',
    headers={'Authorization': 'Bearer sk_live_your_api_key'},
)
analysis = response.json()

if analysis['status'] == 'completed':
    print(analysis.get('summary'))
    print(analysis.get('sentiment'))
```

## Response Examples

<ResponseExample>
  ```json 200 Completed theme={null}
  {
    "id": "anl_01HDEF456789012",
    "object": "analysis",
    "session_id": "sess_01HXYZ123456789",
    "call_id": null,
    "profile": "default",
    "status": "completed",
    "summary": "Customer checked order status; agent confirmed the new ship date.",
    "sentiment": {
      "customer": "Neutral, slightly anxious early; satisfied after confirmation.",
      "agent": "Calm and solution-oriented throughout."
    },
    "compliance": {
      "status": "ok",
      "flags": []
    },
    "performance": {
      "score": 0.86
    },
    "error": null,
    "created_at": "2026-03-26T11:10:00Z",
    "completed_at": "2026-03-26T11:10:22Z"
  }
  ```

  ```json 200 Processing theme={null}
  {
    "id": "anl_01HDEF456789012",
    "object": "analysis",
    "session_id": "sess_01HXYZ123456789",
    "call_id": null,
    "profile": "default",
    "status": "processing",
    "summary": null,
    "sentiment": null,
    "compliance": null,
    "performance": null,
    "error": null,
    "created_at": "2026-03-26T11:10:00Z",
    "completed_at": null
  }
  ```

  ```json 200 Failed theme={null}
  {
    "id": "anl_01HDEF456789012",
    "object": "analysis",
    "session_id": "sess_01HXYZ123456789",
    "call_id": null,
    "profile": "default",
    "status": "failed",
    "summary": null,
    "sentiment": null,
    "compliance": null,
    "performance": null,
    "error": "Analysis could not be completed from the available transcript",
    "created_at": "2026-03-26T11:10:00Z",
    "completed_at": "2026-03-26T11:10:25Z"
  }
  ```

  ```json 404 theme={null}
  {
    "error": {
      "type": "not_found_error",
      "code": "analysis_not_found",
      "message": "Analysis ... not found",
      "param": "analysis_id"
    }
  }
  ```
</ResponseExample>

## Polling

Poll `GET /v1/analyses/{id}` until `status` moves to **`completed`** or **`failed`**:

```javascript theme={null}
async function waitForAnalysis(analysisId, maxWaitMs = 120000) {
  const deadline = Date.now() + maxWaitMs;

  while (Date.now() < deadline) {
    const response = await fetch(`https://api.kallglot.com/v1/analyses/${analysisId}`, {
      headers: { Authorization: 'Bearer sk_live_your_api_key' }
    });
    const analysis = await response.json();

    if (analysis.status === 'completed') {
      return analysis;
    }
    if (analysis.status === 'failed') {
      throw new Error(analysis.error || 'Analysis failed');
    }
    await new Promise(resolve => setTimeout(resolve, 2000));
  }

  throw new Error('Analysis polling timed out');
}
```

## Retention

<Note>
  Poll only until the object reaches a terminal state, then **persist** anything you need in your systems. Long-lived storage is your responsibility; use [webhooks](/webhooks/overview) when you want push delivery.
</Note>
