Genesys API: /api/v2/analytics/conversations/details/query pagination strategy

We are building a Terraform module to export conversation details, but the documentation is ambiguous regarding pagination. The endpoint supports both page and cursor parameters. We observed that using the page-based approach occasionally results in duplicate records when data changes during the export window.

Is there a recommended pattern for handling this drift? We currently increment the page number until nextPage is null, but the cursor mechanism seems more solid for large datasets. Has anyone implemented a reliable loop for this in Python?

Cursor-based pagination is the only safe bet here, especially with high-velocity data. You’ll need to track the nextPage cursor from the response and pass it back in the subsequent request to avoid duplicates entirely.