Data Action JSON Schema Validation Failing in Terraform Apply for Analytics Export

Having some config trouble here when deploying a custom Data Action for analytics aggregation via the Genesys Cloud Terraform provider. The resource genesyscloud_integration_action fails during the apply phase with a 400 Bad Request. The error payload indicates a schema mismatch in the request_body template.

Environment details:

  • Provider version: 1.12.4
  • Region: ap-southeast-2
  • Terraform: 1.5.7
  • Data Action Type: genesyscloud:analytics:export

The HCL configuration defines a dynamic JSON body to fetch queue performance metrics. The template uses Terraform variables for the date range. However, the API rejects the payload, citing invalid field configuration. Specifically, the metrics array structure seems to be parsed incorrectly by the integration endpoint, or the provider is stripping necessary nested objects during serialization.

hcl
resource "genesyscloud_integration_action" "analytics_export" {
 enabled = true
 name = "Daily Queue Analytics"
 type = "genesyscloud:analytics:export"

 request_body_template = """
 {
 "date_range": "${var.start_date}/${var.end_date}",
 "metrics": [
 {
 "metric": "queue_handle_time",
 "type": "interval"
 }
 ]
 }
 """
}

The error response from the API:
{"errors":[{"code":"bad_request","message":"Invalid field configuration. Expected array of strings for metric identifiers, found object."}]}

This is extremely confusing because the Analytics API documentation clearly shows the metric object structure for direct REST calls. The integration action endpoint appears to have a stricter, different schema than the standard analytics report API.

Is there a known limitation in how the Terraform provider serializes complex JSON objects for Data Actions? Or is the genesyscloud:analytics:export action expecting a flattened metric identifier list rather than the full metric definition object? Previous attempts to use static JSON strings worked, but dynamic interpolation breaks the schema validation. Need a workaround for variable injection that preserves the correct object structure.