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 wrong. /api/v2/users/skills doesn’t exist for bulk updates. You need to hit /api/v2/users/bulk/skills instead. Also make sure the payload structure matches the UserSkillBulkUpdateRequest schema exactly. It expects an array of objects with userId, skillId, and proficiency.

import requests

url = "https://api.mypurecloud.com/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)

Check the proficiency value. It has to be between 1 and 5. If you send 0 or anything outside that range, the API throws a 400.