Trying to import an existing routing queue into our Terraform state, but terraform import genesys_cloud_routing_queue.main 12345 keeps throwing a 404. The queue exists in the UI and I can fetch it via /api/v2/routing/queues/12345, so why does the provider complain? Here’s the block I’m using:
Have you checked if the queue is actually visible to your service account? It’s a common gotcha with the Terraform vider. The API call you made bably used a user token or an account with higher privileges, while the vider might be running under a different identity that doesn’t have access to that specific routing configuration.
Run this quick check to verify the scope:
curl -X GET "https://api.mypurecloud.com/api/v2/routing/queues/12345" \
-H "Authorization: Bearer <SERVICE_ACCOUNT_TOKEN>" \
-H "Accept: application/json"
If that returns a 403 or 404, it’s definitely a permissions issue. The Terraform vider needs routing:queue read access at minimum. Also, make sure you aren’t mixing up the ID format. Sometimes the UI shows a different identifier than what the API expects, though usually they match. I’ve seen this happen when the queue is archived or disabled in the background.