Trying to kick off a cobrowse session from our backend service. We’ve got the OAuth token working fine for other endpoints, but this one keeps failing. The docs say I need to pass a to object with the customer’s contact info, but the payload is getting rejected immediately.
Here’s the curl command I’m running:
curl -X POST "https://api.mypurecloud.com/api/v2/conversations/cobrowses" \
-H "Authorization: Bearer <valid_token>" \
-H "Content-Type: application/json" \
-d '{
"to": [{
"id": "some-customer-id",
"name": "Test Customer",
"phoneNumber": "+49123456789"
}],
"from": {
"id": "agent-id-123",
"name": "Support Agent"
}
}'
The response is a 400 Bad Request with "message":"Invalid to address format". I’ve tried swapping id for phoneNumber in the to array, and I’ve tried removing the from object entirely. Nothing works. The customer ID is valid in the system, and the agent is logged in. What’s the exact JSON structure required for the to field? Is it expecting a specific format for the id that I’m missing?