Analytics Conversations Aggregates API: Date range mismatch in custom interval reports

We are building a custom interval report using the Genesys Cloud Analytics Conversations Aggregates API. The goal is to fetch conversation metrics for our Sao Paulo support team in 15-minute intervals. We want to feed this data directly into New Relic custom events to correlate agent performance with infrastructure latency.

The issue is that the returned data points don’t align with the requested time window. We are sending a POST request to /api/v2/analytics/conversations/queries with the following payload:

{
 "timePeriod": {
 "startDate": "2023-10-27T14:00:00.000Z",
 "endDate": "2023-10-27T14:30:00.000Z"
 },
 "groupBy": ["interval"],
 "interval": "15 minutes",
 "select": ["talk.duration.sum"],
 "where": [
 {
 "name": "team.id",
 "op": "equals",
 "value": "abc-123-def"
 }
 ]
}

The API returns a 200 OK with data, but the timePeriod in the response starts at 14:00:00 and the intervals are shifted. The first data point covers 14:00-14:15, but the values seem to be from the previous day or are completely empty. We’ve verified the team.id is correct.

We are using the Python SDK version 12.3.0. The code looks like this:

from purecloudplatform.client import AnalyticsApi

api_instance = AnalyticsApi()
query = AnalyticsQuery(
 time_period=TimePeriod(startDate="2023-10-27T14:00:00.000Z", endDate="2023-10-27T14:30:00.000Z"),
 group_by=["interval"],
 interval="15 minutes"
)
result = api_instance.post_analytics_conversations_queries(body=query)

Is there a timezone conversion happening internally that we aren’t accounting for? The documentation says the time period is in UTC, but our org settings are set to America/Sao_Paulo. We’ve tried converting the start/end dates to local time, but that makes the data even more scattered. The intervals seem to jump around randomly.

We need precise interval alignment for the NRQL dashboards. Any ideas on how to force the API to respect the exact UTC boundaries?