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 trying to use the POST /api/v2/routing/queues/{queueId}/wrapupcodes endpoint to manage the wrap-up codes. Here is the JSON payload I’m sending:

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

The queue 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 the conversation details; it shows state: completed.
  • Using the genesyscloud Python SDK’s wrap-up code methods with the same payload.

The API docs say you can manage wrap-up codes for queues, 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?

1 Like