Need some help troubleshooting the correct sequence to terminate a Web Messaging conversation from the backend. I am building a Rust service using tokio and reqwest to manage session lifecycles for high-volume chat bots. The goal is to programmatically end a session when a specific business logic timeout is reached, without waiting for the guest to disconnect.
I have tried sending a DELETE request to the conversation endpoint, but the API spec does not list a direct delete path for web messaging conversations. I understand I need to close the conversation first, but simply setting state to closed via PATCH does not immediately release the WebSocket connection on the guest side in my testing.
Here is the payload I am using for the state update:
{
"state": "closed",
"wrapUpCode": {
"id": "some-wrap-up-id"
}
}
Is there a specific flag or subsequent API call required to force the guest client to drop the connection? Or should I be using a specific close endpoint? The documentation is slightly ambiguous on the exact HTTP method for forced termination, and the available endpoints for web messaging seem limited to retrieving messages and managing deployments or tokens rather than direct conversation termination.