
# GoHighLevel (GHL) Integration

Already using GoHighLevel (GHL) to manage your business? This integration lets you add <span data-t="appName">DM Champ</span>'s AI-powered messaging on top of your existing GHL setup. Messages that come into GHL are forwarded to <span data-t="appName">DM Champ</span> for AI-powered handling, and replies from <span data-t="appName">DM Champ</span> are sent back through GHL to the customer on the original channel.

> Using a different CRM? It does not need a dedicated screen to work with <span data-t="appName">DM Champ</span>: see [Connecting a Tool We Do Not List](connecting-other-tools.md) for custom functions, the API and webhooks.

This means you can keep using GHL as your main hub while letting the AI handle the AI-driven conversations.

::: note
**Note:** This is a more technical integration that involves setting up automated workflows and connecting systems using webhooks (automatic notifications between apps) and API calls. If you're not comfortable with this, you may want to hand this page to a developer or tech-savvy team member.
:::


---

## Prerequisites

- An active **<span data-t="appName">DM Champ</span> account** with your API key (found at **Settings → Integrations → API Key**). An API key is a unique code that lets GHL securely communicate with your account.
- A **GoHighLevel account** with permission to create workflows and manage webhooks (automated notifications between systems).

---

## How It Works

| Direction | What Happens |
|---|---|
| **GHL to <span data-t="appName">DM Champ</span>** | A customer messages you on SMS, email, Messenger, Instagram, or live chat in GHL. A workflow automatically forwards that message to <span data-t="appName">DM Champ</span>. <span data-t="appName">DM Champ</span> processes it (AI response, tagging, etc.). |
| **<span data-t="appName">DM Champ</span> to GHL** | When <span data-t="appName">DM Champ</span> sends a reply (manually or via AI), it automatically notifies GHL. A workflow in GHL finds the contact and sends the reply through the correct channel. |

---

## Workflow 1: GHL to <span data-t="appName">DM Champ</span>

This workflow forwards incoming messages from GHL to <span data-t="appName">DM Champ</span>.

### Step 1: Create the Workflow

1. In GHL, go to **Automation > Workflows**.
2. Click **Create New Workflow**.
3. Name it something descriptive, such as "Send Message to <span data-t="appName">DM Champ</span>."

### Step 2: Add Triggers

Add a trigger for each channel you want to forward:

- Customer Replied - SMS
- Customer Replied - Email
- Customer Replied - Facebook Message
- Customer Replied - Instagram DM
- Customer Replied - Live Chat

You can add all of them or only the channels relevant to your setup.

### Step 3: Add Tag Filter (Optional)

If you only want to forward messages from specific contacts:

1. Click **Add Filter** on the trigger.
2. Set the condition to "Contact has tag."
3. Choose your tag(s).
4. Select whether the contact should have **any** or **all** of the selected tags.

### Step 4: Create a Channel Split

Add a **Condition** action to route each channel to its own webhook:

| Branch | Condition |
|---|---|
| Branch 1 | Message source equals `Email` |
| Branch 2 | Message source equals `SMS` |
| Branch 3 | Message source equals `Messenger` |
| Branch 4 | Message source equals `Instagram` |
| Branch 5 | Message source equals `Live Chat` |

### Step 5: Configure Webhooks

For each branch, add a **Webhook / HTTP Request** action:

- **Method:** `POST`
- **URL:**
  ```
  https://api.dmchamp.com/v1/incoming_custom_channel_message?apiKey=YOUR_API_KEY
  ```

- **Custom Data fields:**

| Field | Value | Notes |
|---|---|---|
| `messageSid` | `{{right_now.second}}{{contact.id}}` | Unique message identifier |
| `fromId` | `{{contact.id}}` | GHL contact ID |
| `toId` | `{{user.id}}` | Your GHL user ID |
| `body` | `{{message.body}}` | The message content |
| `channel` | See table below | Must match the branch |
| `status` | `created` | Always set to `created` |
| `messageType` | `text` | Message type |

**Channel values per branch:**

| Branch | `channel` value |
|---|---|
| Email | `email` |
| SMS | `sms` |
| Messenger | `messenger` |
| Instagram | `ig` |
| Live Chat | `livechat` |

::: warning
**Important:** Make sure the `channel` value matches exactly — these are case-sensitive.
:::


### Step 6: Enable Re-Entry

In the workflow settings, make sure **Allow Re-entry** is enabled. Without this, only the first message from each contact will be forwarded.

---

## Workflow 2: DM Champ to GHL

This workflow receives replies from DM Champ and sends them to the customer through the correct GHL channel.

### Step 1: Create an Inbound Webhook in GHL

1. In GHL, go to **Settings > Developers / API**.
2. Click **Create New Webhook** (or "Inbound Webhook").
3. Name it "Messages."
4. Save and **copy the webhook URL** — you'll need it in the next step.

