I’m trying to update skill proficiencies for a batch of agents using the CXone Admin API. The documentation for /api/v2/admin/agents/skills says I can pass an array of assignments, but I keep getting a 400 error with a vague “Invalid request body” message.
Here is the JSON payload I’m sending via Postman (and my C# HttpClient):
[
{
"agentId": "12345678-1234-1234-1234-123456789012",
"skillId": "87654321-4321-4321-4321-210987654321",
"proficiency": 5
},
{
"agentId": "12345678-1234-1234-1234-123456789013",
"skillId": "87654321-4321-4321-4321-210987654321",
"proficiency": 3
}
]
The endpoint docs say: “Updates the skill proficiency for one or more agents.” I’m using PUT because the method signature in the Swagger spec implies a replacement operation for the collection. I’ve verified the agent IDs and skill IDs exist. Proficiency values are within the 1-5 range.
My C# code looks standard:
var content = new StringContent(json, Encoding.UTF8, "application/json");
var response = await httpClient.PutAsync("/api/v2/admin/agents/skills", content);
The response body is empty except for the error code. Is there a specific wrapper object required? The docs don’t show one, just the array. I’ve tried wrapping it in { "items": [...] } but that gives a 415 Unsupported Media Type. What am I missing?