Programmatically ending a Web Messaging session via API

Hey folks,

We’ve got a custom backend service handling some post-chat logic, and I need to programmatically close out a Genesys Cloud Web Messaging session once our workflow is done. The goal is to terminate the conversation on the Genesys side so it stops counting as active and triggers the proper routing state changes.

I’ve been digging through the Web Messaging API docs, but the options seem pretty sparse for server-side session management. I found the POST /api/v2/webmessaging/organizations/{organizationId}/conversations/{conversationId}/actions/end endpoint, but I’m hitting a wall with the authentication. Since this is a backend-to-backend call, I’m using the standard OAuth client credentials flow to get the token.

Here’s the request I’m sending:

POST /api/v2/webmessaging/organizations/{orgId}/conversations/{convId}/actions/end
Authorization: Bearer <token>
Content-Type: application/json

{
 "reasonCode": "completed"
}

I keep getting a 403 Forbidden response. The error payload just says "message": "Access Denied". I’ve verified the token is valid by hitting /api/v2/authorization/userinfo with the same bearer token, and it returns the correct client details. I’ve also granted the client all the webmessaging:conversation scopes I can find in the developer console.

Is this endpoint even intended for external backends? Or am I missing a specific scope or permission setting on the client credentials? I know I can end the chat from the agent desktop, but we need this to happen automatically after our webhook processes the data.

Any ideas on what’s blocking the access? I’ve tried adding the webmessaging:session scope too, but no luck.