Problem
I’m trying to automate skill proficiency updates for a batch of agents using the CXone Admin API. We have a quarterly review process where we need to adjust proficiencies for about 200 agents at once. Manually doing this in the portal is painful, so I wrote a Python script to hit the bulk update endpoint.
The issue is that the API keeps returning a 400 Bad Request. The response body just says “Invalid request body” without giving me a specific field that’s wrong. I’ve checked the schema documentation multiple times, and the JSON payload looks correct to me.
Code & Payload
Here is the relevant part of my Python script using requests:
import requests
import json
token = "my_valid_access_token"
url = "https://api.nice.incontact.com/nice/ic/admin/api/v1/users"
headers = {
"Authorization": f"Bearer {token}",
"Content-Type": "application/json"
}
# Just testing with 2 agents first
payload = [
{
"id": "12345678-1234-1234-1234-123456789012",
"skills": [
{
"id": "skill-id-alpha",
"proficiency": 80
},
{
"id": "skill-id-beta",
"proficiency": 60
}
]
},
{
"id": "12345678-1234-1234-1234-123456789013",
"skills": [
{
"id": "skill-id-alpha",
"proficiency": 90
}
]
}
]
response = requests.patch(url, headers=headers, data=json.dumps(payload))
print(response.status_code)
print(response.text)
Error
The output is consistently:
400
{"message":"Invalid request body","errors":[]}
I’ve verified the agent IDs exist and the skill IDs are valid. I even tried updating just one agent with a single skill, same result.
Question
Is there a specific wrapper object required for the bulk payload that I’m missing? The docs show an array of user objects, but maybe the endpoint expects a different structure for the PATCH method. Also, does the proficiency field need to be a string instead of an integer? I’ve tried both, and it still fails.
Any ideas on what’s causing this validation error? I’m stuck on this for two days now and it’s blocking our quarterly update.