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

# Get aggregated contact metrics

> Return aggregated contact counts bucketed by the categories configured for the org/pipeline (e.g. "New", "Working", "Closed"), with contacted/never-contacted splits. Scope is derived from the caller's role (own contacts / department / whole org).



## OpenAPI

````yaml /api-reference/openapi.yaml get /api/contact-metrics/contact
openapi: 3.0.3
info:
  title: Tether Relay and Tether API
  version: 1.0.0
  description: >-
    Route-derived OpenAPI contract generated from tether-relay backend sources.
    Regenerate with scripts/sync-openapi-from-backend.mjs.
servers:
  - url: https://your-instance.example.com
    description: Production
  - url: http://localhost:2212
    description: Local API service
security: []
tags:
  - name: AI
  - name: Applications
  - name: Approval
  - name: Auth
  - name: Automations
  - name: Calls
  - name: Campaigns
  - name: Contact Analytics
  - name: Contact Metrics
  - name: Contact Notes
  - name: Contacts
  - name: Conversation Monitor
  - name: Conversations
  - name: Departments
  - name: Email
  - name: Escalation Dashboard
  - name: Event Logs
  - name: Google Sheets
  - name: Marketplace
  - name: Messages
  - name: Notification Sounds
  - name: Notifications
  - name: Org Snapshots
  - name: Organizations
  - name: Outreach
  - name: Outreach Metrics
  - name: Outreach Sources
  - name: Pipelines
  - name: Processes
  - name: Prompts
  - name: Reminders
  - name: Sms
  - name: Templates
  - name: Traces
  - name: Training
  - name: Upload
  - name: User Snapshots
  - name: Users
  - name: Vertical
  - name: Webchats
  - name: Webhook
paths:
  /api/contact-metrics/contact:
    get:
      tags:
        - Contact Metrics
      summary: Get aggregated contact metrics
      description: >-
        Return aggregated contact counts bucketed by the categories configured
        for the org/pipeline (e.g. "New", "Working", "Closed"), with
        contacted/never-contacted splits. Scope is derived from the caller's
        role (own contacts / department / whole org).
      operationId: get_contact_metrics
      parameters:
        - in: query
          name: startDate
          required: false
          schema:
            type: string
            format: date-time
        - in: query
          name: endDate
          required: false
          schema:
            type: string
            format: date-time
        - in: query
          name: pipelineId
          required: false
          schema:
            type: string
      responses:
        '200':
          description: Contact metrics returned
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContactMetricsSummaryResponse'
        '400':
          description: Invalid pipeline ID
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContactMetricsErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContactMetricsErrorResponse'
      security:
        - bearerAuth: []
components:
  schemas:
    ContactMetricsSummaryResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        data:
          type: object
          properties:
            scope:
              type: string
              description: >-
                Frontend label: "All Organization" | "Department Contacts" |
                "Your Contacts".
            total:
              type: integer
            contacted:
              type: integer
            neverContacted:
              type: integer
            categories:
              type: object
              description: Keyed by category `key`.
              additionalProperties:
                $ref: '#/components/schemas/ContactMetricsCategoryBucket'
            uncategorized:
              $ref: '#/components/schemas/ContactMetricsUncategorizedBucket'
            pipelineId:
              type: string
              nullable: true
            pipelineName:
              type: string
              nullable: true
          additionalProperties: true
      required:
        - success
        - data
      additionalProperties: true
      example:
        success: true
        data:
          scope: Your Contacts
          total: 124
          contacted: 91
          neverContacted: 33
          categories:
            new:
              name: New
              count: 22
              contacted: 0
              neverContacted: 22
              color: '#3B82F6'
            working:
              name: Working
              count: 47
              contacted: 38
              neverContacted: 9
              color: '#10B981'
            closed:
              name: Closed
              count: 43
              contacted: 43
              neverContacted: 0
              color: '#6B7280'
          uncategorized:
            count: 12
            contacted: 10
            neverContacted: 2
          pipelineId: 66f0a0b0c0d0e0f0a0b0c0d0
          pipelineName: Sales pipeline
    ContactMetricsErrorResponse:
      type: object
      description: >-
        Error envelope returned by contact-metrics endpoints. Errors are
        returned as `{ error: <message> }`.
      properties:
        error:
          type: string
      additionalProperties: true
      example:
        error: Invalid pipeline ID
    ContactMetricsCategoryBucket:
      type: object
      description: Per-category counts in the summary response.
      properties:
        name:
          type: string
        count:
          type: integer
        contacted:
          type: integer
        neverContacted:
          type: integer
        color:
          type: string
      additionalProperties: true
      example:
        name: Working
        count: 47
        contacted: 38
        neverContacted: 9
        color: '#10B981'
    ContactMetricsUncategorizedBucket:
      type: object
      properties:
        count:
          type: integer
        contacted:
          type: integer
        neverContacted:
          type: integer
      additionalProperties: true
      example:
        count: 12
        contacted: 4
        neverContacted: 8
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````