Null wrapUpCode in Analytics detail query despite non-empty wrap-up

We’re seeing null values for wrapUpCode in the response of our analytics detail queries, even when the agents clearly selected a wrap-up code in the UI. We’re using the /api/v2/analytics/details/interactions endpoint with a simple filter for type:conversation and view:acd.

Here is the request body we are sending:

{
 "view": "acd",
 "dateFrom": "2023-10-01T00:00:00.000Z",
 "dateTo": "2023-10-31T23:59:59.999Z",
 "groupBy": ["wrapUpCode"],
 "select": ["wrapUpCode", "duration"],
 "filter": [
 {
 "field": "type",
 "op": "equals",
 "value": "conversation"
 }
 ]
}

The response returns rows with wrapUpCode set to null for interactions that had valid codes. We’ve verified the data in the UI and the raw conversation logs, so the data exists. Is this a known limitation with the acd view not populating wrapUpCode in detail queries, or are we missing a specific filter or view parameter? We’ve tried view:agent as well, but the result is the same.

We need this data for our tracing pipeline to correlate wrap-up reasons with trace spans. Any insights on how to reliably fetch this field?

Cause: The view: acd aggregates data at the routing level. Wrap-up codes are agent-specific metadata attached to the participant leg, not the interaction root. The analytics engine strips this out unless you explicitly request the participant view.

Solution: Switch the view to participant and ensure you’re filtering by the correct role. Also, make sure your date range isn’t too wide, as the API throttles large detail sets. Here’s how I structure it in C# using the PureCloudPlatformClientV2 SDK:

var query = new GetInteractionDetailsQueryRequest 
{ 
 View = "participant",
 DateFrom = "2023-10-01T00:00:00.000Z",
 DateTo = "2023-10-02T00:00:00.000Z",
 Filter = new List<Filter> 
 { 
 new Filter { Type = "equals", Field = "type", Value = "conversation" },
 new Filter { Type = "equals", Field = "role", Value = "agent" } 
 }
};

var result = await analyticsApi.GetInteractionDetailsQueryPostAsync(query);
// Check result.Entities[].WrapupCode now

You’ll see the code pop up in the participant object. Don’t forget to handle pagination if you’re pulling more than a few thousand records.