Studio REST Proxy 422 on Quality Evaluations POST with custom evaluationItem array

Step one: the compliance team wants every handled call to auto-generate a baseline quality score before the agent hits wrap-up, so the post-call logic routes through a Studio SNIPPET that builds the payload and fires it off via REST Proxy. The flow grabs the interaction UUID from the triggerEvent, maps the disposition codes to our internal category IDs, and constructs the JSON body.

Step two: the request hits POST /api/v2/quality/evaluations and immediately returns a 422 Unprocessable Entity. The response payload looks like this: {"code":"VALIDATION_ERROR","message":"evaluationItem[0].category must be a valid reference to a configured evaluation category.","path":"$.body.evaluationItem[0].category"}.

The category UUID gets validated directly in the CXone portal, and it matches the Compliance v3 category currently used for manual QA. The snippet logs the exact UUID before the HTTP call, so there’s no string truncation happening. Here’s the payload structure being sent: const payload = { "interactionId": triggerEvent.interaction.uuid, "status": "COMPLETED", "evaluationItem": [ { "category": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "score": 100, "metadata": { "auto_generated": true } } ] };. The REST Proxy action is configured with Content-Type: application/json and the standard OAuth Bearer token from the flow context.

Environment details and steps already tried:

  • CXone Region: UK1 (London)
  • Studio Flow version: 4.2.1
  • SNIPPET runtime: Node.js 18 LTS
  • REST Proxy action: POST method, timeout set to 30s
  • Category UUID verified via GET /api/v2/quality/evaluation-categories returns active status
  • Swapped status field between COMPLETED, IN_PROGRESS, and DRAFT - same 422 response
  • Tested payload directly in Postman with identical headers and it posts fine without the validation error
  • Added evaluationId field to the body just in case the API expects it on creation, got 400 BAD_REQUEST instead

Step three: the Postman test works because the session token has admin scope, but the REST Proxy is running under the flow execution context which binds to the interaction participant token. Could the scope limitation be masking the actual category reference, or does the API reject the metadata object when attached to an auto-sourced evaluation? The logs show the request leaves the snippet exactly as formatted, and the 422 comes back within 200ms. No rate limiting headers in the response.

Checking the Quality API docs again and the evaluationItem schema seems to require a weight field when scoring against a multi-criteria category, but the portal shows that category as single-score. Might be a mismatch in how the API interprets the category structure versus the UI configuration. Spinning wheels on this one. The payload looks clean but the API keeps rejecting it. Queue’s sitting idle while I debug this.