Why does this setting fail to persist wrap-up code via POST to /api/v2/conversations

Why does this setting fail to persist the wrap-up code when I send a POST request to /api/v2/conversations/{conversationId} immediately after the interaction status changes to closed?

POST /api/v2/conversations/{conversationId}
{
 "wrapupCode": {
 "id": "my-wrapup-code-id",
 "name": "Resolved"
 }
}

“Wrap-up codes must be set by the agent within the client application after the conversation concludes.”

I get a 409 Conflict stating the conversation is already closed, yet the SFDC case sync triggers without the code.

It’s worth reviewing at the specific endpoint for interactions rather than generic conversation updates. The conversation resource does not accept wrap-up codes directly after closure.

Use the dedicated interactions endpoint to persist the data correctly.

curl -X PUT "https://api.mypurecloud.com/api/v2/conversations/{conversationId}/interactions" \
 -H "Authorization: Bearer $TOKEN" \
 -H "Content-Type: application/json" \
 -d '{"wrapUpCode": {"id": "my-wrapup-code-id"}}'