# getTeamAnalyticsOverview

Team performance (SEVEN_DAYS | FOURTEEN_DAYS | THIRTY_DAYS | YEAR_TO_DATE; default THIRTY_DAYS): totals, deltas, per-agent rows. NIGHTLY as of asOfDate, never today; say which numbers are nightly and which live (getTeamCallStats, countOutboundTexts). filterContacts awaitingReply: unanswered texts/emails. avgSpeedToFirst{Call,Message}Minutes: minutes from a lead being ASSIGNED to the member to their first call / text or email.

- Call: `POST https://server.goliathdata.com/api/v1/call` with `{ "operationId": "getTeamAnalyticsOverview", "variables": {...} }`
- Scope: `ADMIN`
- Type: query
- Idempotency: a read; rejects `Idempotency-Key`
- Rate-limited: yes

## Variables

- `period`: `AgentAnalyticsPeriod` (default `THIRTY_DAYS`, one of `SEVEN_DAYS`, `FOURTEEN_DAYS`, `THIRTY_DAYS`, `SIXTY_DAYS`, `THIS_MONTH`, `YEAR_TO_DATE`)

## Response (data, an example)

```json
{
  "teamAnalyticsQuery": {
    "agentTeamOverview": {
      "asOfDate": "…",
      "period": "SEVEN_DAYS",
      "reportingPeriod": "…",
      "startDate": "…",
      "endDate": "…",
      "summary": {
        "agentCount": 0,
        "calls": 0,
        "completedCalls": 0,
        "conversationCalls": 0,
        "callsDeltaPct": 0,
        "texts": 0,
        "textsDeltaPct": 0,
        "emails": 0,
        "emailsDeltaPct": 0,
        "tasks": 0,
        "tasksDeltaPct": 0,
        "appointments": 0,
        "appointmentsDeltaPct": 0,
        "newLeads": 0,
        "newLeadsDeltaPct": 0,
        "notActedOnCount": 0,
        "activeLeadsCount": 0,
        "warmLeadsCount": 0,
        "coolingLeadsCount": 0,
        "coldLeadsCount": 0,
        "deadLeadsCount": 0
      },
      "agents": [
        {
          "userId": "<ID>",
          "userName": "…",
          "userEmail": "…",
          "calls": 0,
          "texts": 0,
          "emails": 0,
          "tasks": 0,
          "appointments": 0,
          "newLeads": 0,
          "notActedOnCount": 0,
          "avgSpeedToFirstCallMinutes": 0,
          "avgSpeedToFirstMessageMinutes": 0,
          "activeLeadsCount": 0,
          "warmLeadsCount": 0,
          "coolingLeadsCount": 0,
          "coldLeadsCount": 0,
          "deadLeadsCount": 0,
          "score": 0,
          "conversationRate": 0
        }
      ],
      "pipelineExposure": [
        {
          "pipelineId": "<ID>",
          "pipelineName": "…",
          "userId": "<ID>",
          "userName": "…",
          "wonDealsCount": 0,
          "lostDealsCount": 0,
          "commissionEarnedCents": 0
        }
      ]
    }
  }
}
```

## Example

```bash
curl https://server.goliathdata.com/api/v1/call \
  -H "Authorization: Bearer $GOLIATH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "operationId": "getTeamAnalyticsOverview",
    "variables": {}
  }'
```
