Bulk update agent skills via CXone Admin API failing with 400

I’m trying to bulk-update agent skill proficiencies using the CXone Admin API. I’ve been sending a PUT request to /api/v2/users/skills with a JSON payload containing the user IDs and skill levels. The response keeps coming back as a 400 Bad Request with no useful details in the error message. Here’s the snippet I’m using:

requests.put(url, json=payload, headers=headers)

Can anyone spot what I’m missing?

The endpoint in that snippet is incorrect. /api/v2/users/skills doesn’t support bulk updates. You need to use /api/v2/users/bulk/skills instead. Also, ensure your payload structure precisely matches the expected schema, documented in the CXone Admin API reference. It requires an array of objects, each containing userId, skillId, and proficiency.

import requests

url = "https://api.cxone.net/api/v2/users/bulk/skills"
headers = {
 "Authorization": f"Bearer {access_token}",
 "Content-Type": "application/json"
}

payload = [
 {
 "userId": "user-id-123",
 "skillId": "skill-id-456",
 "proficiency": 5
 }
]

response = requests.put(url, json=payload, headers=headers)
print(response.status_code)

Verify the proficiency value. It must be within the range of 1 to 5, inclusive. Values outside this range will result in a 400 error. Refer to the CXone documentation for detailed schema specifications.

2 Likes