Genesys Cloud API: Setting wrap-up code via PATCH on interaction

I’m hitting a wall trying to programmatically set the wrap-up code for a webchat interaction after it has ended. We need to tag conversations based on bot exit intent captured in the Android app.

I’m using the genesyscloud-conv-api client in Kotlin. Once the interaction status hits ended, I attempt to PATCH /api/v2/conversations/webchat/interactions/{id} with the following JSON body:

{
 "wrapupCode": {
 "id": "some-valid-wrapup-id-from-directory"
 }
}

The request returns a 200 OK, but when I fetch the interaction details immediately after, the wrapupCode field is null. The modified timestamp updates, so the server definitely processed the request. I’ve verified the id exists in the wrapup code directory and is enabled.

Is there a specific flag or extension object required in the PATCH body for webchat? The docs for patchConversation are sparse on interaction metadata updates. I’ve tried including the routing object with wrapup settings, but that seems to apply to agent routing, not post-call metadata.