Data Action - POST 400

Hi all,

Something strange is happening with a data action - it’s failing with a 400. The payload looks correct in Terraform, but the actual POST request being sent seems…off. It’s like there’s an encoding issue somewhere.

We’ve got a data action set up to POST to a custom endpoint - pretty simple stuff. It’s triggered from an Architect flow on after-call. The flow’s sending the {{call.id}} and {{caller.phoneNumber}} as parameters.

Here’s the Terraform for the data action:

resource "genesyscloud_dataaction" "example" {
 name = "Post Call Data"
 version = "1.0"
 description = "Sends call data to custom endpoint"
 method = "POST"
 url = "https://example.com/api/v2/calls"
 request_body = jsonencode({
 call_id = "{{call.id}}"
 caller_number = "{{caller.phoneNumber}}"
 })
}

The API endpoint expects JSON. It’s not super fancy. When I look at the Genesys Cloud Data Action logs, this is what I see in the request payload:

{
 "call_id": "\u007b\u007bcall.id\u007d\u007d",
 "caller_number": "\u007b\u007bcaller.phoneNumber\u007d\u007d"
}

Notice the \u007b\u007d bits? Those are escaped curly braces. It’s treating the template variables like strings instead of evaluating them. It looks like the jsonencode function is escaping the curly braces intended for variable interpolation.

We’re on Genesys Cloud, API version v2. Terraform provider is v3.66.0.

Is anyone else seen this? Is there a way to tell Terraform to not escape those braces? Or maybe a different way to build the request body that won’t cause this? We tried setting escape_special_characters = false but it didn’t make a difference.

Also - does anyone know if there’s a way to see the actual request that’s sent from the Data Action, like a raw HTTP log? The ones in the UI are not showing the full details.