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

# Get detailed unanswered conversations

> Returns detailed information about open conversations without responses for the authenticated user's organization

## Overview

Get detailed information about open conversations that haven't received a response yet. This endpoint provides comprehensive filtering options and includes waiting time, assigned team members, pipeline/stage information, and more.

This is your go-to endpoint for building comprehensive support dashboards and monitoring unresponded conversations across your entire organization.

## Use Cases

* **Support Dashboard**: Display all conversations waiting for response
* **Team Assignment**: See which conversations need team member assignment
* **Pipeline Monitoring**: Track unanswered conversations by pipeline/stage
* **SLA Compliance**: Monitor response time SLAs
* **Workload Planning**: Understand current demand and bottlenecks
* **Performance Tracking**: Measure how quickly conversations are being handled

## Authentication

This endpoint requires authentication using an API key. Include your API key in the request header:

```
x-api-key: your_api_key_here
```

## Query Parameters

| Parameter        | Type      | Required | Description                                   |
| ---------------- | --------- | -------- | --------------------------------------------- |
| `page`           | number    | No       | Page number for pagination (default: 1)       |
| `agentIds`       | string\[] | No       | Filter by specific team member IDs            |
| `pipelineId`     | string    | No       | Filter by specific pipeline                   |
| `stageIds`       | string\[] | No       | Filter by specific stages                     |
| `hideArchived`   | boolean   | No       | Hide archived conversations (default: true)   |
| `hideUnassigned` | boolean   | No       | Hide unassigned conversations (default: true) |

## Response Structure

| Field         | Type    | Description                              |
| ------------- | ------- | ---------------------------------------- |
| `contacts`    | array   | Array of contact objects with details    |
| `hasNextPage` | boolean | Whether there are more pages available   |
| `nextPage`    | string  | Next page number (if available)          |
| `total`       | number  | Total number of unanswered conversations |

### Contact Object

| Field              | Type          | Description                           |
| ------------------ | ------------- | ------------------------------------- |
| `ai_contact_id`    | string (UUID) | Contact's unique identifier           |
| `name`             | string        | Contact's name                        |
| `current_stage`    | string        | Current pipeline stage name           |
| `current_pipeline` | string        | Current pipeline name                 |
| `waiting_time`     | number        | Time waiting in milliseconds          |
| `assigned_agents`  | array         | Array of assigned team member objects |

### Assigned Agent Object

| Field        | Type          | Description                     |
| ------------ | ------------- | ------------------------------- |
| `agent_id`   | string (UUID) | Team member's unique identifier |
| `agent_name` | string        | Team member's full name         |

## Example Requests

### Get All Unanswered Conversations

```bash theme={null}
curl --request GET \
  'https://api.vambe.me/api/analytics/team/snapshot/unanswered-conversations-details?page=1' \
  --header 'x-api-key: your_api_key_here'
```

### Filter by Pipeline

```bash theme={null}
curl --request GET \
  'https://api.vambe.me/api/analytics/team/snapshot/unanswered-conversations-details?page=1&pipelineId=550e8400-e29b-41d4-a716-446655440000' \
  --header 'x-api-key: your_api_key_here'
```

### Filter by Team Members

```bash theme={null}
curl --request GET \
  'https://api.vambe.me/api/analytics/team/snapshot/unanswered-conversations-details?page=1&agentIds=agent-1,agent-2' \
  --header 'x-api-key: your_api_key_here'
```

### Show Unassigned Only

```bash theme={null}
curl --request GET \
  'https://api.vambe.me/api/analytics/team/snapshot/unanswered-conversations-details?page=1&hideUnassigned=false' \
  --header 'x-api-key: your_api_key_here'
```

## Example Response

```json theme={null}
{
  "contacts": [
    {
      "ai_contact_id": "df980fc8-b6db-4820-bf22-2969482d106d",
      "name": "Maria Rodriguez",
      "current_stage": "Lead",
      "current_pipeline": "Sales Pipeline",
      "waiting_time": 3600000,
      "assigned_agents": [
        {
          "agent_id": "228d7a0d-9072-4ca8-939b-959b75cc606a",
          "agent_name": "John Doe"
        }
      ]
    },
    {
      "ai_contact_id": "880e8400-e29b-41d4-a716-446655440003",
      "name": "Carlos Silva",
      "current_stage": "Qualified",
      "current_pipeline": "Sales Pipeline",
      "waiting_time": 1800000,
      "assigned_agents": []
    }
  ],
  "hasNextPage": true,
  "nextPage": "2",
  "total": 42
}
```

## Common Use Cases

### 1. Display Unanswered Queue

