Closing Web Messaging session via backend API without client token

Trying to programmatically terminate a Web Messaging session from our backend service. The requirement is simple: user clicks ‘End Chat’ in our custom portal, we hit the Genesys Cloud API to close it on their behalf. No browser involvement. No guest token available on the server side since we don’t store them for security reasons.

Docs state: “To end a conversation, use the PATCH /api/v2/conversations/{conversationId} endpoint with the state set to terminated.” I’m hitting that endpoint using a standard Client Credentials token with the purecloud:conversation:write scope. The request looks like this:

PATCH /api/v2/conversations/5f8a9b2c-1d3e-4f5a-9b8c-7d6e5f4a3b2c
{
 "state": "terminated"
}

The response is a 403 Forbidden. The error message is generic: “You do not have permission to perform this action.” I’ve verified the client credentials have the correct scopes. I’ve even tried adding the division ID to the header, just in case. Same result. The conversation is clearly active and belongs to a queue this client is associated with.

I suspect the issue is related to the conversation type. Web Messaging sessions are technically message type, not voice or chat. The API might be treating them differently regarding termination permissions. Or maybe I need to use a different endpoint entirely.

Has anyone successfully closed a messaging session from the backend without a guest token? The docs mention terminate for voice, but messaging feels different. I’m stuck on this permission error.