Pricing
Go to app
User Name
Upgrade Help Center

Webhooks: Customize your LiveChat experience

Wojciech Pollok
5 min read
updated: Nov 5, 2024

Webhooks allow you to create simple automated flows and custom LiveChat integrations. With webhooks you can, for example, set up automated email campaigns or update your customer’s info in a CRM.

Webhooks carry information about what’s happening in your chats within the context of your LiveChat account. They are like a notification for you and the platforms you want to integrate LiveChat with.

It all starts with defining what events you want to be notified about. Such events are called triggers because when they happen, they trigger sending a notification (webhook). One of the most commonly used triggers is incoming_chat, which notifies you whenever a new chat starts. 

So, if you set up an incoming_chat event trigger, LiveChat will send you a webhook every time a new chat starts on your license.

What are webhooks good for?Link icon

What makes webhooks so useful is that they carry usable business-wise information. When you set up an incoming_chat webhook, you will:

  • be notified every time a new chat starts,
  • get access to detailed information about that new chat, for example, chat_id, message content, who’s in the chat, etc.

You can leverage that information in a variety of ways – some of them are listed below, but the list could go on and on.

Use casesLink icon

  • Setting up automatic reminders.
  • Updating your customer’s info in a CRM.
  • Adding a visitor to a contact list in a marketing automation tool.
  • Analyzing chat content and reacting to keywords.
  • Collecting data to build custom reports and dashboards. 

How to set up a webhookLink icon

You’ll make the most out of webhooks if you set them up in the Text Developer Console. The Console gives you access to a broad variety of events (webhook triggers). You can choose from almost 40 events in several categories: chats, customers, bots, agents, tags, and more. See the full list.

1. Navigate to the Text Developer ConsoleLink icon

Log into the Developer Console using your LiveChat credentials. Your role at LiveChat must be admin or owner to complete this configuration.

In the Console, navigate to Your apps.

2. Create an applicationLink icon

Select Create a new app +.

This view offers you many options, but the only thing you need to do is to give your app a name.

Select Create app to proceed.

3. Add the App Authorization building blockLink icon

Your application will only need two building blocks. The first one you’ll configure is App Authorization. From the left-hand menu, select Building blocks.

And then select + Add building block.

Then, select the App Authorization block.

And Server-side app.

Select Save to proceed.

4. Configure the Chat Webhooks building blockLink icon

Next, we’ll configure the Chat Webhook building block. Select it from the list of available building blocks.

Select the Webhook triggers you need in your setup, for example: tag_created. In our example, webhooks will be sent every time a tag is created on your LiveChat account.

Add the Webhook URL: This is the address where your webhooks are supposed to deliver the information. In our example, we’ll use a dummy address. Go to https://webhook.site/ and copy the first URL you see, Your unique URL. Webhooks.site is a test website, and for the purpose of this tutorial, we will pretend it’s your application. Don’t close the webhook.site browser tab.

Paste the URL address you’ve just copied in the Webhook URL field. Save the changes.

5. Install the app privatelyLink icon

Navigate to Private Installation.

And select Install App. This will install the application privately, only on your license, so you can see it in action.

6. Test the appLink icon

Now log in to my.livechatinc.com, go to Settings > Tags, and add a new tag. Let’s name it test-webhooks, for the purpose of this tutorial. Navigate back to the webhooks.site browser tab and observe what’s happening.

You should receive a webhook tied to the action tag_created. The tag’s name should be test-webhooks. You can use that information to schedule further automation in the actual application; for example, to extract data and build custom reports upon it, etc. 

7. Uninstall the appLink icon

After you finish testing the app, go back to the Developer Console and go to the Private Installation tab to uninstall apps. Make sure to uninstall all test apps after completing your tests to avoid any unwanted charges.

Please uninstall all test apps after completing your tests to avoid any unwanted charges.

API pricingLink icon

If you plan to build custom applications that use webhooks, make sure you’re familiar with the current API pricing. Each new account has $25 worth of API calls, which is more than enough to cover all the tests you may perform.

Important: Make sure to uninstall the application so that you don’t leave webhooks enabled to avoid generating costs.

Webhook data exampleLink icon

