Handover API
The handover functionality in Kindly allows customer support agents to temporarily replace the bot as the user's conversation partner. From the user's perspective, the conversation with the support agent takes place in the same chat window as the conversation with the bot. While the support agent is in the chat, the bot will not respond to the user's messages, and when the support agent leaves the chat, the bot will return to the conversation.
Support agent handover can be requested by the user by clicking on a handover request button, which can be easily added to a reply like any other button. When a user requests a takover, customer support agents are notified in the platform, and can easily take over the conversation from the Conversations section in Kindly. However, if your organization has a customer service center using a different platform, it is possible to set up a connection between your current platform and Kindly to enable handover requests to be handled through your current platform.
As there does not exist a standarized protocol for this kind of functionality, you will need to do some development to create an intermediary service that can talk to both the Kindly API and the customer support platform's API. This document describes the protocol for communication between Kindly and the intermediate service.
The Handover API was previously named Takeover API, and for backwards compatibility the event names still have these names. The API paths api/v2/takeover/... and api/v2/handover/...are aliases for the same functions and you may use either.
To handle the communication between Kindly and your customer support platform, Kindly can either communicate directly with the customer support platform or with a intermediary service that forwards messages between the platforms.


You can find the handover configuration page on your workspace under Settings > Inbox > Handover

- Select external handover mode
- Set the webhook URL
- Get API key
- Set values for messages & business hours
The protocol is based on HTTP requests between Kindly and your service, where each type of request has a unique event name. When Kindly sends events to your service, they will all arrive at your webhook, and your service will have to decide how to handle them based on the event specified in the payload.
When you send events from your service to Kindly, you can use different API endpoints for different events. Kindly will respond with a payload that includes an event field to confirm that the request was received and that the parameters were valid.
When a user clicks on a request handover button in the chat, your service will receive a REQUESTING TAKEOVER event. Your service should respond with 200 OK to Kindly, then forward the request to the customer support platform.
It is probably useful for the customer service agent to be able to read what the user wrote to the bot and what the bot replied preceding the handover request. To get this info your service can POST to api/v2/handover/transcript. The API will respond with event: TRANSCRIPT and contain the message history that you can then show to the agent.
Transcripts can be long and take some time for the agent to read and understand. It's possible to ask Kindly's summarization service to read the chat transcript ahead of the agent joining and provide a short summary of the gist of the conversation. You can POST to api/v2/handover/summarize.
To make a summary, the chat has to contain 2 or more user messages that in total contains more than 30 characters.
The summarization is a call to a large language model that happens on the fly when you make the request. The request may take some time to process, and the result summary text may change between requests. The model is hosted in the EU.
When a customer service agent is ready to enter the chat, your service should POST to api/v2/handover/start with the relevant bot_id and chat_id. If the API key and the IDs are valid, Kindly will respond with event: TAKEOVER STARTED. The bot will inform the user that an agent is entering the chat and will no longer respond to the user's messages, until handover is ended by the agent.
The "sender" field is optional and not be displayed in the legacy version of the chat bubble.
When the customer service agent is ready to let the bot take over again, your service should POST to api/v2/handover/end with the relevant bot_id and chat_id. If the API key, and the ids are valid, Kindly will respond with event: TAKEOVER ENDED. The bot will inform the user that the agent has left the chat, and will resume responding to the user's messages.
The "sender" field is optional and not be displayed in the legacy version of the chat bubble.
Messages from the support platform to the user can be forwarded to the user by POSTing to api/v2/handover/message/. In addition to the message, you should also send a name and an avatar in the sender field, indicating to the user that the message is from an agent, not from the bot.
Optionally, you can also use buttons like in other API methods, for instance to share a link with the user.
If the POST to Kindly was correct, Kindly will respond with event: MESSAGE SENT TO USER.
When the chat is taken over, and the user sends a message, it will be forwarded to your webhook as a MESSAGE FROM USER event. Your service should respond 200 OK to Kindly, then forward it to the customer support platform.
Note: The attachment field will be present only if you have started the handover with the supports_attachment field set to true.
In certain cases we can detect that the user has left the chat:
- The user restarts the chat
- The user closes the tab or browser on a bot with the Resume conversation if user leaves site and then comes back option set to Never
Note for the last case, however, that if you are testing within the Kindly platform this option is overridden and set to Forever. To test the chat as a user it is recommended to use the demo page: .
In this case Kindly will send a request to your service with the event USER ENDED TAKEOVER. The payload will thus be something like
The messages that are sent from Kindly are authenticated using HMACs signed with the same key you use when sending messages to Kindly. See Checking webhook signatures (HMACs) for more info about authenticating HMACs.
It is also possible to use api/v2/handover/message/ for other messages than those being forwarded from the customer support agent. For instance, you could have the service tell the user their place in the queue when it changes.