Quick question about the correct sequence to programmatically close a Web Messaging session from a backend service. I am currently building a Rust service using tokio and reqwest to manage session lifecycles for a high-volume chat environment. The goal is to allow an internal admin tool to forcefully terminate a guest session if certain business rules are violated, rather than waiting for the client-side timeout or user action.
I have successfully implemented the initial WebSocket handshake and am receiving real-time events via the notification_api. However, when I attempt to close the conversation by sending a POST request to /api/v2/conversations/messaging/terminate, the API returns a 200 OK response, but the client-side UI remains stuck in an ‘active’ state. I am sending the following JSON payload in the request body:
{
"reason": "ADMIN_TERMINATED",
"details": "Business rule violation detected"
}
The endpoint used is /api/v2/conversations/messaging/{conversationId}/terminate. I have verified that the {conversationId} is correct by cross-referencing it with the conversation object received in the real-time event stream. The issue seems to be that the termination event is not propagating back to the WebSocket connection established by the guest client. Is there a specific header or additional step required to ensure the termination state is broadcast to the active WebSocket session? Or is this endpoint only intended for archival purposes without real-time state updates? I am looking for a reliable way to signal the end of the session to the client immediately upon backend invocation.