> ## 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 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).



## OpenAPI

````yaml /openapi.json get /api/public/analytics/contacts/by-status
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/public/analytics/contacts/by-status:
    get:
      tags:
        - Analytics
      summary: Get contacts by status
      description: >-
        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).
      operationId: AnalyticsPublicController_getContactsWithUnattendedTickets
      parameters:
        - name: page
          required: true
          in: query
          description: Page number
          schema:
            example: '1'
            type: string
        - name: orderBy
          required: false
          in: query
          schema:
            enum:
              - contact_created_at
              - ticket_created_at
              - last_inbound_message
              - last_outbound_message
              - id
            type: string
        - name: channel
          required: true
          in: query
          schema:
            enum:
              - whatsapp
              - playground
              - instagram
              - webchat
              - web-whatsapp
              - messenger
              - sms
            type: string
        - name: pipelineId
          required: true
          in: query
          description: Pipeline ID
          schema:
            example: '1234567890'
            type: string
        - name: status
          required: true
          in: query
          description: Status
          schema:
            enum:
              - unattended
              - attended
              - ai-attended
              - ai-away
            type: string
        - name: x-api-key
          in: header
          description: API key
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Returns contacts with pending responses
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      type: string
                      description: Contact ID
                    name:
                      type: string
                      description: Contact name
                    created_at:
                      type: string
                      format: date-time
                      description: Contact creation date

````