Analytics Detail API returning null for wrapUpCode even when agents use them

Hey folks,

Running into a weird issue with the /api/v2/analytics/details endpoint. I’m trying to pull conversation details for a specific queue over the last 24 hours, and I need the wrapUpCode field for downstream processing.

The query returns the expected number of conversations, and fields like id, startTime, and duration are all populated correctly. However, wrapUpCode is coming back as null for every single record, even though I can see in the UI that agents are definitely selecting wrap-up codes.

Here’s the JSON payload I’m sending:

{
 "groupings": [
 {
 "attribute": "id",
 "type": "dimension"
 }
 ],
 "metricFilters": {},
 "metrics": [],
 "dateFrom": "2023-10-25T00:00:00.000Z",
 "dateTo": "2023-10-26T00:00:00.000Z",
 "entityType": "conversation",
 "groupBy": "id",
 "filterType": "and",
 "filters": [
 {
 "type": "dimension",
 "dimension": "queue.id",
 "operator": "eq",
 "value": "<queue-id>"
 }
 ],
 "fields": [
 "id",
 "startTime",
 "endTime",
 "duration",
 "wrapUpCode"
 ]
}

I’ve tried adding wrapUpCode to the groupings array as well, but that just breaks the query with a validation error. I’ve also checked the conversation object in the response, and the nested wrapUpCode object is completely missing or null.

Is this a known limitation of the detail query? Or am I missing a specific permission or field configuration? I have the analytics:read scope on the OAuth token.

Any pointers would be appreciated. I’m pulling my hair out trying to get this data for a client report.