Analytics details query: Cursor pagination not advancing with SDK

Why is the cursor not updating when I paginate through /api/v2/analytics/conversations/details/query?

I’m using the JS SDK (@genesyscloud/analytics-client). The first request returns data and a nextPageCursor, but passing that cursor back in the subsequent request just returns the exact same page of results. It’s an infinite loop of the first 100 records.

const client = new AnalyticsClient(config);

const res1 = await client.apiV2AnalyticsConversationsDetailsQuery.postQuery(
 'conversations/details/summary',
 {
 dateFrom: '2024-01-01T00:00:00.000Z',
 dateTo: '2024-01-02T00:00:00.000Z',
 pageSize: 100
 }
);

const cursor = res1.body.nextPageCursor;

// Second call
const res2 = await client.apiV2AnalyticsConversationsDetailsQuery.postQuery(
 'conversations/details/summary',
 {
 dateFrom: '2024-01-01T00:00:00.000Z',
 dateTo: '2024-01-02T00:00:00.000Z',
 pageSize: 100,
 cursor: cursor
 }
);

The res2.body.nextPageCursor is identical to res1.body.nextPageCursor. If I switch to page and pageSize based pagination, it works fine, but that’s deprecated behavior according to the docs. The raw JSON response from the first call includes the cursor string correctly.

Is the SDK stripping the cursor on subsequent requests or is the backend ignoring it for this specific analytics type? Checked the network tab, the payload looks correct. No 4xx or 5xx errors. Just stale data.

You’re likely reusing the same query object instead of updating the cursor property before each call. The SDK doesn’t auto-increment it. Set query.cursor = res1.nextPageCursor explicitly. Check the docs.