Setting wrap-up codes post-interaction via API?

Trying to set wrap-up codes programmatically after a voice interaction ends. I’m trying to update the wrap-up code for the conversation, but I’m getting a 400 Bad Request saying the field is immutable or invalid.

{
 "wrapupCode": {
 "id": "abc-123"
 }
}

Is there a specific endpoint for this? Or do I need to use the internal flow data action instead?