# Assign labels to chats

### Overview

The **Assign Labels to Chats** automation allows you to automatically tag customer conversations based on specific keywords. This helps categorize chats for better organization and enables you to track trends in the **Analytics Dashboard**.

For example, you can automatically assign a **"Refund"** label when a customer mentions *"Refund"*, *"Money back"*, or similar phrases. This makes it easier to monitor and analyze refund-related inquiries over time.

***

### How to set up label automation

1. **Go to Basic Automations** – Navigate to the **Basic Automations** tab in the side navigation.
2. **Click "Create New Automation"** – This will open the automation setup.
3. **Select "Assign Labels to Chats"** – This option enables automatic labeling based on keywords.
4. **Choose Messaging Channels** – Select the channels where this automation should apply.
5. **Enter Trigger Keywords** – Add words or phrases that will trigger the label assignment.
   * You can also use **AI variables** such as `"Address"` or `"Mobile Number"`, ensuring the label is applied when relevant information is detected.
6. **Assign a Label** – Choose which label should be applied when a keyword is detected.
7. **Name Your Automation** – Give it a recognizable name for easy reference.
8. **Click "Create Automation"** – The system will now automatically assign labels when a customer’s message contains a specified keyword.


---

# 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://help.zaapi.com/automations/basic-automations/assign-labels-to-chats.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.
