Analytics API paging behavior with pageSize and pageNumber

Why does this setting return incomplete results when using pageSize and pageNumber in the Analytics API? I am querying /api/v2/analytics/conversations/summary with pageSize=100 and pageNumber=2, but the response pageCount remains 1 despite having more data. The JSON payload shows nextPageToken is null. Is this a known issue with date range filters? Thanks for the help.

You need to abandon pageNumber for analytics endpoints; they use token-based pagination exclusively. The pageCount metadata is often inaccurate or static in summary queries, so relying on it breaks iteration. The correct pattern is to fetch the first page, extract the nextPageToken from the response header or body, and pass that token in subsequent requests until it becomes null. This ensures you traverse the entire dataset without gaps. The SDK handles this logic internally if you use the iterator methods, but for raw HTTP calls, you must manually chain the tokens.

import { PureCloudPlatformClientV2 } from '@genesyscloud/purecloud-platform-client-v2';

const api = new PureCloudPlatformClientV2.AnalyticsApi();
let token: string | undefined = undefined;
let allResults = [];

do {
 const response = await api.getAnalyticsConversationsSummary({
 pageSize: 100,
 pageToken: token, // Crucial: use pageToken, not pageNumber
 startDate: '2023-01-01T00:00:00Z',
 endDate: '2023-01-02T00:00:00Z'
 });
 
 if (response.body?.entities) {
 allResults = [...allResults, ...response.body.entities];
 }
 token = response.body?.nextPageToken;
} while (token);

See the official pagination docs here: https://developer.genesys.cloud/api/rest/v2/pagination

The root cause here is the mismatch between the pagination model you are using and the actual implementation of the Analytics Summary API. The endpoint /api/v2/analytics/conversations/summary does not support offset-based pagination via pageNumber and pageSize in the way traditional CRUD endpoints do. Instead, it relies exclusively on opaque page tokens for navigation. When you send pageNumber=2 without a valid nextPageToken from a prior request, the API resets to the first page or returns a partial view, resulting in pageCount appearing static and nextPageToken being null.

To fix this, you must iterate using the token returned in the response body. Here is the correct request pattern:

curl -X GET "https://api.mypurecloud.com/api/v2/analytics/conversations/summary" \
 -H "Authorization: Bearer <token>" \
 -H "Content-Type: application/json" \
 -d '{
 "dateRange": "now-7d..now",
 "pageSize": 100,
 "nextPageToken": null 
 }'

Extract nextPageToken from the JSON response and pass it in the next request until it is null.

  • Token-based pagination logic
  • Analytics API date range constraints
  • SDK wrapper methods for summary queries

The documentation actually says “page-based pagination is not supported for summary queries.” I ran into this last week in my C# integration. You can’t just increment the page number like you do with users or queues. The Analytics API uses opaque tokens only.

Here’s how I handle it with the .NET SDK:

var analyticsApi = new AnalyticsApi(platformClient);
var body = new ConversationSummaryQuery() { DateRange = new DateRange("2023-01-01", "2023-01-31") };
var result = await analyticsApi.PostAnalyticsConversationsSummary(body);

while (!string.IsNullOrEmpty(result.NextPageToken))
{
 result = await analyticsApi.PostAnalyticsConversationsSummary(body, nextPageToken: result.NextPageToken);
 // Process result.Entities here
}

Stop using pageNumber. It’s ignored. The token tells the server exactly where to resume. See this internal note: https://genesys.cloud/support/analytics-paging-tokens. It’s annoying because the docs for UsersApi look totally different, but analytics is strict. You’ll get null tokens if you try to cheat the system.