# How to use Chat Assigned to Agent Webhook

Your team receives a new customer inquiry on WhatsApp. A team lead assigns the chat to an agent in DoubleTick. The agent starts handling the conversation. But in your CRM, that lead still shows the previous owner — or no owner at all.

Now your CRM and DoubleTick are out of sync. The agent working the lead in DoubleTick is not the same person shown as the owner in the CRM. If a manager pulls a report, the data is wrong. If a different team member looks up the lead in the CRM to make a call, they see the wrong agent's name. The same lead is being tracked differently across two systems, and someone has to manually fix it every time.

The **Chat Assigned to Agent Webhook** eliminates this problem entirely. The moment a chat is assigned or reassigned to any agent in DoubleTick, this webhook fires and your CRM is updated automatically — so lead ownership is always accurate, always current, and always consistent across both systems.

***

#### <mark style="color:$primary;">**What Is the Chat Assigned to Agent Webhook?**</mark>

In DoubleTick, every customer conversation can be assigned to a specific agent. This assignment can happen manually, through a bot workflow, or via an AI bot. The **Chat Assigned to Agent** webhook fires every time this assignment happens — including when a chat is reassigned from one agent to another.

The moment the assignment is made in DoubleTick, this webhook sends the full assignment details to your connected system instantly.

Think of it like a mirror between DoubleTick and your CRM. The moment agent ownership changes on one side, the other side reflects it automatically — without anyone having to log in, look up the record, and update it manually.

***

#### <mark style="color:$primary;">**When Does This Webhook Trigger?**</mark>

This webhook activates in all of these scenarios:

* A chat is manually assigned to an agent by a team lead or manager
* A chat is assigned automatically through a bot workflow
* A chat is assigned through an AI bot
* An existing chat is reassigned from one agent to another

Every assignment and reassignment is captured — no matter how it happens.

***

#### <mark style="color:$primary;">**Step-by-Step Setup Guide**</mark>

<figure><img src="https://2303112206-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F53n17VnOICC1LtDqlENV%2Fuploads%2F9zMugaJ6AYda45s3CFWd%2FUntitled%20design%20-%202026-04-02T120640.710.gif?alt=media&#x26;token=090bdfd6-062e-4ff1-8e3f-104a73f0ceb6" alt=""><figcaption></figcaption></figure>

#### <mark style="color:$primary;">**Step 1: Open Webhooks in DoubleTick**</mark>

1. Log in to your DoubleTick account
2. Go to **Settings**
3. Click on **Webhooks**

#### <mark style="color:$primary;">**Step 2: Create a New Webhook**</mark>

1. Click **New Webhook**
2. Give it a clear name — for example: `Chat Assignment Tracker`

#### <mark style="color:$primary;">**Step 3: Get Your Webhook URL**</mark>

You need a destination URL — this is where DoubleTick will send the assignment data every time a chat is assigned or reassigned.

You can connect it to:

* A **CRM** like Zoho, HubSpot, or Salesforce
* An **automation tool** like Zapier or Pabbly
* Your own **backend or internal system**

**For testing purposes**, you can use DoubleTick's **Bot Studio** to capture and preview the data first:

1. Open a new tab and go to **Bot Studio**
2. Click **Create New Bot**
3. Set the trigger to **On Webhook**
4. **Copy the webhook URL** that appears

#### <mark style="color:$primary;">**Step 4: Fill in Webhook Details**</mark>

1. Go back to the **Webhooks** page
2. Paste the webhook URL
3. Select your **API Number** (your WABA/WhatsApp Business number)
4. Click **Continue**

#### <mark style="color:$primary;">**Step 5: Choose the Event**</mark>

1. Select **Chat Assigned to Agent** from the event list
2. Click **Create Webhook**

Your webhook is now live and tracking every chat assignment the moment it happens.

***

#### <mark style="color:$primary;">**How to Test It**</mark>

1. Open any existing chat in DoubleTick
2. Assign or reassign the chat to any agent
3. Go to **Bot Studio → Capture Response → View Response Data**

You will see all the assignment data captured at the exact moment the chat was assigned.

***

#### <mark style="color:$primary;">**What Data Do You Receive?**</mark>

When this webhook fires, it sends the following information to your system:

| Field                     | What It Tells You                                             |
| ------------------------- | ------------------------------------------------------------- |
| Chat ID                   | The unique identifier of the conversation that was assigned   |
| Customer Phone            | The customer's WhatsApp number                                |
| Assigned User ID          | The unique ID of the agent the chat was assigned to           |
| Assigned User Name        | The full name of the agent                                    |
| Assigned User Email       | The email address of the agent                                |
| Assigned User Phone       | The phone number of the agent                                 |
| Assigned User Org Role    | The agent's role in the organisation — for example, Team Lead |
| Assigned User WABA Role   | The agent's role on the WhatsApp Business number              |
| Assigned User WABA Number | The WhatsApp Business number associated with this assignment  |
| Actor Name                | The name of the person who made the assignment                |
| Actor Type                | Whether the assignment was made by a user, bot, or AI         |
| Action Type               | Confirms this is an agent assignment action                   |

