# How to Map Webhook Data to Customer Fields in ZazzyAgent

Receiving a webhook is only the beginning.

An external system may send ZazzyAgent information such as:

```json
{
  "name": "Rahul",
  "phone": "+919XXXXXXXXX",
  "email": "rahul@example.com",
  "lead_type": "Enterprise"
}
```

[ZazzyAgent](http://zazzyagent.com) needs to know what each value means and where it should be stored or used.

That's what **field mapping** is for.

## What is webhook field mapping?

Field mapping connects a value received from an external webhook to a field that ZazzyAgent can use.

For example:

```text
Webhook:
customer_name
       ↓
ZazzyAgent:
Name
```

Another:

```text
Webhook:
lead_type
       ↓
Custom Field:
Lead Type
```

## Why does mapping matter?

Without correct mapping, the webhook can arrive successfully while your automation still doesn't work.

You may see:

> Webhook received.

but later discover:

> Customer name is empty.

or:

> The phone number wasn't found.

The request arrived.

The problem is what happened **after** it arrived.

## Example webhook payload

Suppose your website sends:

```json
{
  "full_name": "Rahul Sharma",
  "customer_phone": "+919876543210",
  "service": "Consultation",
  "budget": "50000"
}
```

You could map:

| Incoming field | ZazzyAgent destination |
| --- | --- |
| full\_name | Name |
| customer\_phone | Phone |
| service | Service Interest |
| budget | Budget |

The exact available system fields and custom fields depend on your configuration.

## Step 1: Send a test webhook

Before mapping anything, send a real sample request from the external system.

The sample should contain realistic values.

For example:

```text
Name: Rahul Sharma
Phone: +919876543210
Service: Consultation
Budget: 50000
```

This makes it easier to identify each incoming field.

## Step 2: Inspect the received payload

Look at the webhook data ZazzyAgent captured.

You may see fields such as:

```text
full_name
customer_phone
service
budget
```

Pay attention to the exact names.

Don't assume:

```text
phone
```

and:

```text
customer_phone
```

are the same thing.

They are different field names unless you map them accordingly.

## Step 3: Decide where each value belongs

For each incoming value, ask:

> Is this a standard customer property?

or:

> Is this business-specific information?

For example:

### Standard information

Name

Phone

Email

### Business-specific information

Budget

Service Interest

Company Size

Preferred Date

Use custom fields for information specific to your business.

## Step 4: Create custom fields where needed

Suppose your webhook sends:

```text
budget
```

and you don't already have a Budget field.

Create an appropriate custom field.

For example:

> Budget

Then map the incoming `budget` value to it.

See [ZazzyAgent Custom Fields Guide](https://blog.zazzyagent.com/zazzyagent-custom-fields-guide).

## Step 5: Map the phone number carefully

Phone mapping is especially important when the webhook will trigger a WhatsApp message.

Your workflow needs to know which customer the phone number belongs to.

Make sure the external system sends the number in the expected international format.

For example:

```text
+919876543210
```

rather than an ambiguous local format.

## Step 6: Map the name

If the incoming field is:

```text
full_name
```

and your destination is the customer's name field, connect those values appropriately.

Then your automation can personalize messages where supported.

## Step 7: Map custom information

Suppose the webhook contains:

```text
service = Consultation
```

Create or select:

> Service Interest

Then map:

```text
service
   ↓
Service Interest
```

## Step 8: Use mapped data in the next step

Once the information is stored correctly, your workflow can use it.

For example:

```text
Webhook
   ↓
Map Lead Type
   ↓
Condition
   ↓
Enterprise?
 ↙       ↘
Yes       No
 ↓         ↓
Sales     Standard
```

## Use mapped webhook data in messages

Suppose the webhook sends:

```text
name = Rahul
```

You can use the stored customer value in a suitable message.

For example:

> Hi Rahul, thanks for your enquiry.

## Use mapped data in conditions

Suppose:

```text
lead_type = Enterprise
```

You can route the conversation differently.

This is where mapping becomes more than simple data storage.

## Use mapped data with APIs

Webhook data can also become the input to another API call.

For example:

```text
Webhook
   ↓
Order Number
   ↓
HTTP API
   ↓
Order Status
```

See [How to Use HTTP API in ZazzyAgent Flow Builder](https://blog.zazzyagent.com/how-to-use-http-api-zazzyagent-flow-builder).

## Use mapped data with labels

Suppose:

```text
lead_type = Enterprise
```

Your automation can apply an appropriate label.

For example:

> Enterprise Lead

## Check field types

A common mistake is treating every value as plain text.

For example:

```text
budget
```

may need to be treated as a number for numeric comparisons.

Likewise:

```text
email
```

should be stored using an appropriate email field where available.

The field type affects how the data can be validated and used later.

## Check nested JSON

External systems don't always send flat data.

You might receive:

```json
{
  "customer": {
    "name": "Rahul",
    "phone": "+919876543210"
  }
}
```

Here, the information isn't directly at the top level.

You need to understand the payload structure before mapping it.

## What if the field is missing?

Your external system may sometimes send:

```text
name
phone
```

but omit:

```text
email
```

Don't assume every webhook contains every field.

Your automation should account for missing values.

## What if a field is empty?

An empty value is different from a missing value.

For example:

```text
email = ""
```

means the field exists but contains no value.

You can use conditions or validation where appropriate.

## Common mapping mistakes

### Correct webhook, wrong field

The request arrived, but you're using the wrong field name.

### Phone isn't mapped

ZazzyAgent cannot identify the intended WhatsApp recipient.

### Custom field doesn't exist

Create the field before mapping.

### Wrong value type

A numeric field may receive unexpected text.

### Nested data ignored

The value exists inside another object in the JSON structure.

## Test with one customer first

Don't test using 500 live leads.

Send one test request.

Check:

*   Correct customer
    
*   Correct name
    
*   Correct phone
    
*   Correct custom fields
    
*   Correct next action
    

Then move to production.

## A useful debugging sequence

```text
Webhook received?
       ↓
Correct payload?
       ↓
Correct field name?
       ↓
Correct destination?
       ↓
Value saved?
       ↓
Next automation uses it?
```

That sequence tells you where the problem actually is.

## The key idea

A webhook delivers the data.

**Mapping gives the data meaning inside ZazzyAgent.**

Once the mapping is correct, the same information can drive messages, conditions, actions, APIs and customer management.
