JS SDK: 400 Bad Request on POST /api/v2/interactions/{id}/wrapup with valid code ID

Hey everyone. I’m hitting a weird 400 error when trying to set a wrap-up code programmatically via the Node.js SDK. The interaction is already in a closed state, so I’m using the POST /api/v2/interactions/{interactionId}/wrapup endpoint as documented.

I’ve double-checked the wrapupCodeId against the list returned by GET /api/v2/users/{userId}/wrapupcodes. It’s definitely valid and assigned to the user associated with the participant. The payload looks correct, but the API keeps rejecting it.

Here’s the request payload I’m sending:

{
 "wrapupCodeId": "a1b2c3d4-5678-90ab-cdef-1234567890ab",
 "text": "Issue resolved - billing inquiry"
}

The error response doesn’t give much detail:

{
 "message": "The request could not be understood by the server due to malformed syntax.",
 "documentation": "https://developer.genesys.cloud"
}

I’m using genesys-cloud@2.0.1. Is there a specific header I need to include, or maybe the text field is causing issues if it’s too long? I’ve tried removing the text field entirely but still get the 400. Anyone else run into this with the JS SDK?