Web Messaging API: Programmatically closing a conversation from backend

Running into a wall trying to force-close a web chat session from our Node.js backend. We have a custom agent assist tool that needs to terminate the conversation immediately if a compliance flag triggers.

I’ve tried hitting the standard close endpoint:

POST /api/v2/conversations/messaging/instances/{conversationId}/close

With this payload:

{
 "reason": "agent",
 "closedBy": "system"
}

It returns a 204 No Content, which looks good. But the chat window on the client side stays open. The user can still type, and the UI shows ‘Agent is typing…’. It’s not actually disconnecting.

I’ve checked the EventBridge streams. The conversation.participant.updated event fires, but the state doesn’t change to ‘closed’ in the SDK. I’m using the latest web-messaging SDK.

Is there a specific header or query param I’m missing? Or is there a different endpoint for forcing a hard disconnect from the server side? The docs for the Guest API are pretty thin on this specific use case.

We’re in Sydney, so testing is a bit delayed by the time zone difference with the dev team. Need a fix before the sprint review.