Python queue updater throwing 422 on atomic PUT for routing matrices

I’d normally just drag a new block into the Architect Flow and let the UI handle the heavy lifting, but the client wants a Python script that pushes queue updates directly to /api/v2/queue/routing. I’m building a queue updater that grabs a queue ID reference, maps out the Routing Strategy Matrix, and sets the Priority Level Directive before firing an atomic PUT. The issue is the Validation Trigger keeps rejecting the payload when I cross-check against License Tier Permission and Resource Capacity Constraints. I’ve got the agent utilization simulation pipeline running locally to prevent overload, but the format verification step fails before it even hits the compatibility check. The Webhook Callback for WFM roster alignment fires fine, yet the latency tracking shows the validation success rate tanking whenever the Audit Log Generation kicks in. I’m not sure if the schema expects a nested object for the strategy compatibility matrix or a flat array. Here’s what I’m sending:

import requests
headers = {"Authorization": f"Bearer {token}", "Content-Type": "application/json"}
payload = {
 "queue_id": "a1b2c3d4",
 "Routing_Strategy_Matrix": {"type": "longest_idle", "timeout": 30},
 "Priority_Level_Directive": 2,
 "Validation_Trigger": {"check_capacity": True, "simulate_utilization": True},
 "webhook_url": "https://wfm.internal/sync"
}
response = requests.put(f"https://{org}.mypurecloud.com/api/v2/queue/routing/{queue_id}", headers=headers, json=payload)
print(response.status_code, response.text)

The endpoint throws a 422 every time the capacity constraint check runs.