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

# CSV in the Inbound Webhook

> Match call data against CSV columns and map results to variables before the conversation starts.

**CSV Lookup in the Inbound Webhook** compares values from an incoming call with selected columns in a CSV or TSV file. If exactly one matching row is found, its selected values are available as variables before the conversation starts.

The search runs automatically using call data. The assistant does not have to select it as a tool during the conversation. To search using information the caller provides during the conversation instead, create a [CSV Lookup tool](https://app.miyon.ai/docs/en/csv-lookup.md).

## Prerequisites

Your file needs at least one column whose values can be compared with incoming call data, such as a column of phone numbers. Other columns contain the values you want to use during the conversation.

CSV Lookup must be available for your tenant. The [file formats and upload limits](https://app.miyon.ai/docs/en/csv-lookup.md#file-format-and-limits) apply here too.

## 1. Choose a data source

In the voice agent, open **Advanced → Inbound Webhook → Configure**. Choose **CSV Lookup** under **Data source**.

Upload your CSV or TSV file or choose a file already uploaded to your tenant. One source can be used by CSV Lookup tools and multiple Inbound Webhooks at the same time.

![Inbound Webhook with CSV Lookup and file selection](https://mintcdn.com/miyon/OfBdKe6ObWa1SiJb/images/csv-lookup/inbound-upload.png?fit=max\&auto=format\&n=OfBdKe6ObWa1SiJb\&q=85\&s=e820a303666ffafee24103255c205f35)

You can upload a file or reuse an existing source.

After import, a preview appears. Check the columns and click **Continue**.

![Preview of the imported customer file](https://mintcdn.com/miyon/OfBdKe6ObWa1SiJb/images/csv-lookup/inbound-file.png?fit=max\&auto=format\&n=OfBdKe6ObWa1SiJb\&q=85\&s=7e8f386fe7b25ab23c317e2e9795091d)

The preview shows the detected columns and a sample of the imported data.

## 2. Configure the search and error handling

Under **Search by**, select the columns to match against. Choose the corresponding **Value from the call** for each column. For example, map a phone number column to **Caller number**.

![Search column phone\_number with caller number, timeout and error handling](https://mintcdn.com/miyon/OfBdKe6ObWa1SiJb/images/csv-lookup/inbound-search.png?fit=max\&auto=format\&n=OfBdKe6ObWa1SiJb\&q=85\&s=d341e19a751b947a569daf8f11a6da23)

The caller number is compared with phone\_number. Timeout and error handling appear above the columns.

### Available call values

| Selection | Technical name | Meaning |
| - | - | - |
| **Caller number** | `caller_number` | The incoming caller's number. It may be missing for anonymous calls. |
| **Called number** | `called_number` | The customer-facing destination number reached by the caller. |
| **Forwarded from** | `forwarded_from_number` | Forwarding information from telephony, if available. It may contain a phone number or a technical identifier. |

You can map one to three search columns. With multiple columns, all values must match in the same row. The application sets up the required index; you do not need to choose a technical index name.

> [!WARNING]
>
> Store phone numbers in the CSV in **E.164 format**, for example `+12025550101`: with `+` and the country code, without spaces or separators. CSV Lookup does not automatically convert other formats. Keep technical forwarding identifiers unchanged.

### Timeout and error handling

The **Timeout** limits how long the search may take before the call is answered. Values from **250 to 30,000 ms** are allowed; the default is **5,000 ms**. A longer timeout can delay answering the call accordingly.

Under **On error or timeout**, choose:

| Setting | Behavior |
| - | - |
| **Continue call with default values** | On a technical error, timeout or ambiguous result, the call continues using the configured defaults. |
| **Do not answer the call** | The call is not answered when these errors occur. |

**No match or a missing call value are separate cases:** the call continues with defaults, even if **Do not answer the call** was selected for errors.

## 3. Map found values to variables

Select the columns that should be available during the conversation. Only selected columns are mapped to variables.

For each selection, you can set the variable name and optionally enter a **Default value**. It is used when no usable value is available. Without a default, the variable remains empty.

![CSV column selection and mapping to pre-call variables](https://mintcdn.com/miyon/OfBdKe6ObWa1SiJb/images/csv-lookup/inbound-variables.png?fit=max\&auto=format\&n=OfBdKe6ObWa1SiJb\&q=85\&s=27faed02246534143dfbdc0f2367eefa)

Three CSV columns become three pre\_call variables. The plan and order status have default values.

Access a variable using `{{pre_call.variable_name}}`. The following mappings illustrate the format; your columns and variable names may differ.

| CSV column | Variable in the conversation |
| - | - |
| `first_name` | `{{pre_call.first_name}}` |
| `service_plan` | `{{pre_call.service_plan}}` |
| `order_status` | `{{pre_call.order_status}}` |

Use these variables in the greeting, AI instructions, supported tool fields or call forwarding. For example:

```text theme={null}
Hallo {{pre_call.first_name}}, willkommen beim Kundenservice.
Wie kann ich Ihnen helfen?
```

For the AI instructions:

```text theme={null}
# Kundenkontext
Tarif: {{pre_call.service_plan}}
Bestellstatus: {{pre_call.order_status}}
Verwende diese Angaben bei passenden Fragen. Wenn der Status „Nicht verfügbar“
lautet, erkläre, dass aktuell kein Bestellstatus vorliegt. Erfinde keinen Status.
```

## Save, test and enable

Click **Save configuration**. A new search is prepared only when saving. Switching between steps or selecting columns does not create an index here yet.

When making a change, an already active configuration remains available until its replacement is prepared. Wait for preparation to finish. **Test search** uses the saved configuration; save any unsaved changes first. The explanation appears on the unavailable test button.

**1. Open the search test**

Click **Test search**. The test window replaces the configuration dialog. **Back to configuration** returns you to your settings.

**2. Enter call values**

Enter a value from your file for each mapped call value. If the search uses only **Caller number**, the other two fields can stay empty.

**3. Check the result**

Click **Run test**. Check the resolved variables, their value sources and whether the call would continue. The search test does not place a phone call.

**4. Enable the Inbound Webhook**

Then check the **Inbound Webhook active** switch on the voice agent's card. Saving and testing do not replace enabling it.

![Successful CSV test with resolved pre-call variables](https://mintcdn.com/miyon/OfBdKe6ObWa1SiJb/images/csv-lookup/inbound-test.png?fit=max\&auto=format\&n=OfBdKe6ObWa1SiJb\&q=85\&s=37f2661dabc4eb5bab701b16ee6dda02)

The test result shows the mapped variables, their value sources and the execution time.

**Cancel**, the close icon or **Esc** discards unsaved configuration changes. A successfully imported upload may remain as a reusable CSV source afterwards.

## No match, multiple matches or errors

| Search result | Behavior |
| - | - |
| Exactly one row | Selected values are used. Empty values use their defaults where configured. |
| No matching row | Defaults are used; the call continues. |
| A required call value is missing | No search is made using an empty replacement value. The call continues with defaults. |
| Multiple matching rows | The result is ambiguous. The first row is not picked arbitrarily. Configured error handling applies. |
| Timeout or search service unavailable | Configured error handling applies. |

To check the default values, use a search value that does not appear in your file.

![CSV search test without a match, showing default values](https://mintcdn.com/miyon/OfBdKe6ObWa1SiJb/images/csv-lookup/inbound-no-match.png?fit=max\&auto=format\&n=OfBdKe6ObWa1SiJb\&q=85\&s=79258d2e8a0b98191ea802b9f6f2cef9)

When no row matches, the test shows the default values used.

Check your data so the chosen combination of search columns identifies a customer uniquely. This is particularly important when multiple contacts share the same phone number.

For an actual conversation, find the result under **Conversations → Open conversation → Inbound Webhook**. It also shows whether variables came from the file or from defaults.

## Update the file later

Open **Knowledge Base → CSV sources** and click **Update file** on the source. You do not need to select the file again in the Inbound Webhook.

All associated search configurations are prepared using the new data. Previous data remains available until the switch succeeds. Keep every column that a saved configuration uses for searching or for variables. After a successful update, the Inbound Webhook automatically uses the new file version; search mappings and variable settings are preserved.

![Search test after a file update, showing the changed order status](https://mintcdn.com/miyon/OfBdKe6ObWa1SiJb/images/csv-lookup/inbound-updated.png?fit=max\&auto=format\&n=OfBdKe6ObWa1SiJb\&q=85\&s=842d9c2aea35940d59bcf2e25708d427)

After the update, the same saved search returns values from the new file version.

The full guide to [updates, search configurations and deletion](https://app.miyon.ai/docs/en/csv-lookup.md#manage-csv-sources) also applies to Inbound sources. A source cannot be deleted while a saved Inbound configuration uses it, even if its switch is disabled.

## Limits for Inbound use

| Area | Limit |
| - | - |
| Mapped search columns | 1 to 3 |
| Accepted matches | Exactly one row |
| Timeout | 250 to 30,000 ms, default 5,000 ms |
| Pre-call variables | At most 25 per configuration |
| Combined variable size | 64 KiB for the serialized values including structure |

The [CSV limits](https://app.miyon.ai/docs/en/csv-lookup.md#file-format-and-limits) also apply. Select only the data needed before the conversation starts.


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