POST /api/v2/analytics/query 400 Bad Request on AU-1 BYOC terraform apply

Looking for advice on why the analytics query endpoint returns 400 bad request during automated deployment on our BYOC environment. we are using terraform to provision reporting resources but the api call fails immediately.

provider: 2.5.1
tf: 1.6.0
resource: genesyscloud_analytics_view
endpoint: POST /api/v2/analytics/query

the error message is generic. “invalid request body”.

here is the relevant hcl snippet. we are trying to create a custom view for agent adherence metrics. the structure matches the schema definition in the docs exactly.

resource “genesyscloud_analytics_view” “agent_adherence” {
name = “agent-adherence-view”
description = “custom view for agent adherence”

data {
type = “interval”
start = “2023-01-01T00:00:00.000Z”
end = “2023-12-31T23:59:59.999Z”
}

metrics {
key = “agentAdherence”
type = “SUM”
}

groups {
key = “agentId”
type = “AGENT”
}
}

the apply fails with this trace:
Error: POST https://api.au-1.genesyscloud.com/api/v2/analytics/query: 400 Bad Request
Response body: {“code”:“bad.request”,“message”:“Invalid request body”,“status”:“Bad Request”}

we have verified the tenant id and region settings. the provider block is configured for au-1.

resource “genesyscloud_provider” “main” {
base_url = “api.au-1.genesyscloud.com
}

manual creation via architect or postman works fine with the same json payload. this suggests a terraform provider issue or a specific field validation bug in the BYOC api version.

anyone else hitting this on au-1? is there a known workaround for the analytics view resource? we need to automate this for 50+ views. manual entry is not an option.

thanks.