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
completedbefore sending the request. - Checking the interaction state via
GET /api/v2/interactions/{id}; it showsstate: completed. - Using the
genesyscloudPython SDK’supdate_interactionmethod 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?