```javascript theme={null}
const displayUnansweredQueue = async () => {
  const response = await fetch(
    'https://api.vambe.me/api/analytics/team/snapshot/unanswered-conversations-details?page=1',
    {
      headers: {
        'x-api-key': 'your_api_key_here',
      },
    },
  );

  const { contacts, total } = await response.json();

  console.log(`📋 Unanswered Conversations Queue (${total} total)\n`);

  contacts.forEach((contact, index) => {
    const waitMinutes = Math.floor(contact.waiting_time / 1000 / 60);
    const waitHours = Math.floor(waitMinutes / 60);
    const urgency = waitHours > 1 ? '🔴' : waitMinutes > 30 ? '🟡' : '🟢';

    console.log(`${urgency} ${index + 1}. ${contact.name}`);
    console.log(
      `   Waiting: ${waitHours > 0 ? `${waitHours}h ` : ''}${waitMinutes % 60}m`,
    );
    console.log(
      `   Pipeline: ${contact.current_pipeline} → ${contact.current_stage}`,
    );
    console.log(
      `   Assigned: ${contact.assigned_agents.length > 0 ? contact.assigned_agents.map((a) => a.agent_name).join(', ') : 'None'}\n`,
    );
  });

  return contacts;
};
```

### 2. Find Unassigned Conversations

```javascript theme={null}
const findUnassignedConversations = async () => {
  const response = await fetch(
    'https://api.vambe.me/api/analytics/team/snapshot/unanswered-conversations-details?page=1&hideUnassigned=false',
    {
      headers: {
        'x-api-key': 'your_api_key_here',
      },
    },
  );

  const { contacts } = await response.json();

  const unassigned = contacts.filter((c) => c.assigned_agents.length === 0);

  console.log(`Found ${unassigned.length} unassigned conversations`);

  return unassigned;
};
```

### 3. Monitor Specific Pipeline

```javascript theme={null}
const monitorSalesPipeline = async (salesPipelineId) => {
  const response = await fetch(
    `https://api.vambe.me/api/analytics/team/snapshot/unanswered-conversations-details?page=1&pipelineId=${salesPipelineId}`,
    {
      headers: {
        'x-api-key': 'your_api_key_here',
      },
    },
  );

  const { contacts, total } = await response.json();

  const byStage = contacts.reduce((acc, contact) => {
    const stage = contact.current_stage;
    if (!acc[stage]) acc[stage] = [];
    acc[stage].push(contact);
    return acc;
  }, {});

  console.log(`Sales Pipeline - ${total} unanswered conversations\n`);

  Object.entries(byStage).forEach(([stage, contacts]) => {
    console.log(`${stage}: ${contacts.length} conversations`);
  });

  return byStage;
};
```

### 4. Fetch All Pages

```javascript theme={null}
const getAllUnansweredConversations = async () => {
  let allContacts = [];
  let page = 1;
  let hasMore = true;

  while (hasMore) {
    const response = await fetch(
      `https://api.vambe.me/api/analytics/team/snapshot/unanswered-conversations-details?page=${page}`,
      {
        headers: {
          'x-api-key': 'your_api_key_here',
        },
      },
    );

    const data = await response.json();
    allContacts = allContacts.concat(data.contacts);
    hasMore = data.hasNextPage;
    page++;

    console.log(`Fetched page ${page - 1}, total: ${allContacts.length}`);
  }

  console.log(`Retrieved all ${allContacts.length} unanswered conversations`);
  return allContacts;
};
```

## Waiting Time

The `waiting_time` field is in **milliseconds**. To convert:

```javascript theme={null}
const millisToMinutes = (millis) => Math.floor(millis / 1000 / 60);
const millisToHours = (millis) => Math.floor(millis / 1000 / 60 / 60);

