Is the correct approach to use the POST /api/v2/queues/predictive endpoint when configuring the ICD threshold for a predictive routing strategy?
Apologies for the noob question, but I’m struggling with the SDK initialization and the API structure. The predictive bucket isn’t updating in the console.
I have a Python script that’s supposed to set the icd value to 120 seconds. The API keeps throwing a 400 Bad Request. The documentation mentions predictive_routing_settings, but I’m not sure if that’s a nested object or a separate resource. Confusing the terminology here. We’re running Genesys Cloud v23.7 in EU1.
Here’s the snippet. The console is doing jack all.
import gen_restapi
client = gen_restapi.PureCloudPlatformClientV2()
client.login_oauth_client_credentials("my_client_id", "my_secret")
# trying to set the predictive queue ICD
queue = client.queues_api.get_queue(queue_id="12345")
queue.predictive_bucket_settings.icd = 120
client.queues_api.put_queue(queue_id="12345", body=queue)
Error response:
{
"code": "bad.request",
"message": "The request body is invalid.",
"details": "Field 'predictive_bucket_settings' is not recognized."
}
The logs show a timeout after 3 seconds. Also, the SDK version is 2.0.4.
Is predictive_bucket_settings the wrong key? I thought that’s how you adjust the predictive queue parameters. The error mentions routing_settings, but that’s for standard queues, right?
Traceback (most recent call last):
File “main.py”, line 15, in
client.queues_api.put_queue…
AttributeError: ‘Queue’ object has no attribute ‘predictive_bucket_settings’
The script crashes on the assignment line. My manager is asking why the predictive scores aren’t calculating. I think this config update is blocking it. The OAuth token looks valid because the GET request works fine. It’s only the PUT that fails. Also, I noticed the response headers have a retry-after but the status is 400. That seems odd. Maybe the SDK is serializing the object wrong? I tried passing a dict instead of the object, but got the same error. The incomplete log below shows the request headers. Authorization: Bearer eyJ... [cut]. The payload size is small. Not a timeout issue. Just a schema mismatch. I really apologize for the basic question. I’ve checked the swagger docs. The Queue model doesn’t list predictive_bucket_settings. It lists routing_settings. But routing_settings has a predictive field? I’m getting tangled up. The Python SDK models might be outdated. I’m on the latest pip install. gen-restapi==2.0.4. The error says predictive_bucket_settings is not recognized. Maybe I need to use routing_settings.predictive.icd? I tried that and got a 500 Internal Server Error. I can’t find any examples in the community posts for this specific flow.