Edit Json Returned on API call

I’m using rasa for a voice assistant and I want to make sure the communication flows smoothly for the user. With that in mind, I don’t require the user to click on a button or say a hot word before every sentence he wants to send to the bot. The user will say the hotword once, and as the conversation goes, I automatically open the mic once Rasa is no longer talking to gather more information.

I’m asking for guides on how to edit the response so when a conversation has finished I send a flag and don’t open the mic afterwards. For example, after a user has checked information on how to book a flight and says “goodbye”, the bot should respond goodbye and close the mic.

This is how my current response looks like
[
      {
            “recipient_id”: “083555CD29134C3F9F3EFC43D7E96276”,
            “text”: “Goodbye!”
      }
]

I would like to change this to something of this effect:
[
      {
            “recipient_id”: “083555CD29134C3F9F3EFC43D7E96276”,
            “text”: “Goodbye!”,
            “open_mic”: 0
      }
]

I am connecting with rasa through socketio and rest.
I am concerned that, even if this is possible, I would only be able to modify the json response using a custom action. But that’s a next problem. Any tips? Thanks!