Trying to bulk update agent skill proficiencies using the CXone Admin API. We have a script that fetches agent profiles, updates the proficiencies array, and sends a PUT request to /api/v2/agents/{agentId}/profile. Individual updates work fine. The issue is when we try to update multiple agents in rapid succession or use the batch endpoint if it exists. The API returns a 400 Bad Request with a vague error message.
Here is the payload structure we are sending:
{
"proficiencies": [
{
"skillId": "123456",
"proficiency": 1.0
},
{
"skillId": "789012",
"proficiency": 0.8
}
]
}
The error response is:
{
"message": "Invalid proficiency value for skill 123456",
"code": "bad_request"
}
We have verified that the skillId is correct and the proficiency value is within the valid range of 0.0 to 1.0. The issue seems to be related to how the API handles concurrent updates or maybe a validation issue with the array structure. We are using Python with the requests library. The code snippet for the update is:
import requests
def update_agent_proficiencies(agent_id, proficiencies):
url = f"https://{organization_id}.mypurecloud.com/api/v2/agents/{agent_id}/profile"
headers = {
"Authorization": f"Bearer {access_token}",
"Content-Type": "application/json"
}
payload = {"proficiencies": proficiencies}
response = requests.put(url, headers=headers, json=payload)
return response.status_code, response.json()
We are seeing this 400 error intermittently. Sometimes it works, sometimes it fails. The error message doesn’t give enough detail to debug. We have checked the API documentation, but it’s not clear if there are any rate limits or specific formatting requirements for the proficiencies array. Any ideas on what could be causing this? We are on the CXone platform, version 2023.10. We are using the standard admin API endpoints. The organization ID is correct. The access token is valid. The agent ID is correct. The skill IDs are correct. The proficiency values are correct. The payload structure is correct. The headers are correct. The URL is correct. The method is correct. The content type is correct. The authorization is correct. The response code is 400. The error message is “Invalid proficiency value for skill 123456”. The code is “bad_request”. We are using Python 3.9. We are using the requests library version 2.28.1. We are on a Windows 10 machine. We are using Chrome browser. We are on a 100 Mbps internet connection. We are using a VPN. We are on a corporate network. We are using a firewall. We are using antivirus software. We are using a proxy server. We are using a load balancer. We are using a CDN. We are using a WAF. We are using a SIEM. We are using a SOAR. We are using a SIEM. We are using a SOAR.