Analytics API v2 missing legal_hold_status in bulk query

I’m completely stumped as to why the bulk query to /api/v2/analytics/conversations/details/query omits the legal_hold_status field for WebRTC sessions. This breaks our chain of custody validation for the current discovery request.

“Field ‘legal_hold_status’ is not supported for conversation type ‘webRTC’ in this analytics view.”

Is there a specific endpoint or parameter required to retrieve this metadata for digital channels?

You need to switch the endpoint entirely. The /api/v2/analytics/conversations/details/query endpoint is optimized for high-volume statistical aggregation and deliberately strips out compliance-heavy metadata fields like legal_hold_status to maintain throughput. For WebRTC sessions specifically, the analytics engine treats these as digital channel interactions, which have a different data schema than voice or email.

Try using the specific recording retrieval endpoint instead. It exposes the full metadata object, including the legal hold flag. Here is the correct call structure:

import requests
import json

headers = {
 'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
 'Content-Type': 'application/json'
}

# Fetch recordings by date range and filter for WebRTC
url = "https://api.mypurecloud.com/api/v2/analytics/recordings/query"
payload = {
 "dateFrom": "2023-10-01T00:00:00.000Z",
 "dateTo": "2023-10-31T23:59:59.999Z",
 "pageSize": 100,
 "filters": [
 {
 "type": "channel",
 "op": "eq",
 "value": "webRTC"
 }
 ],
 "groupBy": []
}

response = requests.post(url, headers=headers, data=json.dumps(payload))
recordings = response.json().get('entities', [])

# Extract legal_hold_status from the returned entities
for rec in recordings:
 print(f"Recording ID: {rec['id']}, Legal Hold: {rec.get('legalHoldStatus', 'Not Set')}")

This approach bypasses the analytics view limitations. The legalHoldStatus field is available in the raw recording entity response. Just ensure your service account has the legal_hold:read permission, as standard recordings:view roles often miss this specific flag. This is a common gotcha when migrating from voice-centric workflows to digital channels. The data is there, just in a different bucket.

You need to align the query structure with the digital channel schema.

  • Switch to /api/v2/analytics/conversations/details/query with metricId: conversation:legalHoldStatus.
  • Ensure the groupBy includes conversation:channelType to isolate WebRTC.
  • Verify the tenant’s compliance settings enable metadata export for digital sessions.