{
  "webhook_id": "ddcbf1d5-ba78-4c1c-8509-2899f7ebd287",
  "secret_key": "******",
  "action": "incoming_chat",
  "organization_id": "450af9cf-c825-41ff-8172-eb4084e961e6",
  "payload": {
    "chat": {
      "id": "SB6UH7BDMQ",
      "users": [
        {
          "id": "8fb0e50d-0e27-4288-880d-f46d47121d2b",
          "name": "John Stadt",
          "email": "j.stadt@example.com",
          "present": true,
          "last_seen_timestamp": 0,
          "type": "customer",
          "created_at": "2024-04-12T16:04:16.657853Z",
          "last_visit": {
            "ip": "178.43.151.110",
            "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36",
            "geolocation": {
              "country": "Poland",
              "country_code": "PL",
              "region": "Lower Silesia",
              "city": "Wroclaw",
              "timezone": "Europe/Warsaw"
            },
            "started_at": "2024-04-18T13:54:55.362571Z",
            "last_pages": [
              {
                "opened_at": "2024-04-18T13:54:55.362571Z",
                "url": "https://cdn.livechatinc.com/preview/17658081?_ga=2.158446906.1277094554.1713432463-526819167.1712557321",
                "title": "Sample Page | Preview your chat window"
              }
            ]
          },
          "statistics": {
            "visits_count": 2,
            "threads_count": 2,
            "chats_count": 1,
            "page_views_count": 2,
            "greetings_shown_count": 1,
            "greetings_accepted_count": 1
          },
          "agent_last_event_created_at": "2024-04-18T13:55:02.300005Z",
          "customer_last_event_created_at": "1970-01-01T00:00:00.000000Z"
        },
        {
          "id": "a.kacperczyk+webhook-tutorial@text.com",
          "name": "Anne Kirby",
          "email": "a.kacperczyk+webhook-tutorial@text.com",
          "present": true,
          "last_seen_timestamp": 0,
          "type": "agent",
          "avatar": "https://api.text.com/file/accounts/avatars/450af9cf-c825-41ff-8172-eb4084e961e6/fc221174-55a3-4e66-95f0-bbee53dc8e11/25d3adbd-6175-4cc8-b24c-e90b66e952c4.jpeg",
          "routing_status": "accepting_chats",
          "visibility": "all"
        }
      ],
      "thread": {
        "id": "SC05V53BNQ",
        "created_at": "2024-04-18T13:55:02.300000Z",
        "active": true,
        "properties": {
          "routing": {
            "continuous": true,
            "group_status_at_start": "online",
            "idle": false,
            "pinned": true,
            "unassigned": false
          },
          "source": {
            "client_id": "bb9e5b2f1ab480e4a715977b7b1b4279"
          }
        },
        "user_ids": [
          "8fb0e50d-0e27-4288-880d-f46d47121d2b",
          "a.kacperczyk+webhook-tutorial@text.com"
        ],
        "events": [
          {
            "id": "SC05V53BNQ_1",
            "custom_id": "d9e543b8-54ad-484e-bd2a-6b0bbe84aee2",
            "visibility": "all",
            "created_at": "2024-04-18T13:55:02.300005Z",
            "author_id": "a.kacperczyk+webhook-tutorial@text.com",
            "properties": {
              "source": {
                "client_id": "bb9e5b2f1ab480e4a715977b7b1b4279"
              }
            },
            "type": "message",
            "text": "Hello. How may I help you?"
          }
        ],
        "access": {
          "group_ids": [
            0
          ]
        },
        "previous_thread_id": "SB6UH7BDNQ"
      },
      "properties": {
        "routing": {
          "continuous": true,
          "email_follow_up": true,
          "pinned": true,
          "was_pinned": false
        },
        "source": {
          "client_id": "c5e4f61e1a6c3b1521b541bc5c5a2ac5",
          "customer_client_id": "c5e4f61e1a6c3b1521b541bc5c5a2ac5"
        }
      },
      "access": {
        "group_ids": [
          0
        ]
      }
    }
  },
  "additional_data": {}
}

Was this article helpful?

Got it!

Thanks for your feedback.

Thank you!

We’re happy to help.

Start using LiveChat now!

Free 14-day trial AI-driven features No credit card required

Still not convinced? Discover all LiveChat features

Discover Text products: