GET /api/analytics/users/{userId} Returns the notification history and delivery metrics for a specific user, showing which notifications were delivered, viewed, and clicked.

Headers

appid
string
required
Your CometChat App ID.
apikey
string
required
Your CometChat API Key.

Path parameters

userId
string
required
The user ID to retrieve insights for.

Example request

curl https://{appId}.api-{region}.cometchat.io/v3/business-messaging/api/analytics/users/user-jane-123 \
  -H "appid: YOUR_APP_ID" \
  -H "apikey: YOUR_API_KEY"

Example response

{
  "userId": "user-jane-123",
  "summary": {
    "delivered": 45,
    "viewed": 30,
    "clicked": 12
  },
  "notifications": [
    {
      "notificationId": "notif_abc123",
      "templateName": "Order Confirmation",
      "channelType": "in_app",
      "delivered": true,
      "viewed": true,
      "clicked": true,
      "deliveredAt": "2024-01-15T09:30:00.000Z",
      "viewedAt": "2024-01-15T09:35:00.000Z",
      "clickedAt": "2024-01-15T09:36:00.000Z"
    }
  ]
}

Response fields

userId
string
The queried user ID.
summary
object
Aggregate counts of delivered, viewed, and clicked events for this user.
notifications
object[]
Array of notification records with delivery status and timestamps.
notifications[].notificationId
string
The notification identifier.
notifications[].templateName
string
Template used for the notification.
notifications[].channelType
string
Channel through which the notification was delivered.
notifications[].delivered
boolean
Whether the notification was delivered.
notifications[].viewed
boolean
Whether the notification was viewed.
notifications[].clicked
boolean
Whether the notification was clicked.