HITL On pause progamatically

Am using botpress 11.9.4 with
$ node -v

$ npm -v

$ yarn -v

I want to implement a functionality where the bot pauses and sends a message to a human agent . Then the human finds the conversation thread in hitl and talks to the user.

how i vision this on my bot should be, maybe if the user clicks a button (talk to agent ) , or type (talk to agent ) … the conversation is paused, the agent is alerted so they can talk to the user.

I dont know how to pause the conversation. I would want you to show me how you did this with a small example/screenshots ( for a newbie in botpress/javascript)

I will appreciate any help

@DigiSenseiZim @rndlaine any luck?


have you checked to tutorial for the hitl module?

-> https://botpress.io/docs/tutorials/hitl/

In short, you need to enable de hitl module and send an HTTP query to this end point:

POST /mod/hitl/sessions/{$id}/pause

There is an axios instance in the botpress sdk object which you can use like this:


you can look the axios package here: https://www.npmjs.com/package/axios

hope this information helps you!