We are attempting to initiate a cobrowse session programmatically through the Genesys Cloud Conversations API as part of a new support workflow. The goal is to trigger the session from our backend service using the POST /api/v2/cobrowse/sessions endpoint.
We have verified that the OAuth token has the necessary scopes (cobrowse:manage and cobrowse:session). The request payload follows the documentation structure for the session initiation object. Here is the JSON body we are sending:
{
"sessionId": "sess_abc123",
"participants": [
{
"id": "agent_user_id_from_db",
"role": "agent"
},
{
"id": "customer_user_id_from_db",
"role": "customer"
}
],
"initiatorId": "agent_user_id_from_db"
}
The response we receive is a 400 Bad Request. The error body is not very descriptive:
{
"code": "bad_request",
"message": "Invalid session initiation parameters",
"status": 400,
"messageTemplate": "Invalid session initiation parameters",
"errors": [
{
"code": "invalid_field",
"message": "Field 'participants' contains invalid user ID format",
"path": "participants[0].id"
}
]
}
We have double-checked the user IDs. They are valid Genesys Cloud user IDs (UUID format). We also tried using the userId field instead of id in the participant object, but that resulted in the same error. The documentation mentions that the participant IDs must match users who are currently logged into Genesys Cloud. Both the agent and the customer (who is logged in via a custom app) are active.
Is there a specific format required for the id field in the participants array? Or is there a prerequisite API call we need to make to register the user for cobrowse before initiating the session? We are using the Python SDK for the initial authentication, but the cobrowse call is made via raw HTTP requests using requests.post().
Any insights into why the participants[0].id is being flagged as invalid would be appreciated.