Skip to main content
GET
/
api
/
analytics
/
team
/
snapshot
/
unanswered-conversations-details
Get detailed unanswered conversations
curl --request GET \
  --url https://api.vambe.me/api/analytics/team/snapshot/unanswered-conversations-details \
  --header 'x-api-key: <x-api-key>'
{
  "contacts": [
    {
      "ai_contact_id": "contact-123",
      "current_stage": "Lead",
      "current_pipeline": "Sales Pipeline",
      "waiting_time": 3600000,
      "name": "John Doe",
      "assigned_agents": [
        {
          "agent_id": "agent-123",
          "agent_name": "Jane Smith"
        }
      ]
    }
  ],
  "hasNextPage": true,
  "nextPage": "2",
  "total": 100
}

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

ParameterTypeRequiredDescription
pagenumberNoPage number for pagination (default: 1)
agentIdsstring[]NoFilter by specific team member IDs
pipelineIdstringNoFilter by specific pipeline
stageIdsstring[]NoFilter by specific stages
hideArchivedbooleanNoHide archived conversations (default: true)
hideUnassignedbooleanNoHide unassigned conversations (default: true)

Response Structure

FieldTypeDescription
contactsarrayArray of contact objects with details
hasNextPagebooleanWhether there are more pages available
nextPagestringNext page number (if available)
totalnumberTotal number of unanswered conversations

Contact Object

FieldTypeDescription
ai_contact_idstring (UUID)Contact’s unique identifier
namestringContact’s name
current_stagestringCurrent pipeline stage name
current_pipelinestringCurrent pipeline name
waiting_timenumberTime waiting in milliseconds
assigned_agentsarrayArray of assigned team member objects

Assigned Agent Object

FieldTypeDescription
agent_idstring (UUID)Team member’s unique identifier
agent_namestringTeam member’s full name

Example Requests

Get All Unanswered Conversations

curl --request GET \
  'https://api.vambe.ai/api/analytics/team/snapshot/unanswered-conversations-details?page=1' \
  --header 'x-api-key: your_api_key_here'

Filter by Pipeline

curl --request GET \
  'https://api.vambe.ai/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

curl --request GET \
  'https://api.vambe.ai/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

curl --request GET \
  'https://api.vambe.ai/api/analytics/team/snapshot/unanswered-conversations-details?page=1&hideUnassigned=false' \
  --header 'x-api-key: your_api_key_here'

Example Response

{
  "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

const displayUnansweredQueue = async () => {
  const response = await fetch(
    'https://api.vambe.ai/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

const findUnassignedConversations = async () => {
  const response = await fetch(
    'https://api.vambe.ai/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

const monitorSalesPipeline = async (salesPipelineId) => {
  const response = await fetch(
    `https://api.vambe.ai/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

const getAllUnansweredConversations = async () => {
  let allContacts = [];
  let page = 1;
  let hasMore = true;

  while (hasMore) {
    const response = await fetch(
      `https://api.vambe.ai/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:
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 CodeDescription
400Bad Request - Invalid parameters
401Unauthorized - Invalid or missing API key
500Internal 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

Best Practices

1. Monitor Regularly

// Check every 5 minutes for long-waiting conversations
setInterval(
  async () => {
    const response = await fetch(
      'https://api.vambe.ai/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

// Good: Filter by relevant criteria
const response = await fetch(
  'https://api.vambe.ai/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

// 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)

Headers

x-api-key
string
required

API key

Query Parameters

page
number

Page number for pagination (default: 1)

Example:

1

agentIds
string[]

Optional array of agent IDs to filter by specific agents

Example:
["agent-id-1", "agent-id-2"]
pipelineId
string

Optional pipeline ID to filter by specific pipeline

Example:

"pipeline-id-1"

stageIds
string[]

Optional array of stage IDs to filter by specific stages

Example:
["stage-id-1", "stage-id-2"]
hideArchived
boolean

Optional boolean to filter by archived conversations

Example:

true

hideUnassigned
boolean
required

Response

200 - application/json

Successfully retrieved detailed unanswered conversations

contacts
object[]
hasNextPage
boolean

Indicates if there are more pages

Example:

true

nextPage
string | null

Next page number if available

Example:

"2"

total
number

Total number of unanswered conversations

Example:

100