> ## Documentation Index
> Fetch the complete documentation index at: https://chatbase.co/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Connect your AI agent to viaSocket

> Connect your AI agent to viaSocket with webhooks to automate tasks across your apps, with no code

viaSocket is a no-code workflow automation platform. You connect a Chatbase AI agent to it with Chatbase webhooks: Chatbase sends an event, such as a new lead, to a viaSocket webhook URL, and your viaSocket flow passes it on to other apps. Webhooks need a paid plan. This guide walks through one complete example: receiving leads from your AI agent and automatically adding them to a Google Docs document.

> [card] What you can do:
>
> Send what your AI agent captures into any app viaSocket supports, triggered by a Chatbase webhook the moment it happens.

## Before you start

* A Chatbase account with an AI agent, on a paid plan, which webhooks need. If you haven't built an AI agent yet, follow [Your first AI agent](https://chatbase.co/docs/user-guides/quick-start/your-first-agent.md).
* A viaSocket account.
* For the lead example, a [Collect Leads](https://chatbase.co/docs/user-guides/chatbot/actions/collect-leads.md) Action on your AI agent.

## Which Chatbase events you can send

Where you add the viaSocket webhook URL depends on the event:

| Event | Where to add the webhook |
| - | - |
| Lead collected (`leads.submit`) | The **Collect Leads** Action editor, in the **Destinations** section |
| Data collected by a Collect Data Action | The **Collect Data** Action editor, in the **Destinations** section |
| Custom form submitted | The custom form Action's **Webhooks** section, or **Settings > Webhooks** |
| Phone call summary | **Settings > Webhooks**, while the Phone channel is active |
| Helpdesk events | **Settings > Webhooks** |

See [Webhooks](https://chatbase.co/docs/developer-guides/webhooks.md) for each event's payload.

## What you can automate

| Automation | How it works |
| - | - |
| **Lead generation** | Capture leads through form submissions and add them to your CRM, such as HubSpot or Salesforce, for follow-up |
| **Customer support** | Trigger support tickets in systems like Zendesk or Freshdesk when your AI agent receives a customer inquiry |
| **Email campaigns** | Add contacts from your AI agent to Mailchimp or ActiveCampaign, then send personalized follow-up emails |
| **Multi-platform support** | Deploy AI agents across websites, mobile apps, and messaging services to reach users wherever they are |
| **Social media management** | Trigger social media updates or create posts based on customer interactions with your AI agent |
| **E-commerce notifications** | Automate stock updates, order confirmations, or promotional notifications based on customer interactions |

## How to connect viaSocket

**1. Set up a trigger in viaSocket**

1. Sign in to your viaSocket account.
2. Click **Create New Flow** in the top-left corner of the viaSocket homepage.

![Creating a new flow in viaSocket](https://mintcdn.com/chatbase/kU-6NVMb2BBkym9H/user-guides/integrations/images/viaSocket/viasocket-1.png?fit=max\&auto=format\&n=kU-6NVMb2BBkym9H\&q=85\&s=0808d82cc7ab08df8c67117a662d4763)

3. In the Flow editor, click **Select Trigger**.

![Selecting a trigger in the viaSocket flow editor](https://mintcdn.com/chatbase/kU-6NVMb2BBkym9H/user-guides/integrations/images/viaSocket/viasocket-2.png?fit=max\&auto=format\&n=kU-6NVMb2BBkym9H\&q=85\&s=f62c7c462be045c3d862e94ddc6ab626)

4. Select **Webhook** as the trigger, then copy the generated Webhook URL.

![Copying the generated webhook URL in viaSocket](https://mintcdn.com/chatbase/kU-6NVMb2BBkym9H/user-guides/integrations/images/viaSocket/viasocket-3.png?fit=max\&auto=format\&n=kU-6NVMb2BBkym9H\&q=85\&s=dedb24e2026ae2ead159dda3c0dba222)

**2. Configure the trigger in Chatbase**

For leads, add the webhook to your Collect Leads Action:

1. Navigate to your Chatbase [dashboard](https://www.chatbase.co/dashboard/).
2. Click the AI agent you wish to integrate with viaSocket.
3. Go to **Build > Actions** and open your **Collect Leads** Action.
4. Open the **Destinations** section, paste the copied Webhook URL, click **Create webhook**, then save your changes. See [Destinations](https://chatbase.co/docs/user-guides/chatbot/actions/collect-leads.md#destinations).

For custom form, phone call summary, or Helpdesk events, use **Settings > Webhooks** instead: select the events you want to trigger, paste the copied Webhook URL into the **Endpoint** field, then click **Create Webhook**. The **Webhooks** tab notes: "Webhooks for collected leads and collected data are managed in their Action editors, under Destinations."

![Creating a webhook in Chatbase settings](https://mintcdn.com/chatbase/bO49Edenw4JMFhBZ/user-guides/integrations/images/viaSocket/viasocket-6.png?fit=max\&auto=format\&n=bO49Edenw4JMFhBZ\&q=85\&s=b8791970ccd27e5cc0471104408f32c2)

**3. Set up an action to automate tasks**

1. Go back to the viaSocket Flow Builder and click **Select Action**.

![Selecting an action in the viaSocket flow builder](https://mintcdn.com/chatbase/kU-6NVMb2BBkym9H/user-guides/integrations/images/viaSocket/viasocket-8.png?fit=max\&auto=format\&n=kU-6NVMb2BBkym9H\&q=85\&s=a3211e1300fe76a6e0dccee8a14ae781)

2. Choose the **Google Docs** action: *Append Text to Document*.

![Choosing the Append Text to Document action](https://mintcdn.com/chatbase/kU-6NVMb2BBkym9H/user-guides/integrations/images/viaSocket/viasocket-9.png?fit=max\&auto=format\&n=kU-6NVMb2BBkym9H\&q=85\&s=19c7c3818a1d287db7f506c1179bf9ab)

3. Establish a connection and configure your action with the required details.

![Configuring the Google Docs action in viaSocket](https://mintcdn.com/chatbase/kU-6NVMb2BBkym9H/user-guides/integrations/images/viaSocket/viasocket-10.png?fit=max\&auto=format\&n=kU-6NVMb2BBkym9H\&q=85\&s=3aec77e621515ce7fd653d41d133fa34)

**4. Test and publish the flow**

![Testing and publishing the viaSocket flow](https://mintcdn.com/chatbase/kU-6NVMb2BBkym9H/user-guides/integrations/images/viaSocket/viasocket-11.png?fit=max\&auto=format\&n=kU-6NVMb2BBkym9H\&q=85\&s=c77deb2d651c9ac6c4779f909e424fa3)

> [!TIP]
>
> Trigger a lead capture on your site and confirm it's added to your designated Google Docs file.

## Frequently asked questions

> [accordion] Which Chatbase plan do I need to use viaSocket?
>
> Any paid plan, because the connection uses Chatbase webhooks, which need one.

> [accordion] Why don't leads show up under Settings > Webhooks?
>
> Lead and Collect Data webhooks are managed in each Action's editor, under **Destinations**. **Settings > Webhooks** covers custom forms, phone call summaries, and Helpdesk events.

> [accordion] What data does viaSocket receive for a lead?
>
> Each lead arrives as a `POST` request with `eventType` (`leads.submit`), `chatbotId` (your Agent ID), and a `payload` with the customer's name, email, phone, the conversation ID, and any custom fields on your Collect Leads Action. See [Webhooks](https://chatbase.co/docs/developer-guides/webhooks.md#event-payload).

> [accordion] Should I use viaSocket or Zapier?
>
> Either works for leads. Zapier has a Chatbase app with a **Form Submission** trigger and a **Send Prompt** action. With viaSocket, you connect through webhooks, which also cover Collect Data, custom form, phone call summary, and Helpdesk events. See [Zapier](https://chatbase.co/docs/user-guides/integrations/zapier.md).

## Next steps

> [card] [Webhooks](https://chatbase.co/docs/developer-guides/webhooks.md)
>
> See every event Chatbase can send, and what each payload contains.

> [card] [Zapier](https://chatbase.co/docs/user-guides/integrations/zapier.md)
>
> An alternative no-code automation platform, with a native Chatbase app.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.