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

# Get project conversation analytics

> Retrieve voice conversation analytics for a project

Returns project-level **voice conversation** analytics: totals, average duration, and daily conversation/duration maps.

Non-voice projects may return empty metrics.

## Authentication

<ParamField header="X-API-Key" type="string" required>
  Project API key for this organization and project. Format: `bot_live_…`
</ParamField>

## Path parameters

<ParamField path="organization_id" type="string" required>
  Organization ID. Must match the API key.
</ParamField>

<ParamField path="project_id" type="string" required>
  Project ID. Must match the API key.
</ParamField>

## Query parameters

<ParamField query="filters" type="string">
  JSON MongoDB-compatible filter object. Example: `{"status":"completed","start_time":{"$gte":"2026-07-01T00:00:00Z","$lte":"2026-07-22T23:59:59Z"}}`.
</ParamField>

<ParamField query="skip" type="integer" default="0">
  Accepted for compatibility. Aggregation returns summary series (not a paged conversation list).
</ParamField>

<ParamField query="limit" type="integer" default="20">
  Accepted for compatibility (`1`–`1000`). Not applied to the summary aggregation.
</ParamField>

<ParamField query="sort" type="string">
  Accepted for compatibility. Not applied to the summary aggregation.
</ParamField>

## Response

<ResponseField name="summary" type="object" required>
  Aggregate totals for the filtered conversations.

  <Expandable title="properties">
    <ResponseField name="total_conversations" type="integer" required>
      Total conversations matched.
    </ResponseField>

    <ResponseField name="completed_conversations" type="integer" required>
      Conversations with status `completed`.
    </ResponseField>

    <ResponseField name="live_conversations" type="integer" required>
      Conversations with status `live`.
    </ResponseField>

    <ResponseField name="total_duration" type="number" required>
      Sum of `duration_seconds`.
    </ResponseField>

    <ResponseField name="avg_duration" type="number" required>
      Average duration in seconds.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="daily_conversations" type="object" required>
  Map of date bucket key → conversation count.
</ResponseField>

<ResponseField name="daily_durations" type="object" required>
  Map of date bucket key → total duration seconds.
</ResponseField>

## Errors

<ResponseField name="400" type="Bad Request">
  Invalid organization or project id.
</ResponseField>

<ResponseField name="401" type="Unauthorized">
  Missing, invalid, or revoked API key.
</ResponseField>

<ResponseField name="403" type="Forbidden">
  API key is not authorized for this organization or project.
</ResponseField>

<ResponseField name="404" type="Not Found">
  Project not found.
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -G "https://backend.botcadence.com/organizations/ORG_ID/projects/PROJECT_ID/conversation-analytics" \
    -H "X-API-Key: bot_live_YOUR_KEY" \
    --data-urlencode 'filters={"status":"completed","start_time":{"$gte":"2026-07-01T00:00:00Z","$lte":"2026-07-22T23:59:59Z"}}'
  ```

  ```javascript JavaScript theme={null}
  const params = new URLSearchParams({
    filters: JSON.stringify({
      status: "completed",
      start_time: {
        $gte: "2026-07-01T00:00:00Z",
        $lte: "2026-07-22T23:59:59Z",
      },
    }),
  });

  const response = await fetch(
    `https://backend.botcadence.com/organizations/${organizationId}/projects/${projectId}/conversation-analytics?${params}`,
    { headers: { "X-API-Key": process.env.BOTCADENCE_API_KEY } }
  );
  ```

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

  response = requests.get(
      f"https://backend.botcadence.com/organizations/{organization_id}/projects/{project_id}/conversation-analytics",
      headers={"X-API-Key": os.environ["BOTCADENCE_API_KEY"]},
      params={
          "filters": json.dumps(
              {
                  "status": "completed",
                  "start_time": {
                      "$gte": "2026-07-01T00:00:00Z",
                      "$lte": "2026-07-22T23:59:59Z",
                  },
              }
          )
      },
  )
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "status": "success",
    "message": "Conversation analytics retrieved successfully",
    "data": {
      "summary": {
        "total_conversations": 64,
        "completed_conversations": 41,
        "live_conversations": 1,
        "total_duration": 8120.25,
        "avg_duration": 126.88
      },
      "daily_conversations": {
        "2026-07-01": 5,
        "2026-07-02": 9
      },
      "daily_durations": {
        "2026-07-01": 640.0,
        "2026-07-02": 1102.5
      }
    },
    "status_code": 200
  }
  ```

  ```json 404 theme={null}
  {
    "status": "error",
    "message": "Project not found",
    "data": null,
    "status_code": 404
  }
  ```
</ResponseExample>
