How do I actually apply a wrap-up code to a closed interaction using the Conversations API?
The docs state: “To update an interaction, the request body must contain the current version of the resource. The server validates the version to prevent concurrent modifications.”
I’m using the POST /api/v2/conversations/interactions endpoint. I fetch the interaction, get the version, update the wrap-up object in the payload, and send it back. I get a 409 every time.
Here is the payload I’m sending:
{
"version": 12,
"wrap-up": {
"code": "WU-001",
"notes": "System update"
}
}
The response is:
{
"message": "Conflict. The version provided (12) does not match the current version (13).",
"status": 409
}
I’m fetching the interaction immediately before sending this. The version increments between my GET and my POST. Is there a locking mechanism I’m missing or do I need to poll for version stability? I’ve tried adding a version parameter to the query string but that didn’t help.
It feels like a race condition inherent to the API design. How are you handling this in your token services?