Trying to script a bulk update for agent skill proficiencies via the CXone Admin API. We’ve got a new routing model rolling out and need to adjust the proficiency levels for about 500 agents based on a CSV export from our WFM team. The individual PUT calls work fine when I test them manually in Postman, but I need to automate this.
I’m hitting the /api/v2/users/{userId}/skills endpoint. The docs show a request body like this:
[
{
"skillId": "12345",
"proficiency": 50
},
{
"skillId": "67890",
"proficiency": 30
}
]
I’m looping through the users in Python and sending the payload. The issue is that when I hit the endpoint, I get a 400 Bad Request with a vague message: Invalid request body. Please check the documentation.
Here’s the snippet of what I’m sending:
import requests
headers = {
"Authorization": f"Bearer {token}",
"Content-Type": "application/json"
}
payload = [
{"skillId": "11111", "proficiency": 100},
{"skillId": "22222", "proficiency": 50}
]
response = requests.put(
f"https://api.nicecxone.com/api/v2/users/{user_id}/skills",
headers=headers,
json=payload
)
print(response.status_code)
print(response.text)
The skillId values are definitely valid. I’ve double-checked them against the skills endpoint. I also tried adding skillName to the object, but that didn’t change anything. The error persists.
Is there a specific format requirement for the bulk update that’s not obvious from the docs? Or am I hitting a rate limit that’s masking the real error? The response body doesn’t give much to go on besides the generic 400 message.
Any ideas on what I’m missing here? I’ve been staring at this for two hours.