Analytics API returning null wrapUpCode despite valid interaction data

Hey everyone,

I’m running into a weird issue with the Genesys Cloud Analytics API. I’ve got a Python script pulling detail records for our support queue, but the wrapUpCode field is coming back as null even though I can see the codes in the UI.

Here’s the query I’m sending to /api/v2/analytics/interactions/details/query:

{
 "dateFrom": "2023-10-01T00:00:00.000Z",
 "dateTo": "2023-10-02T00:00:00.000Z",
 "queryFilters": [
 {
 "type": "equal",
 "field": "queue.id",
 "value": "my-queue-id"
 }
 ],
 "groupings": [
 {
 "type": "field",
 "field": "wrapUpCode.id"
 }
 ]
}

The API returns a 200 OK, but every record has wrapUpCode: null. I tried adding wrapUpCode.name to the groupings too, no luck. I checked the raw interaction data via the Conversations API for one of these IDs, and the wrap-up code is definitely there.

Is this a known limitation with the Analytics API, or am I missing a parameter? I’ve been staring at the docs for hours.

Thanks!

Docs state: “The wrapUpCode field is available in interaction detail records for voice, chat, and email interactions.” You’re getting null because you’re likely hitting a data latency window or filtering on a metric that excludes wrap-up codes by default in the aggregation layer, but since you’re using the details endpoint, it’s usually a scope or date range issue.

Check your access token scopes. You need analytics:interaction:view and interaction:read. If you’re using client credentials, ensure the service account has access to the specific organization unit where those interactions occurred. Analytics data isn’t always globally visible if OU permissions are strict.

Also, verify the select clause. If you’re not explicitly selecting wrapUpCode, some clients default to a limited set. Try this payload:

{
 "dateFrom": "2023-10-01T00:00:00.000Z",
 "dateTo": "2023-10-02T00:00:00.000Z",
 "groupBy": [],
 "select": [
 "wrapUpCode",
 "wrapUpCodeName",
 "wrapUpCodeDescription"
 ],
 "where": [
 {
 "dimension": "queue.id",
 "operator": "EQUALS",
 "value": "YOUR_QUEUE_ID"
 }
 ]
}

If it’s still null, check the interaction status. Wrap-up codes only appear after the interaction is fully closed. If you’re querying real-time data, the agent might not have hit the wrap-up button yet. The API doesn’t guess. It returns what’s in the DB.

I’ve seen this with Python’s requests library where the JSON body gets malformed if you don’t set json=payload correctly. Double-check your headers:

headers = {
 'Authorization': 'Bearer YOUR_TOKEN',
 'Content-Type': 'application/json'
}
response = requests.post(url, json=payload, headers=headers)

If response.status_code is 200 but data is sparse, look at the totalCount. If it’s higher than the returned items, you’re hitting pagination limits. Increase pageSize to 1000.

Docs also note: “Data is refreshed every 15 minutes for detail queries.” If you just closed the ticket, wait.