We are trying to automate the cleanup of idle Web Messaging sessions from our backend service. The current setup uses the Genesys Cloud Web Messaging SDK for the frontend, but we need a server-side mechanism to terminate the session state when specific business logic triggers. The documentation suggests that sending a message with a specific disposition or using the POST /api/v2/conversations/message/{conversationId}/participants/{participantId} endpoint might work, but we haven’t found a clear way to just close the session without sending a message or waiting for a timeout. We tried sending a disposition: closed in the message payload, but the session remains active in the UI. Is there a specific API call or JSON payload we should use to force-close the conversation from the backend? Here is the current attempt we are making:
POST /api/v2/conversations/message/{conversationId}/participants/{participantId}
Content-Type: application/json
{
"message": {
"text": "Session closed",
"disposition": "closed"
}
}
The API returns a 204 No Content, but the conversation is still visible to the agent as active. We are using the Genesys Cloud REST API v2. Any pointers on the correct endpoint or payload structure would be appreciated.