POST /api/analytics/rollup Trigger a rollup computation that aggregates raw analytics events into summary metrics for the specified date range. Use this to refresh analytics data after recording events.

Headers

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

Request body

from
string
required
Start date in ISO 8601 format.
to
string
required
End date in ISO 8601 format.

Example request

curl -X POST https://{appId}.api-{region}.cometchat.io/v3/business-messaging/api/analytics/rollup \
  -H "appid: YOUR_APP_ID" \
  -H "apikey: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "from": "2024-01-01T00:00:00Z",
    "to": "2024-01-31T23:59:59Z"
  }'

Example response

{
  "success": true,
  "from": "2024-01-01T00:00:00.000Z",
  "to": "2024-01-31T23:59:59.000Z",
  "eventsProcessed": 45000
}

Response fields

success
boolean
Whether the rollup computation completed.
from
string
Start of the computed date range.
to
string
End of the computed date range.
eventsProcessed
integer
Number of raw events aggregated during the rollup.
Run a rollup after bulk event recording to ensure analytics endpoints return up-to-date metrics. Rollups are idempotent and safe to run multiple times for the same date range.