Setting wrap-up code via /api/v2/interactions endpoint returning 409

I’m trying to programmatically set a wrap-up code for an interaction after it ends using the Genesys Cloud API. The goal is to automate some post-call data entry without relying on the agent to manually select the code in the UI.

I’m using the POST /api/v2/interactions/{id} endpoint to update the interaction. Here is the JSON payload I’m sending:

{
 "wrapUpCode": {
 "id": "some-valid-wrap-up-code-id"
 }
}

The interaction ID is correct, and the wrap-up code ID exists in our routing queue settings. However, I keep getting a 409 Conflict response with the message: Interaction is not in a state that allows this action.

I’ve tried:

  • Waiting 5 seconds after the interaction status changes to completed before sending the request.
  • Checking the interaction state via GET /api/v2/interactions/{id}; it shows state: completed.
  • Using the genesyscloud Python SDK’s update_interaction method with the same payload.

The API docs say you can update wrap-up codes after the interaction ends, but I’m clearly missing something about the state machine or timing. Is there a specific status I need to wait for, or is this endpoint not meant for post-call wrap-up assignment?