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 try to set it via the API immediately after the interaction status changes to closed?

I am attempting to apply the wrap-up code to the participant, but the API does not support a direct POST to the conversation resource to set this field. The only way to apply a system wrap-up code via the API is through the disconnect endpoint, which is not intended for normal interaction ending:

POST /api/v2/conversations/{conversationId}/disconnect

“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.

1 Like

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

There is no dedicated endpoint to persist wrap-up codes via a POST or PUT request to the conversation resource. You can only retrieve the wrap-up code using the GET endpoint.

curl -X GET "https://api.mypurecloud.com/api/v2/conversations/{conversationId}/participants/{participantId}/wrapup" \
 -H "Authorization: Bearer $TOKEN" \
 -H "Content-Type: application/json"