WrapUpCode returning null in /api/v2/analytics/details queries despite successful disposition

Running into a weird issue with the analytics detail queries using the Node.js SDK. We’ve built a custom reporting dashboard that pulls call detail records to reconcile agent performance against their wrap-up codes. The goal is straightforward: get the wrapUpCode associated with every completed interaction.

We’re hitting the GET /api/v2/analytics/details endpoint with a standard query payload. Here’s the snippet we’re using to construct the request:

const query = {
 entities: [
 {
 id: 'calls',
 type: 'entity'
 }
 ],
 dateFrom: '2023-10-01T00:00:00.000Z',
 dateTo: '2023-10-02T00:00:00.000Z',
 groupBy: [],
 metrics: [
 { name: 'wrapUpCode' }
 ],
 queryType: 'report'
};

The API call succeeds with a 200 OK. The JSON response comes back populated with talkTime, holdTime, and wrapTime metrics correctly. However, the wrapUpCode field is consistently null for every record, even though we can see in the PureCloud UI that agents are definitely selecting valid wrap-up codes upon hangup.

We’ve verified that the wrap-up codes are active and assigned to the relevant skill groups. We also tried switching the queryType to report vs query but the result remains the same. Is this a known limitation where wrapUpCode isn’t exposed in the detail query metrics list, or are we missing a specific configuration in the group object? We’ve checked the docs but it’s unclear if this requires a separate data action or if it’s simply not supported in the v2 analytics endpoint.

Anyone else hit this wall? We’re stuck waiting on support tickets and need a workaround for the Node.js script.