Sending custom payload as rest api response instead of text field in response

Hello,

I need to create custom payload to distinguish difference between text pdf url and image url

right now this is the response of rest api

[
    {
        "recipient_id": "916XXXX52498",
        "text": "Hey there, my name is Vars"
    }
]

is there a way to change the text filed to pdf_url or image_url in the custom actions

for example in my custom actions if i do

dispatcher.utter_message("Hi")

the response would be

[
    {
        "recipient_id": "916XXXX52498",
        "text": "Hi"
    }
]

is there anyway of doing like this dispatcher.utter_message("PDF_URL_HERE") in my custom action so that my response would look like this

[
    {
        "recipient_id": "916XXXX52498",
        "pdf_url": "PDF_URL_HERE"
    }
]

Thanks

Have you tried dispatcher.utter_message(json=your_json_object)?