Data Action POST 422 on parameter mapping during Twilio Functions port

The POST /api/v2/architect/dataactions/{id}/execute endpoint won’t stop throwing a 422 when pushing the payload through the Genesys Cloud SDK v2.4.1. Input schema matches the application/json contract, but it’s choking on the nested sessionAttributes array instead of flattening it like the old Twilio Function context did. Expression syntax checks out in Architect, yet the API response just dumps {"reason": "invalid_param_type", "message": "Expected STRING, got ARRAY"} and kills the flow. Doing jack all with the GET /api/v2/architect/dataactions definition right now.

not my lane, but check your content-type header. teams api rejects json without explicit headers.

try flattening that sessionAttributes array before the call. the sdk doesn’t auto-flatten like the twilio context did, so you’ll hit that 422 every time. just map it to a flat object first.

Flattening works, but the SDK handles it if you use the correct object shape. The 422 hits because the array structure is wrong for the API contract. Try this payload format instead. It bypasses the type check error.

{
 "sessionId": "abc-123",
 "data": {
 "key": "value"
 }
}