# How to Use the Assign Team Member to Chat API

In DoubleTick, every incoming conversation can be assigned to a specific team member so the right person is responsible for responding. When a chat comes in and needs to go to a particular agent, you can assign it manually from the interface, or you can use DoubleTick's **Assign Team Member to Chat API** to do it automatically as part of a workflow or bot. This article walks you through both options.

***

#### <mark style="color:$primary;">**What the Assign Team Member to Chat API Does**</mark>

For teams that need to assign conversations automatically, DoubleTick provides the **Assign Team Member to Chat API**. This is designed for technical use cases such as routing a conversation to the right agent the moment a customer completes a certain step in a bot flow, or building assignment logic into a backend system your team manages.

In simple terms, the API sends an instruction to DoubleTick saying: **assign this customer's conversation to this team member**. DoubleTick then processes the request and makes the assignment. You can also use the **reassign** option to override an existing assignment if the conversation is already with someone else.

***

#### <mark style="color:$primary;">**How to Use the Assign Team Member to Chat API**</mark>

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

The full API reference is available at the DoubleTick documentation portal.

[Assign Team Member to Chat API Documentation](https://docs.doubletick.io/reference/assign-team-member-to-chat?utm_source=chatgpt.com)

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

* Enter the customer's phone number in the <mark style="color:red;">**`customerPhoneNumber`**</mark> field. This is the number of the person whose chat you want to assign.
* Enter the team member's phone number in the <mark style="color:red;">**`assignedUserPhoneNumber`**</mark> field. This is the number of the agent you want to assign the conversation to.
* **Both numbers must include the country code.**

If the chat is already assigned to someone and you want to override that, set the **reassign** field to **true**. If you leave this out or set it to **false**, the API will not override an existing assignment.

If your DoubleTick account is connected to more than one WhatsApp number, enter the relevant number in the <mark style="color:red;">**`wabaNumber`**</mark> field along with 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.

#### <mark style="color:$primary;">**Testing the API**</mark>

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 receive a **200 response**, confirming that the chat has been assigned to the team member whose number you entered.

***

#### <mark style="color:$primary;">**Adding the Assign Team Member API to a Bot or Workflow**</mark>

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

If you want the assignment to happen automatically at a certain point in a conversation, you can add this 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 assignment.
* 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 Assign Team Member.**
* **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 API and assign the chat to the specified team member.

***

#### <mark style="color:$primary;">**Confirming the Chat Has Been Assigned**</mark>

<figure><img src="/files/336kg5rhV8IjQcUE3rxO" alt=""><figcaption></figcaption></figure>

After the API is called, you can verify that it worked by opening the relevant conversation inside DoubleTick.

If the request was successful, you will see the **assigned team member's name** reflected in the chat, confirming that the assignment went through successfully.

***

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

The Assign Team Member to Chat API gives your team the ability to route conversations to the right agent automatically, whether that is triggered by a bot flow, a backend system, or a bulk operation. 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-assign-team-member-to-chat-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.
