We are attempting to automate the assignment of wrap-up codes for voice interactions immediately after they conclude. The goal is to ensure consistent data capture without relying on agent manual selection. I have constructed a POST request to the endpoint /api/v2/conversations/{conversationId} using the genesyscloud_python SDK, targeting the wrapup object within the request body.
The payload structure appears correct according to the OpenAPI spec, yet the API consistently returns a 400 Bad Request. The error response indicates that the code field is either invalid or missing, despite the ID being verified as active in the system.
Here is the relevant snippet of the Python code and the resulting error payload:
body = {
"wrapup": {
"code": {"id": "e4a7b2c1-9876-5432-10fe-abcdef123456"},
"duration_ms": 0,
"notes": "Automated wrap-up"
}
}
try:
api_instance.update_conversation(conversation_id, body=body)
except Exception as e:
print(f"Error: {e}")
The error log returns:
Error: 400 Bad Request
{
"message": "Invalid wrapup code ID provided",
"errors": [
"The specified wrap-up code does not exist or is not assigned to the routing queue associated with this conversation."
]
}
I have confirmed the code ID exists in the queue configuration. Is there a specific permission required on the integration user, or is the timing of the request relative to the conversation lifecycle causing the conflict? The conversation state is WRAPUP when the request is sent. I don’t see any documentation mentioning a delay requirement.