Notification API WebSocket disconnecting on /v2/events/conversations

Trying to subscribe to conversation events via the Notification API WebSocket. The connection opens fine, but it drops immediately after sending the subscription payload. Here’s the JSON I’m pushing:

{"eventType":"/v2/events/conversations","subscriptionId":"test-123"}

No error message comes back, just a disconnect. I’ve checked the scopes and they look correct. Is there a specific format for the subscription payload that the server expects? The docs are pretty vague on this.

The docs are pretty specific about this. You can’t just send eventType and subscriptionId in the root. The payload needs to be wrapped in a specific structure for the WebSocket tocol.

From the Notification API docs:

“The client must send a subscription request as a JSON object containing a type field set to subscription and a data object containing the actual subscription details.”

Your JSON is missing the outer wrapper. Try this:

{
 "type": "subscription",
 "data": {
 "eventType": "/v2/events/conversations",
 "subscriptionId": "test-123"
 }
}

Also, make sure you’re using the correct WebSocket endpoint. It’s wss://api.mypurecloud.com/v2/events not the endpoint. The .NET SDK has a WebSocketsClient class that handles this serialization automatically if you use it, but if you’re rolling your own HttpClient or WebSocket, you have to format it exactly like that.

Check your OAuth scopes too. You need event:read or conversation:read depending on the event type. event:read is usually enough for the notification API.