// Usage
contact.waiting_time = 3600000; // 1 hour
console.log(`${millisToMinutes(contact.waiting_time)} minutes`); // 60 minutes
console.log(`${millisToHours(contact.waiting_time)} hours`); // 1 hour
```

## Filter Behavior

* **`hideArchived: true`** (default): Excludes archived conversations
* **`hideUnassigned: true`** (default): Excludes conversations with no assigned team members
* **`agentIds`**: Shows only conversations assigned to specified team members
* **`pipelineId`**: Shows only conversations in specified pipeline
* **`stageIds`**: Shows only conversations in specified stages

## Error Responses

| Status Code | Description                                  |
| ----------- | -------------------------------------------- |
| 400         | Bad Request - Invalid parameters             |
| 401         | Unauthorized - Invalid or missing API key    |
| 500         | Internal Server Error - Something went wrong |

## Important Notes

* **Real-time Data**: Waiting times calculated at query time
* **Only Open Conversations**: Closed conversations excluded
* **Default Filters**: By default hides archived and unassigned
* **Milliseconds**: All time values in milliseconds
* **Sorted by Wait Time**: Longest waiting appears first

## Related Endpoints

* [GET /api/public/analytics/contacts/by-status](/reference/analytics/get-contacts-by-status) - Simpler alternative with status filter
* [GET /api/analytics/team/snapshot/agent-distribution](/reference/analytics/get-agent-distribution) - Current workload distribution
* [POST /api/public/contact/{aiContactId}/assign-team-member/{teamMemberId}](/reference/team-members/assign-team-member-to-contact) - Assign conversations

## Best Practices

### 1. Monitor Regularly

```javascript theme={null}
// Check every 5 minutes for long-waiting conversations
setInterval(
  async () => {
    const response = await fetch(
      'https://api.vambe.me/api/analytics/team/snapshot/unanswered-conversations-details?page=1',
      {
        headers: { 'x-api-key': 'your_api_key_here' },
      },
    );

    const { contacts } = await response.json();

    const urgent = contacts.filter((c) => c.waiting_time / 1000 / 60 > 30);

    if (urgent.length > 0) {
      console.warn(`⚠️ ${urgent.length} conversations waiting > 30 minutes`);
      // Send alert, auto-assign, etc.
    }
  },
  5 * 60 * 1000,
);
```

### 2. Use Filters Effectively

```javascript theme={null}
// Good: Filter by relevant criteria
const response = await fetch(
  'https://api.vambe.me/api/analytics/team/snapshot/unanswered-conversations-details?page=1&pipelineId=sales-id&hideArchived=true',
  { headers: { 'x-api-key': 'your_api_key_here' } },
);

// Avoid: Fetching everything without filters (can be slow)
```

### 3. Handle Pagination

```javascript theme={null}
// Good: Process pages incrementally
for (let page = 1; page <= 10; page++) {
  const data = await fetchPage(page);
  if (!data.hasNextPage) break;
  processBatch(data.contacts);
}

// Avoid: Fetching all pages at once (memory intensive)
```


## OpenAPI

````yaml get /api/analytics/team/snapshot/unanswered-conversations-details
openapi: 3.0.0
info:
  title: Vambe AI API
  description: Vambe AI documentation
  version: '1.0'
  contact: {}
servers:
  - url: https://api.vambe.me
    description: Production Server
security: []
tags:
  - name: Vambe AI
    description: ''
paths:
  /api/analytics/team/snapshot/unanswered-conversations-details:
    get:
      tags:
        - Team Analytics
      summary: Get detailed unanswered conversations
      description: >-
        Returns detailed information about open conversations without responses
        for the authenticated user's organization
      operationId: GetSnapshotTeamAnalyticsController_getUnansweredConversationsDetails
      parameters:
        - name: page
          required: false
          in: query
          description: 'Page number for pagination (default: 1)'
          schema:
            type: number
            example: 1
        - name: agentIds
          required: false
          in: query
          description: Optional array of agent IDs to filter by specific agents
          schema:
            example:
              - agent-id-1
              - agent-id-2
            type: array
            items:
              type: string
        - name: pipelineId
          required: false
          in: query
          description: Optional pipeline ID to filter by specific pipeline
          schema:
            example: pipeline-id-1
            type: string
        - name: stageIds
          required: false
          in: query
          description: Optional array of stage IDs to filter by specific stages
          schema:
            example:
              - stage-id-1
              - stage-id-2
            type: array
            items:
              type: string
        - name: hideArchived
          required: false
          in: query
          description: Optional boolean to filter by archived conversations
          schema:
            type: boolean
            example: true
        - name: hideUnassigned
          required: true
          in: query
          schema:
            type: boolean
        - name: x-api-key
          in: header
          description: API key
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successfully retrieved detailed unanswered conversations
          content:
            application/json:
              schema:
                type: object
                properties:
                  contacts:
                    type: array
                    items:
                      type: object
                      properties:
                        ai_contact_id:
                          type: string
                          description: ID of the AI contact
                          example: contact-123
                        current_stage:
                          type: string
                          description: Current stage name
                          example: Lead
                        current_pipeline:
                          type: string
                          description: Current pipeline name
                          example: Sales Pipeline
                        waiting_time:
                          type: number
                          description: Waiting time in milliseconds
                          example: 3600000
                        name:
                          type: string
                          description: Contact name
                          example: John Doe
                        assigned_agents:
                          type: array
                          items:
                            type: object
                            properties:
                              agent_id:
                                type: string
                                description: Agent ID
                                example: agent-123
                              agent_name:
                                type: string
                                description: Agent name
                                example: Jane Smith
                  hasNextPage:
                    type: boolean
                    description: Indicates if there are more pages
                    example: true
                  nextPage:
                    type: string
                    nullable: true
                    description: Next page number if available
                    example: '2'
                  total:
                    type: number
                    description: Total number of unanswered conversations
                    example: 100

````