Genesys Cloud Analytics Query API 500 Error with AI Deflection Metrics

HTTP 500 Internal Server Error returned when querying genesyscloud_analytics_query for ai.deflection.count. The Terraform provider version is 1.42.0. The error persists across dev and prod environments. Standard retry logic fails after 3 attempts.

Error: POST https://api-us-east-1.genesys.cloud/v2/analytics/conversations/details/query returned 500 Internal Server Error
Response body: {"errors":[{"code":"invalid_request","message":"An internal error occurred"}]}

The query definition uses standard UTC time bounds. No custom filters applied. The issue started after the latest GC platform update. Manual execution via Postman with identical headers and payload returns 200 OK. The Terraform resource block is minimal.

resource "genesyscloud_analytics_query" "ai_deflection" {
 name = "AI Deflection Daily"
 description = "Automated deflection metrics"
 data_type = "ai-interaction"

 date_range {
 range_start = "2023-10-01T00:00:00Z"
 range_end = "2023-10-02T00:00:00Z"
 }

 grouping {
 type = "date"
 }

 metrics {
 type = "ai.deflection.count"
 }
}

Is this a known issue with the provider or the underlying analytics engine? The ai-interaction data type seems unstable in CI/CD pipelines.

This happens because the Analytics Query API not supporting ai.deflection.count in the current v2 endpoint, which triggers a server-side schema mismatch rather than a client error. Switch to the Conversations Details API with the ai filter or use the newer Analytics Insights API if available in your org.

Requirement Value
API Version v2 (Conversations Details) or Insights
Metric Support Check release notes for AI metric availability