Studio SNIPPET action failing on screen session creation with 422 validation error

What’s the correct way to pass nested config objects to the recording API from a Studio SNIPPET action without REST Proxy flattening the structure? Trying to spin up agent screen recordings dynamically from a flow instead of relying on the default interaction rules. Goal is to tie the recording session directly to the CRM case lookup so we get cleaner metadata. Running UK1 tenant, Studio build 2023.12.1, REST Proxy v2.

The SNIPPET action hits POST /api/v2/recording/screen-sessions. Payload looks like this:

{
 "agentId": "{{agent.id}}",
 "interactionId": "{{interaction.id}}",
 "sessionConfig": {
 "recordingSource": "AGENT_DESKTOP",
 "quality": "HIGH",
 "maxDurationSeconds": 1800
 },
 "metadata": {
 "caseRef": "{{crm.caseId}}",
 "triggerSource": "studio_flow"
 }
}

REST Proxy throws a 422 immediately. Response comes back with:

{
 "error": "Validation failed",
 "code": 422,
 "message": "Field 'sessionConfig.recordingSource' is required but received null",
 "details": ["Expected 'AGENT_DESKTOP' or 'APPLICATION', got undefined"]
}

Data Action mapping is set to pass the string literal directly. Checked the debug logs and the variable definitely resolves before the SNIPPET node runs. The weird part is the timestamp field. Studio injects createdTime automatically, but the API expects ISO 8601 with explicit UTC offsets. London is currently GMT+0, so the offset calculation in the flow might be stripping the Z suffix. If the backend parser chokes on a missing timezone indicator, it defaults the whole sessionConfig object to null.

Tried wrapping the value in a Data Action expression: {{"AGENT_DESKTOP"}} but that just adds extra quotes. You’ll see the proxy doesn’t handle nested objects well. It’s choking on the structure. We’ve tried flattening it, but it still fails. REST Proxy seems to flatten nested objects when the target schema isn’t explicitly defined in the proxy configuration. You have to map each leaf node individually instead of passing the whole JSON blob. Switched to individual field mappings, but the proxy still returns null for recordingSource.

Console shows the SNIPPET action status as COMPLETED_WITH_ERROR. Retries set to 2, but it just loops the same 422. Timeout is 15 seconds, which is plenty. Debug panel is doing jack all when the proxy fails. Mic stays hot on the agent side anyway. Not sure if the recording API enforces strict content-type headers that REST Proxy overrides to application/json anyway.

Flow diagram shows the SNIPPET node sitting right after the CRM lookup success branch. Agent soft phone is registered, screen capture agent is version 10.3.1. All prerequisites are met. The recording dashboard never shows a session attempt. Just a dead 422 in the logs.

<snippetAction id="screen_session_trigger">
 <httpMethod>POST</httpMethod>
 <url>https://api.nice.incontact.com/apis/2.0/recording/screen-sessions</url>
 <headers>
 <header key="Content-Type">application/json</header>
 </headers>
 <bodyMapping>
 <field path="sessionConfig.recordingSource" value="AGENT_DESKTOP" />
 </bodyMapping>
</snippetAction>

Proxy mapping syntax might be off. The XSD for the REST Proxy action doesn’t expose a nested path editor. Have to use the flat key format. Tried sessionConfig.recordingSource and sessionConfig[recordingSource]. Both fail. Logs just show the serialization step hanging before the actual HTTP call fires.