# How to Use the Add Chat Collaborators API

In DoubleTick, a chat collaborator is an agent who is added to a conversation so they can view and participate in it alongside the primary assigned agent. While you can add collaborators manually from within the chat, the Add Chat Collaborators API lets you do this programmatically, making it possible to automate the process as part of a bot flow or backend workflow.

The full API reference is available here: <https://docs.doubletick.io/reference/public-chat-collaborators-add>

***

#### <mark style="color:$primary;">**What You Need Before You Start**</mark>

To use this API, you need the following four pieces of information.

The first is the **customer's phone number**. This is the number of the person whose conversation you want to add a collaborator to. Include the country code.

The second is your **WhatsApp API number**. This is the DoubleTick-connected number on which that conversation exists. Include the country code.

The third is the **agent's phone number**. This is the phone number of the agent you want to add as a collaborator to that conversation. Include the country code.

The fourth is your **API key**, which goes into the header of the request. To find it, go to **Settings** inside DoubleTick, open the **Developer Documentation** section, and copy the key displayed there.

***

#### <mark style="color:$primary;">**How to use Add Collaborator API**</mark>

<figure><img src="/files/gZNxjXLjUtAKs4lD9lbS" alt=""><figcaption></figcaption></figure>

* Open the API reference page: <https://docs.doubletick.io/reference/public-chat-collaborators-add>
* Enter the **customer's phone number** with country code in the designated field.
* Enter your **WhatsApp API number** with country code in the designated field.
* Enter the **agent's phone number** with country code in the designated field.
* Go to **Settings** inside DoubleTick, open **Developer Documentation**, and copy your **API key**.
* Paste the API key into the **header field** of the API call.
* Click the **Try It** button to test the request.
* A successful response will return a **200 Success** code, confirming that the collaborator has been added to the conversation.

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 added should now appear as a collaborator on that chat.

***

#### <mark style="color:$primary;">**Adding Add Collaborator API to a Bot or Workflow**</mark>

<figure><img src="/files/ijjMLahK8tLUxXoToExD" alt=""><figcaption></figcaption></figure>

If you want to add a collaborator automatically at a specific point in a bot conversation, you can embed this API call inside DoubleTick's **Bot Studio**.

* On the API reference page, generate the **cURL** for your call and copy it.
* Open the relevant bot in **Bot Studio**.
* Add a new action component and select **Call API** from the list.
* Connect it to the step at which the collaborator should be added.
* Click the API dropdown and select **Create New API**.
* Choose **Import from cURL**, paste the cURL, and name the API, for example **Add Collaborator**.
* Save the API.

Once saved, the bot will automatically call this API whenever it reaches that step, adding the specified agent as a collaborator to the active conversation.

***

#### <mark style="color:$primary;">**Summary**</mark>

The Add Chat Collaborators API gives you the flexibility to assign collaborators to conversations without doing it manually, whether you are handling a one-off case from the documentation portal or automating the step inside a bot flow. If you run into any issues while setting this up, reach out to the **DoubleTick support team** for assistance.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://learn.doubletick.io/developer-documentation/how-to-use-the-add-chat-collaborators-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
