Contact Metrics

Get metrics breakdown by user (Admin only)

GET
/api/contact-metrics/by-user

ADMIN/SUPERADMIN-only - return the org metrics broken down by owning user, with the same category buckets the summary endpoint reports. Used by the leaderboard / per-rep activity reports.

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Query Parameters

startDate?string
Formatdate-time
endDate?string
Formatdate-time
pipelineId?string

Response Body

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/api/contact-metrics/by-user"
{  "success": true,  "data": {    "users": [      {        "userId": "65b1f0a2c3d4e5f6a7b8c9d0",        "userName": "Alice Rivera",        "userEmail": "alice@example.com",        "total": 47,        "contacted": 38,        "neverContacted": 9,        "categories": {          "new": {            "total": 22,            "contacted": 0,            "neverContacted": 22          },          "working": {            "total": 25,            "contacted": 25,            "neverContacted": 0          }        },        "uncategorized": {          "total": 0,          "contacted": 0,          "neverContacted": 0        }      }    ],    "categories": [      {        "key": "new",        "name": "New",        "color": "#3B82F6"      },      {        "key": "working",        "name": "Working",        "color": "#10B981"      }    ],    "pipelineId": "66f0a0b0c0d0e0f0a0b0c0d0",    "pipelineName": "Sales pipeline"  }}