Make sure you’re actually looking at the right metric name in the payload. wrapUpCode is the response field, but the query metric is wrap_up_code. if you’re just copying the response key into the request body, it’ll silently fail to populate.
also, the details endpoint is finicky with interval types. if you’re using INTERVAL type, you need to ensure the groupBy array includes wrap_up_code alongside your primary dimension (usually agent_id or wrap_up_code itself). without it, the engine aggregates the data but drops the code value to save payload size.
here’s the exact JSON structure that works for me in the Java SDK CreateDetailsQueryRequest:
{
"dateFrom": "2023-10-01T00:00:00Z",
"dateTo": "2023-10-02T00:00:00Z",
"type": "INTERVAL",
"groupBy": ["wrap_up_code"],
"metrics": ["wrap_up_code", "handle_time"],
"filter": [
{
"dimension": "queue_id",
"type": "EQUALS",
"value": "your-queue-id-here"
}
]
}
one thing to watch out for is the wrap_up_code dimension filter. if you don’t filter by a specific queue or group, the query might return empty buckets for agents who didn’t wrap up, which looks like nulls. i usually add a filter for wrap_up_code not equals null in the filter array to strip out the noise, though that depends on whether you want to see the agents who skipped it.
also check if your agents are actually setting a code. in Architect, if the wrap-up form is optional or hidden, the API won’t invent a value. it stays null. i’ve seen this happen when migrating from Twilio because the old system forced a reason code, but GC defaults to optional unless you configure the wrap-up form strictly.
check the wrap_up_code metric definition in the docs again. it’s easy to miss the nuance about INTERVAL vs SUMMARY types. SUMMARY gives you the count per code, INTERVAL gives you the timeline. if you want the specific code per agent interaction, INTERVAL with groupBy: ["agent_id", "wrap_up_code"] is the way to go.