***

#### <mark style="color:$primary;">**Sample Payload**</mark>&#x20;

{% code expandable="true" %}

```json
{
  "chatId": "1e628113-0acf-4b05-b5b8-0877fe2f83f3",
  "message": {
    "text": "Chat has been assigned to Aditya Pachore",
    "actorId": "user_hxvTkEeiQb",
    "actorName": "Ruchi Dalvi",
    "actorType": "USER",
    "variables": {
      "agentId": "user_7uoQR4OOiW",
      "agentName": "Aditya Pachore"
    },
    "actionType": "ASSIGN_AGENT",
    "messageType": "system_message_v2"
  },
  "customerPhone": "919372139459",
  "assignedUserId": "user_7uoQR4OOiW",
  "assignedUserName": "Aditya Pachore",
  "assignedUserEmail": "aditya.pachore@quicksell.co",
  "assignedUserPhone": "918169777492",
  "assignedUserOrgRole": "Team Lead",
  "assignedUserWabaRole": "NEW_CHAT_SUPPORT_2",
  "assignedUserWabaNumber": "918356849474"
}
```

{% endcode %}

The **assignedUserName**, **assignedUserEmail**, and **assignedUserPhone** fields are what make CRM sync possible. Your CRM can use any of these to identify the correct agent record and update the lead owner automatically. The **actorName** field tells you who made the assignment — which is useful for maintaining an audit trail of every ownership change.

***

#### <mark style="color:$primary;">**Real-Life Business Use Case: A B2B Sales Team Keeping Lead Ownership Perfectly Synced Between DoubleTick and Their CRM**</mark>

**The Situation**

A B2B software company manages their entire sales pipeline through a CRM. Every inbound lead — whether from a website form, a LinkedIn ad, or a WhatsApp inquiry — is created as a record in the CRM with a designated lead owner. That lead owner is the salesperson responsible for following up, nurturing the relationship, and closing the deal.

The company also uses DoubleTick for all WhatsApp communication. When a new inquiry comes in on WhatsApp, a team lead reviews it and assigns the chat to the most suitable salesperson based on the lead's industry, location, or deal size. This assignment happens inside DoubleTick.

**The Problem**

The moment a team lead assigned a chat in DoubleTick, two things needed to happen: the salesperson needed to start handling the WhatsApp conversation, and the CRM lead record needed to be updated to show them as the new owner. Only the first happened automatically. The second — updating the CRM — had to be done manually.

In practice, this manual step was inconsistently followed. Salespeople were working leads in DoubleTick that still showed someone else as the CRM owner. When a sales manager pulled a pipeline report from the CRM, the lead ownership data was unreliable. Leads were being attributed to the wrong salesperson, commission calculations were disputed, and performance reviews were based on inaccurate numbers.

Reassignments made the problem worse. If a lead was reassigned from one salesperson to another — because the original agent was on leave, or because the deal had grown in size and needed a senior closer — the CRM would often still show the first agent as the owner for days, because no one had updated it.

The sales manager was spending time every week manually auditing the CRM against DoubleTick to reconcile ownership discrepancies. It was a time-consuming, frustrating, and entirely avoidable process.

**The Solution**

The company connects this webhook directly to their CRM.

The moment a team lead assigns or reassigns a chat in DoubleTick, the webhook fires and sends the assignment details to the CRM. The CRM uses the customer's phone number from the **customerPhone** field to locate the correct lead record, and then updates the lead owner to the newly assigned agent — using the **assignedUserName** and **assignedUserEmail** fields to match the correct CRM user profile.

This happens in seconds. By the time the salesperson opens DoubleTick to start handling the conversation, their name is already showing as the lead owner in the CRM.

Reassignments work the same way. When a chat is moved from one agent to another in DoubleTick, the webhook fires again and the CRM lead ownership updates immediately to reflect the new agent — with no manual intervention from anyone.

The **actorName** field is also logged in the CRM as a note on the lead record — capturing who made the assignment. This creates a clean audit trail showing every ownership change, who initiated it, and when.

**The Result**

* CRM lead ownership is always accurate and always in sync with DoubleTick — the moment an assignment is made, both systems reflect the same agent
* Salespeople never work a lead in DoubleTick while a different name shows as the owner in the CRM
* Pipeline reports and performance data are reliable because ownership records are updated automatically and in real time
* Reassignments are handled cleanly — the CRM reflects the current owner immediately, with a logged history of every previous assignment
* The sales manager no longer spends time manually reconciling ownership data between two systems
* Commission attribution and performance reviews are based on accurate, automatically maintained ownership records

***

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

The Chat Assigned to Agent Webhook solves one of the most common and frustrating data consistency problems in sales and support teams — the gap between who is handling a conversation in DoubleTick and who the CRM thinks owns that lead. The moment any chat is assigned or reassigned in DoubleTick, your CRM is updated automatically. No manual steps. No reconciliation work. No ownership disputes.

Set it up once, and your two most important systems will always tell the same story about who owns every lead.
