Genesys Cloud Web Messaging: Closing session via API

I need to end a web messaging session from our backend when the agent disconnects, but I can’t find the right endpoint. The UI shows the chat closed, but the guest widget stays active because the backend didn’t trigger the close event. We’re using the standard REST API, not the JS SDK for this part of the flow.

I tried POST /api/v2/conversations/messaging/participants with the action set to close, but it returns a 400 Bad Request saying the participant state is invalid. The docs are vague on the exact JSON structure needed to force a close from the server side. Any example payloads?