---
title: "Get contacts by status"
method: GET
path: "/api/public/analytics/contacts/by-status"
tags: ["Analytics"]
---

# Get contacts by status

`GET /api/public/analytics/contacts/by-status`

Returns contacts filtered by status and calculates how long they have been waiting (from last_inbound_message.created_at until now). Adds a "waiting_time" field that represents (in seconds) how long that contact has been waiting. Sorted by waiting_time descending (longest wait first).

## Query parameters

- `page` string, required
- `orderBy` 'contact_created_at' | 'ticket_created_at' | 'last_inbound_message' | 'last_outbound_message' | 'id'
- `channel` 'whatsapp' | 'playground' | 'instagram' | 'webchat' | 'web-whatsapp' | 'messenger' | 'sms', required
- `pipelineId` string, required
- `status` 'unattended' | 'attended' | 'ai-attended' | 'ai-away', required

## Headers

- `x-api-key` string, required

## Response `200`

Returns contacts with pending responses

- object[]
  - `id` string — Contact ID
  - `name` string — Contact name
  - `created_at` string, date-time — Contact creation date

---

[API](https://skmtc.net/vambe/apis/vambe-ai-api.md) · [All operations](https://skmtc.net/vambe/apis/vambe-ai-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/vambe/vambe-ai-api/revisions/e206709d4be5/schema)
