# Analytics

Inbox analytics. Ranges are ISO dates, default to the last 30 days (90 for inbox activity) and cannot exceed 2 years. These bodies are `{ "data": ... }` rather than the inbox envelope the other modules return.

Version: 1.0.0
License: Proprietary

## Servers

Production
```
https://uinboxpub.api.iclosed.io
```

## Security

### bearerAuth

API key required in Authorization header. Format: `iclosed_<token>`

Type: http
Scheme: bearer
Bearer Format: API key

### oauth2

OAuth 2.1 authorization code with PKCE. Tokens are issued by the iClosed authorization server and accepted by the Unified Inbox API.

Type: oauth2
Authorization URL: https://app.iclosed.io/oauth/authorize
Token URL: https://public.api.iclosed.io/v1/oauth/token
Scopes:
- `inbox.chats:read`: Read inbox chats
- `inbox.chats:write`: Create, update and assign inbox chats
- `inbox.messages:read`: Read inbox messages
- `inbox.messages:write`: Send and retry inbox messages
- `inbox.connections:read`: Read channel connections
- `inbox.analytics:read`: Read inbox analytics
- `inbox.recordings:read`: Read call recordings
- `inbox.recordings:write`: Generate call recording summaries
- `inbox.workflows:read`: Read inbox workflows

## Download OpenAPI description

 - [Analytics](https://developer.iclosed.io/_bundle/openapi/uinbox/v1/modules/analytics.yaml)

 - [GET /v1/analytics/overview](https://developer.iclosed.io/openapi/uinbox/v1/modules/analytics/other/getanalyticsoverview.md): Headline inbox totals for the range. metrics holds messagesSent, messagesReceived and activeChats, and range echoes the raw from and to you sent (null when omitted). from and to are optional ISO dates
 - [GET /v1/analytics/kpiSummary](https://developer.iclosed.io/openapi/uinbox/v1/modules/analytics/other/getkpisummary.md): The inbox KPI tiles for the range. Each card carries key, label, value, changePercent against the previous window of the same length, direction, isFavorable and trend. Time KPIs are whole seconds. fro
 - [GET /v1/analytics/channelBreakdown](https://developer.iclosed.io/openapi/uinbox/v1/modules/analytics/other/getchannelbreakdown.md): One row per channel for the range, so WhatsApp, SMS, email and the rest can be compared side by side. from and to are optional ISO dates; omitting them uses the last 30 days ending now. from must not
 - [GET /v1/analytics/userPerformance](https://developer.iclosed.io/openapi/uinbox/v1/modules/analytics/other/getuserperformance.md): One row per user for the range with userName, conversations, messagesSent, avgResponseTime and callsBooked, plus a summary footer. Outbound with no sender is reported as a synthetic isDirect row, and
 - [GET /v1/analytics/inboxActivity](https://developer.iclosed.io/openapi/uinbox/v1/modules/analytics/other/getinboxactivity.md): A time series of inbox activity over the range. Each bucket breaks down into CONVERSATION_STARTED, MESSAGES_RECEIVED, MESSAGES_SENT and CALLS_BOOKED, which sum to TOTAL. granularity is day, week, mont
 - [GET /v1/analytics/firstResponseTime](https://developer.iclosed.io/openapi/uinbox/v1/modules/analytics/other/getfirstresponsetime.md): The mean gap from a lead's first inbound message to the team's first reply, across conversations created in the range. Returned as whole seconds in averageFirstResponseSeconds and as a readable durati
 - [GET /v1/analytics/inboxConversionFunnel](https://developer.iclosed.io/openapi/uinbox/v1/modules/analytics/other/getoutboundfunnel.md): Conversion stages for conversations the account started: contacts in the range, conversations whose first message was outbound, leads that replied, and calls booked. from and to are optional ISO dates
 - [GET /v1/analytics/inboxConversionFunnelInbound](https://developer.iclosed.io/openapi/uinbox/v1/modules/analytics/other/getinboundfunnel.md): The same funnel for conversations the lead started: contacts in the range, conversations whose first message was inbound, team replies, and calls booked. from and to are optional ISO dates; omitting t
