How to Use the Remove Collaborators API

Once a collaborator has been added to a conversation in DoubleTick, there may be situations where you need to remove them, such as when their involvement in the case is complete or when a handoff has taken place. While you can remove collaborators manually from within the chat, the Remove Chat Collaborators API lets you do this programmatically, making it possible to automate the process as part of a bot flow or backend workflow.


What the Remove Collaborators API Does

For teams that need more flexibility, DoubleTick provides a Remove Chat Collaborators API. This is a tool meant for technical use cases, such as automatically removing a collaborator from a conversation when a certain condition is met inside a bot, or building the action into a backend workflow your team manages.

In simple terms, the API sends an instruction to DoubleTick saying: remove this agent as a collaborator from this specific conversation. DoubleTick then processes that request and removes the collaborator accordingly.


How to Use the Remove Collaborators API

The full API reference is available at the DoubleTick documentation portal. You can access it here: https://docs.doubletick.io/reference/public-chat-collaborators-removearrow-up-right

To make the API work, you need to provide three phone numbers and one API key.

  • Enter the customer's phone number — the number of the person whose conversation you want to remove a collaborator from. Include the country code.

  • Enter your WhatsApp API number — the DoubleTick-connected number on which that conversation exists. Include the country code.

  • Enter the agent's phone number — the phone number of the agent you want to remove as a collaborator. Include the country code.

  • To find your API key, go to Settings inside DoubleTick, open the Developer Documentation section, and copy the key displayed there. Paste it into the header field in the API call.

  • Once all values are filled in, click the Try It button on the documentation page to test the call.

  • If the request is successful, you will see a 200 Success response confirming that the collaborator has been removed from the conversation.


Adding this API to a Bot or Workflow

If you want a collaborator to be removed automatically at a certain point in a conversation, you can add the Remove Chat Collaborators API as an action inside DoubleTick's Bot Studio.

  • On the API documentation page, generate the cURL for your API call and copy it.

  • Open the bot in Bot Studio where you want to add this step.

  • Add a new action component and select Call API from the list.

  • Connect this component to whichever step should trigger the collaborator removal.

  • In the Call API component, click the API dropdown and select Create New API.

  • Choose Import from cURL, paste the cURL you copied, and give the API a name such as Remove Collaborator.

  • Save the API.

Once saved, the component will show all the headers and body parameters already filled in from your cURL. From this point, whenever the bot reaches that step during a live conversation, it will automatically call the Remove Chat Collaborators API and remove the specified agent from the conversation.


Verifying the Collaborator Has Been Removed

After the API is called, you can verify that it worked by opening the relevant conversation in DoubleTick. Go to the Chats section, search for the customer's number, and open the conversation. The agent you removed should no longer appear as a collaborator on that chat.


Summary

The Remove Chat Collaborators API gives your team precise control over who is involved in a conversation at any given point, whether you are handling it as a one-time action from the documentation portal or automating it as part of a larger bot or workflow. If you run into any issues while setting this up, reach out to the DoubleTick support team for assistance.

Last updated