Force closing Web Messaging session via Guest API returns 403

Hey everyone,

Running into a weird blocker trying to programmatically end a web messaging session from our backend service. We need to clean up stale sessions that aren’t closing properly on the client side, so I figured I’d just hit the Guest API endpoint directly.

I’ve got the conversationId and guestId from our DB. I’m generating a short-lived access token using the standard OAuth flow for guest authentication. The token looks valid-I can use it to fetch the conversation history without issues. But when I try to POST to close the session, I get a 403 Forbidden.

Here’s the request I’m sending:

POST /api/v2/guests/conversations/{conversationId}/sessions/{sessionId}/close
Authorization: Bearer <guest_access_token>
Content-Type: application/json

{
 "reason": "Agent unavailable"
}

The response body is pretty sparse:

{
 "code": "forbidden",
 "message": "User does not have permission to perform this action",
 "status": 403
}

I’ve double-checked the scopes on the OAuth client used to generate the token. It has webmessaging:guest:write and conversation:write. I even tried swapping in a full admin service account token just to rule out permission creep, but that gave me a 401 Unauthorized for the same endpoint, which makes sense since it’s a guest-specific path.

Is there a specific header I’m missing? Or is there a different endpoint I should be hitting to terminate the session? The docs mention sessions/{sessionId}/close but don’t really clarify the auth context required for backend-initiated closures.

Also, I noticed the session state in Genesys Cloud is still showing as active even after the client disconnects. This is causing our queue metrics to skew because these “ghost” sessions are counting toward concurrent conversation limits.

Anyone else tried this? Or am I just barking up the wrong tree with the Guest API for this use case?