Web Messaging session termination via backend API returns 404

We have encountered a persistent issue while attempting to terminate a guest’s Web Messaging session programmatically from our backend orchestration layer. The requirement is to close the session immediately upon specific CRM trigger events, ensuring the guest cannot send further messages without re-authentication.

The standard approach, as documented in the Guest API reference, involves sending a POST request to /api/v2/conversations/messaging/events with an action of endSession. We have verified that the OAuth token used for this request has the necessary conversation:write and guest:write scopes. The request payload is structured as follows:

{
 "action": "endSession",
 "conversationId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}

Despite the correct payload structure and valid authentication, the API consistently responds with a 404 Not Found status code. The error body indicates that the resource could not be located, which is perplexing given that the conversationId is retrieved directly from a successful GET /api/v2/conversations/messaging call moments before the termination attempt.

We have also attempted to use the deprecated genesyscloud_guest endpoints, but these yield similar results. The WebSocket connection on the guest side remains open, and the UI does not reflect the session closure. It appears that the endSession action is not being recognized or is incorrectly mapped in the current API version.

Has anyone successfully implemented backend-driven session termination? Are there specific headers or additional parameters required in the events endpoint that are not explicitly documented? The current behavior suggests a potential mismatch between the conversation state and the API’s expectation for session management. We are operating in the European region, using the api.eu.genesys.cloud endpoint. Any insights into this discrepancy would be appreciated. The logs on our side show no network errors, only the HTTP 404 response from the Genesys platform.