ServiceNow REST API Data Action Failing with 400 Bad Request on Nested JSON Payload

Could someone explain the specific serialization behavior of Genesys Cloud Data Actions when handling complex nested objects destined for ServiceNow? We are observing a persistent HTTP 400 Bad Request when attempting to push digital channel interaction metadata via a Data Action configured as a standard POST request. The endpoint is our internal ServiceNow REST API wrapper, which expects a specific JSON structure.

The issue appears to be related to how Genesys Cloud handles the body parameter within the Data Action configuration. When passing a flat JSON object, the request succeeds. However, once we introduce nested arrays for agent_skills and interaction_history, the ServiceNow API rejects the payload, citing an invalid JSON structure in the error response body. I have verified the payload manually against the ServiceNow schema using Postman, and it validates correctly. This suggests the Data Action might be double-encoding the JSON string or stripping necessary escape characters during the outbound call.

Here is the payload structure we are attempting to send:

{
 "incident": {
 "short_description": "Digital Channel Interaction - WebChat",
 "description": "Customer inquiry regarding billing discrepancy.",
 "caller_id": {
 "display_value": "123456789"
 },
 "u_interaction_metadata": {
 "channel": "webchat",
 "session_id": "sess_abc123",
 "agent_skills": ["billing", "english"],
 "transcript_summary": "Agent resolved billing issue after verifying account status."
 }
 }
}

The Genesys Cloud flow logs show the Data Action returning a 400 error with the message: Invalid JSON in request body. I have tried setting the Content-Type header explicitly to application/json within the Data Action configuration, but the result remains unchanged. Is there a known limitation with nested objects in Data Action bodies, or should we be using a different approach, such as base64 encoding the payload before transmission? Any insights into the exact serialization format Genesys Cloud uses for these outbound requests would be appreciated.

Have you tried setting Content-Type: application/json and ensuring the body is a raw string rather than an object? The Data Action often fails to serialize nested structures correctly without explicit stringification.

The problem is that Genesys Cloud Data Actions expect the body to be a pre-formatted JSON string, not a serialized object, much like how Zendesk API calls require explicit string payloads. Wrapping the nested structure in a raw string literal usually resolves the 400 error immediately.