# WhatsApp API Error PATTERN_MISMATCH in WhatsApp Flows
Author: Prashant Jangid
Author URL: https://www.heltar.com/blogs/author/prashant-jangid
Published: 2025-03-31
Category: Troubleshoot
Category URL: https://www.heltar.com/blogs/category/troubleshoot
Tags: WhatsApp Flows Error
Tag URLs: WhatsApp Flows Error (https://www.heltar.com/blogs/tag/whatsapp-flows-error)
URL: https://www.heltar.com/blogs/whatsapp-api-error-patternmismatch-in-whatsapp-flows-cm8wvm2p7009k4w8ioas5o4w5

If you're building a flow on WhatsApp and hit a **PATTERN\_MISMATCH** error, you're not alone. This is one of those errors that can be confusing at first, but it usually comes down to formatting issues in your JSON.

Here’s what the error typically looks like:

_PATTERN\_MISMATCH_

_Property (propertyName) should only consist of alphabets and underscores._

_Property (propertyName) should be of type '(type)' or have dynamic data format..._

Let’s unpack what this means and how you can fix it quickly.

## The Problem

Here’s a broken example that causes a PATTERN\_MISMATCH:

```
{
  "screens": [
    {
      "id": "FIRST_1",
      "layout": {
        "children": [
          {
            "type": "TextInput",
            "name": "Description",
            "label": "Enter decsription",
            "max-chars": "Hundred"
          }
        ]
      }
    }
  ]
}
```

There are two main issues here:

### 1\. id Format Issue

id: "FIRST\_1": WhatsApp Flow screen IDs must contain only alphabets and underscores.

Change it to "FIRST" or "FIRST\_SCREEN".

### 2\. max-chars Must Be a Number or Dynamic Expression

"max-chars": "Hundred": This should be a number like 100 or a dynamic variable like "${data.limit}".

## The Fix

```
Here’s the corrected version:

{
  "screens": [
    {
      "id": "FIRST_SCREEN",
      "layout": {
        "children": [
          {
            "type": "TextInput",
            "name": "Description",
            "label": "Enter description",
            "max-chars": 100
          }
        ]
      }
    }
  ]
}
```

Now everything is in the proper format:

- The screen ID uses only alphabets and underscores.

- max-chars is a valid number.


## Common Format Rules in WhatsApp Flows

Here’s a quick reference to avoid PATTERN\_MISMATCH errors in the future:

Property

Rule

id

Only alphabets and underscores (FIRST\_SCREEN, not FIRST\_1)

name

No spaces, special characters; stick to alphabets + underscores

max-chars

Must be a number (e.g. 100) or dynamic ("${data.maxLength}")

Dynamic Values

Must follow format like ${data.value} or ${screen.data.value}

Empty Strings

Not allowed in required fields

For more troubleshooting insights related to WhatsApp Business API, check out [heltar.com/blogs](http://heltar.com/blogs).


---
This blog is powered by Superblog. Visit https://superblog.ai to know more.
---

