I’m building a Kotlin microservice that needs to forcefully terminate a Web Messaging session when a specific business rule triggers. The session was initialized via the Genesys Cloud Web Messaging SDK, so I have the sessionId and conversationId.
I tried calling DELETE /api/v2/conversations/messaging/{conversationId} with the standard OAuth bearer token. The request returns a 204 No Content, which looks good at first glance. But when I check the GET /api/v2/conversations/messaging/{conversationId}/messages endpoint, the conversation status still shows as active. The guest sees the agent go offline, but the session object isn’t closing on their end.
Here’s the curl equivalent I’m using in my Kotlin code:
val response = httpClient.delete("https://api.mypurecloud.com/api/v2/conversations/messaging/$conversationId") {
header("Authorization", "Bearer $token")
header("Content-Type", "application/json")
}
Is there a specific header or body payload required to signal the SDK to clean up the local session state? Or am I hitting the wrong endpoint entirely? I’ve looked through the Guest API docs, but they mostly cover starting sessions, not ending them from the server side. The conversation.end event isn’t firing in EventBridge either, which confirms the session isn’t actually closing.