POST /api/v2/cobrowse/sessions returns 400 Bad Request with valid conversation ID

POST /api/v2/cobrowse/sessions

HTTP 400 Bad Request

We are building a custom agent desktop extension that needs to trigger a cobrowse session programmatically. The goal is to start the session from within an existing voice conversation context so the agent can see the customer’s screen. I have the conversation ID from the active call object in the SDK.

Here is the payload I am sending:

{
 "conversationId": "12345678-abcd-1234-abcd-1234567890ab",
 "providerId": "12345678-abcd-1234-abcd-1234567890ab",
 "applicationId": "98765432-abcd-1234-abcd-1234567890ab"
}

The error response is pretty vague:

{
 "code": "badRequest",
 "message": "Invalid request body",
 "details": []
}

I have verified the application ID is correct and published. The provider ID matches the user ID of the current agent. I am using the standard OAuth token for the application. The documentation says the conversationId is optional but recommended for linking. When I remove it, I get the same 400 error. I tried adding the type field set to cobrowse but that did not help either.

Is there a specific permission the application needs besides cobrowse:write? Or is the format of the IDs wrong? I am using the .NET SDK but switched to raw HTTP POST to debug this since the SDK wrapper just throws a generic exception.

You’re probably missing the type field or sending the wrong conversation ID format. Try adding "type": "cobrowse" to the payload and make sure you’re using the actual conversation ID from the active session, not the participant ID.

{
 "conversationId": "12345678-abc-def-ghi-jklmnopqrst",
 "type": "cobrowse"
}
1 Like

is spot on about the type field but you also need to make sure your auth token actually has the cobrowse scope. i ran into this exact 400 while debugging my messenger embed. it wasn’t the json it was the permissions. here is what worked for me in the browser sdk.

const cobrowseConfig = {
 conversationId: "your-conv-id-here",
 type: "cobrowse"
};

await platformClient.CobrowseApi.postCobrowseSessions(cobrowseConfig);

just double check your oauth scopes include cobrowse:manage. if that’s missing you’ll get a 401 or 403 but sometimes the api masks it as a bad request depending on the version. also make sure the conversation is actually active and not queued.

1 Like