Hi everyone,
We are building a post-interaction workflow in New Relic to capture wrap-up codes from Genesys Cloud and trigger specific alerting policies. The goal is to programmatically set the wrap-up code immediately after the interaction status changes to ENDED.
I have been testing this using the Python SDK (genesyscloud). I’m listening for the interaction status change event, extracting the interactionId, and then attempting to update the interaction using the update_interaction method. I’m trying to set the wrapUpCode inside the attributes object.
Here is the relevant snippet of the code I’m running:
from genesyscloud.conversations import ConversationsApi
conversations_api = ConversationsApi(configuration)
# Payload structure I am sending
update_payload = {
"attributes": {
"wrapUpCode": "Sales Follow-up",
"custom_field": "some_value"
}
}
try:
api_response = conversations_api.update_interaction(
interaction_id=interaction_id,
body=update_payload
)
except Exception as e:
print(f"Error: {e}")
The API call fails with a 400 Bad Request error. The error message returned is:
{
"message": "Invalid interaction update request. Wrap-up codes cannot be set after interaction has ended.",
"code": "invalid.request"
}
I’ve checked the documentation, and it seems like the standard update endpoint rejects changes to the wrap-up code once the interaction lifecycle has moved past the active state. I want to make sure I’m not missing a specific endpoint or a different payload structure that allows this.
Here is what I have tried so far:
- Using the
POST /api/v2/conversations/interactions/{interactionId}endpoint with the same payload. - Trying to set the wrap-up code in the
participantsarray instead of the top-level attributes. - Checking if the
wrapUpCodeneeds to be an ID rather than a string label (I tried both).
Is there a specific API call to set the wrap-up code after the fact, or is this strictly limited to the agent’s action in the UI or Architect? I need to automate this for our reporting pipeline.
Thanks.