extending our CX-as-Code automation suite to include programmatic initiation of cobrowse sessions. The objective is to trigger a cobrowse session for an existing voice or chat conversation using the Genesys Cloud Conversations API. This allows us to inject technical support capabilities directly into the workflow based on specific IVR or chatbot triggers.
The approach involves calling the POST /api/v2/conversations/{conversationId}/cobrowse endpoint. We have verified that the OAuth token possesses the cobrowse:read and cobrowse:write scopes. The conversation ID is retrieved dynamically from the active session store.
Here is the JSON payload we are sending in the request body:
{
"type": "cobrowse",
"initiator": {
"id": "12345678-1234-1234-1234-123456789012",
"name": "System Bot"
},
"participants": [
{
"id": "87654321-4321-4321-4321-210987654321",
"role": "viewer"
}
]
}
The response from the API is consistently a 400 Bad Request. The error body contains the following message:
{
"errorCode": "bad_request",
"message": "Invalid cobrowse session parameters. Participant role must be 'initiator' or 'participant'."
}
We have cross-referenced the documentation for the cobrowse resource. The role values initiator and viewer appear correct based on the schema definitions for cobrowse participants. We have also attempted changing the role to participant without success. The initiator ID corresponds to a valid user in the system, and the target participant is an active customer in the conversation.
Is there a specific constraint regarding the conversation type that prevents cobrowse initiation via this endpoint? We are testing this against a standard voice conversation. The environment is set to https://api.mypurecloud.com.
Any insights on the correct payload structure would be appreciated.