Genesyscloud_routing_email_domain 400 - Invalid payload during Terraform apply

  • Terraform v1.9.8
  • Genesys Cloud Provider v1.65.2
  • GitHub Actions runner: ubuntu-latest
  • Environment: Production

Could someone explain why the genesyscloud_routing_email_domain resource consistently fails with a 400 Bad Request during the apply phase? The error message is generic: “Invalid request payload.” Validation against the OpenAPI spec shows no issues. The JSON structure matches the example provided in the provider documentation exactly.

The goal is to automate email domain provisioning as part of our CX-as-Code pipeline. We are using GitHub Actions to push changes from a shared repository. The pipeline runs successfully for other resources like routing_queue and routing_skill, but fails specifically on the email domain resource.

Here is the minimal reproducible HCL snippet:

resource "genesyscloud_routing_email_domain" "support_domain" {
 name = "support.example.com"
 description = "Automated support domain"
 
 email_server {
 name = "imap.example.com"
 host = "imap.example.com"
 port = 993
 type = "IMAP"
 }
}

The error occurs when the provider attempts to create the resource. No debug logs are generated in the GitHub Actions output beyond the standard Terraform error block. We have verified that the service account used in the pipeline has the necessary permissions (routing:email:read, routing:email:write). Manual creation via the UI works without issues, suggesting the configuration itself is valid.

We suspect this might be related to how the provider handles nested email_server blocks or a potential mismatch in expected JSON formatting for the genesyscloud_routing_email_domain endpoint. Has anyone successfully automated this resource with the current provider version? Any insights into required hidden parameters or known bugs would be appreciated. We need to resolve this to complete our environment promotion strategy.