Terraform import for Genesys Cloud routing queue fails with 400 Bad Request

Could someone explain the correct import syntax for an existing Genesys Cloud routing queue using the CX as Code Terraform provider? I am trying to move a legacy queue under state management. The queue exists in the environment and is accessible via the API, but running terraform import results in a 400 Bad Request error from the Genesys Cloud API.

The error suggests the provider is attempting to PATCH the resource during the import validation phase rather than just reading the state. Here is the resource definition I am using:

resource "genesyscloud_routing_queue" "legacy_queue" {
 name = "Legacy Support"
 description = "Migrated from legacy IVR"
 enable_apd = false
 member_flow_id = data.genesyscloud_routing_flow.default_flow.id
 wrap_up_timeout = 60
}

I have tried importing using the queue ID directly:
terraform import genesyscloud_routing_queue.legacy_queue <queue_id>

And also with the full path:
terraform import genesyscloud_routing_queue.legacy_queue /api/v2/routing/queues/<queue_id>

Both fail. The API logs show a malformed request body being sent during the import command. Is there a specific flag or import block syntax required for routing resources in the current provider version?

Have you tried specifying the exact resource ID in the import command? The provider often fails with HTTP 400 if it attempts a PATCH during validation instead of a simple GET. Ensure your Terraform config matches the API response exactly before importing.

  • Verify queue ID format
  • Check provider version compatibility
  • Confirm API scope permissions