### Step 2: Configure DM Champ

1. In DM Champ, click **Settings** in the sidebar.
2. Under **Channels**, click **Channels**.
3. Scroll to the **Custom channel** card at the very bottom of the page.
4. Paste the GHL inbound webhook URL you just copied into **Webhook URL** (it must be a public HTTPS address) and click **Save**.

> **This is not the Settings → Integrations → Webhooks page.** That page is for event notifications and sends a different payload. The GHL outbound relay is set on the **Custom channel** card under **Settings → Channels**.

DM Champ will now automatically send a notification to GHL every time a message is sent to a contact. The data sent looks like this:

```json
{
  "contactId": "NtL97bwnhITrfIq8lWFi",
  "messageId": "s28dtg13qNuhXLoKpcLs",
  "userId": "wpDZRvaw4Hgh4whUBpwlKPRftOi2",
  "body": "Message content here",
  "toId": "qtpBsc6fiqkXTnSOeze3",
  "channel": "email"
}
```

> **Nav note:** the API Key you use for Workflow 1 and the Custom channel card you use here live in different places — **Settings → Integrations → API Key** for the key, and the **Custom channel** card at the bottom of **Settings → Channels** for this relay. The separate **Settings → Integrations → Webhooks** page is for event notifications and sends a different payload; see [Webhooks](webhooks.md) if that is what you want instead.

### Step 3: Create the Response Workflow

1. In GHL, go to **Automation > Workflows**.
2. Create a new workflow named "Send Message to Contact."
3. Set the trigger to **Inbound Webhook** and select the webhook you created in Step 1.

### Step 4: Add a Find Contact Action

1. Add a **Find Contact** action.
2. Set the search field to **Contact ID**.
3. Use the value: `{{inboundWebhookRequest.toId}}`

### Step 5: Add an Optional Tag Check

If you want to limit which contacts receive messages from DM Champ:

1. Add a **Condition** action.
2. Check if the contact has a specific tag.
3. If the tag is missing, end the workflow (add a "Stop" action on the false branch).

### Step 6: Add a Channel Split

Add a **Condition** action that routes the message based on `{{inboundWebhookRequest.channel}}`:

| Branch | Condition | Action |
|---|---|---|
| Branch 1 | equals `email` | Send Email |
| Branch 2 | equals `sms` | Send SMS |
| Branch 3 | equals `messenger` | Send Facebook Message |
| Branch 4 | equals `ig` | Send Instagram Message |
| Branch 5 | equals `livechat` | Send Chat Message |

### Step 7: Configure Each Send Action

In each send action, set the message body to:

```
{{inboundWebhookRequest.body}}
```

### Step 8: Enable Re-Entry

As with Workflow 1, make sure **Allow Re-entry** is enabled in the workflow settings.

---

## Testing the Integration

### Test GHL to <span data-t="appName">DM Champ</span> (Workflow 1)

1. Send a message to your GHL number or connected channel (for example, send yourself an SMS).
2. Open <span data-t="appName">DM Champ</span> and verify the message appears in **Chats**.
3. Check that the channel label is correct (SMS, email, etc.).
4. Repeat for each channel you configured.

### Test <span data-t="appName">DM Champ</span> to GHL (Workflow 2)

1. In <span data-t="appName">DM Champ</span>, send a reply to a contact (manually or let the AI respond).
2. Open GHL and verify the contact received the message.
3. Confirm it was sent through the correct channel.
4. Check that the message content matches.

---

## Troubleshooting

| Problem | What to Check |
|---|---|
| Messages not reaching <span data-t="appName">DM Champ</span> | Verify your API key is correct in the webhook URL. Check that the workflow triggers are firing (GHL workflow logs). Confirm Allow Re-entry is enabled. |
| Messages not reaching GHL | Verify the GHL inbound webhook URL is correctly pasted into **Webhook URL** on the **Custom channel** card at the bottom of **Settings → Channels** (not on the Settings → Integrations → Webhooks page, which is a different feature). Check the GHL inbound webhook is active. Review the GHL workflow execution logs. |
| Contact not found in GHL | The `toId` in the webhook data must match an existing GHL contact ID. Make sure contacts exist in both systems with matching IDs. |
| Wrong channel used for reply | Double-check the channel values in your condition branches. They must match exactly: `email`, `sms`, `messenger`, `ig`, `livechat`. |
| Only first message is forwarded | Enable **Allow Re-entry** in both workflow settings. |

---

## Next Steps

- [Webhooks](webhooks.md) — set up webhooks for other <span data-t="appName">DM Champ</span> events.
- [API Access](api-access.md) — use the API for custom integrations beyond GHL.
- [Custom Channels](../messaging-channels/custom-channels.md) — learn more about custom channel messaging.
