Skip to main content

Data Exchange

Data exchange lets your flow communicate with your server in real time. When a customer interacts with your flow, WhatsApp sends data to your endpoint, your server processes it, and returns dynamic content — all in the blink of an eye.

Use data exchange when you need to:

  • Fetch dynamic data — available time slots, product prices, account details
  • Validate input — check if a coupon code is valid, verify an email isn't already registered
  • Process submissions — create a booking, update a record, trigger a notification

How it works

  1. Switch to Smart Flow — Click the flow mode button in the builder header to switch from "Simple Flow" to "Smart Flow". This enables data exchange for the flow.
  2. Endpoint URI — An endpoint URL is auto-generated for your flow (read-only — managed automatically by EzPulze)
  3. Configure a footer action — Add a footer with the "Data Exchange" action on the screen where you need server communication
  4. Customer taps the button — WhatsApp collects the form data and sends it to your endpoint
  5. Your server responds — Return dynamic data that populates the next screen
  6. Customer sees the result — The next screen loads with the server-provided data
info

Data exchange is also auto-enabled when you configure an External API data source on any component — the flow automatically switches to Smart Flow mode.

Customer fills form → Taps button → WhatsApp encrypts data → Your server

Customer sees next screen ← WhatsApp decrypts ← Server responds ←─┘

Encryption

All data exchange communication is encrypted end-to-end using RSA-2048 + AES-128-GCM:

  1. WhatsApp encrypts the request payload using your public key
  2. EzPulze decrypts the payload using your private key
  3. Your flow logic processes the data
  4. EzPulze encrypts the response using the same AES key
  5. WhatsApp decrypts and displays the result to the customer

Encryption keys are managed automatically by EzPulze. You can rotate keys from the settings if needed — for example, as a security best practice or if you suspect the keys may have been compromised.


To trigger a data exchange from a screen:

  1. Click on the Footer component
  2. Set the action type to Data Exchange
  3. Configure the payload — a JSON object with ${form.field} references
📸
Screenshot: Footer configuration with Data Exchange action selected and a JSON payload template
footer-data-exchange.png
1. Click the Footer component on a screen
2. Select "Data Exchange" as the action type
3. Add a payload with form field references
4. Capture the configuration panel
Save to: static/img/screenshots/developer-tools/whatsapp-flows/data-exchange/footer-data-exchange.png

Example payload:

{
"name": "${form.full_name}",
"email": "${form.email}",
"service": "${form.service_type}"
}

When the customer taps the button:

  1. The ${form.field} references are replaced with the customer's actual input values
  2. The payload is encrypted and sent to your endpoint
  3. Your server processes the data and returns the next screen's content
  4. The customer is navigated to the next screen with the server-provided data

Update Data action

The Update Data action (available in WhatsApp Flow JSON v7.1+) sends data to your server and updates the current screen without navigating to a different screen.

This is useful for:

  • Dependent dropdowns — selecting a country updates the city dropdown
  • Live calculations — updating a quantity recalculates the total price
  • Inline validation — checking if a username is available without leaving the screen

Configure it the same way as Data Exchange — set the footer or navigation list action to "Update Data" and provide a payload.


Validation rules

When using Smart Flow mode, you can add server-side validation rules for each screen. These rules validate the customer's input before your server processes it — catching errors early and showing clear error messages.

Configuring validation

  1. Open the screen where you want to add validation
  2. Click Validation Rules in the screen settings
  3. For each field, add one or more validators
📸
Screenshot: Validation configuration dialog showing field-level validators with types, parameters, and custom error messages
validation-config.png
1. Open the validation rules dialog for a screen
2. Add validators for email (required, email format) and phone (required, phone format, min length)
3. Capture the dialog showing the validator list with badges
Save to: static/img/screenshots/developer-tools/whatsapp-flows/data-exchange/validation-config.png

Available validators

Basic validators

ValidatorDescriptionExample
RequiredField must have a value"Please enter your name"
EmailMust be a valid email format"Please enter a valid email address"
PhoneMust be a valid phone number"Please enter a valid phone number"
URLMust be a valid URL"Please enter a valid URL"
NumericMust be a number"Please enter a number"

String validators

ValidatorParameterDescriptionExample
Min LengthminLengthMinimum number of characters"Must be at least 3 characters"
Max LengthmaxLengthMaximum number of characters"Must be less than 100 characters"
Patternpattern (regex)Must match a regex pattern"Must contain only letters and numbers"

Number validators

ValidatorParameterDescriptionExample
Min ValueminMinimum numeric value"Must be at least 1"
Max ValuemaxMaximum numeric value"Must be 100 or less"

Date validators

ValidatorDescriptionExample
Future DateDate must be in the future"Please select a future date"
Past DateDate must be in the past"Please select a past date"

Database validators

These validators check values against your database — useful for ensuring uniqueness or existence.

ValidatorDescriptionExample
Unique EmailEmail must not already exist in the database"This email is already registered"
Unique PhonePhone number must not already exist"This phone number is already registered"
Exists in DBValue must exist in a specified table/column"Invalid coupon code"

Custom error messages

Each validator can have a custom error message. If no custom message is provided, a default message is used. Keep messages short and helpful — tell the customer what they need to fix.

Validation summary

After configuring validators, a badge shows the number of validators on each field. This gives you a quick overview of which fields have validation rules.


Send test flow

Test your flow before publishing by sending it to a real WhatsApp number.

  1. Click Send Test from the flow builder or flow list page
  2. Configure the test options:
📸
Screenshot: Send Test Flow dialog showing recipient phone, flow token, first screen selection, and screen data editor
send-test-dialog.png
1. Click "Send Test" on a draft Smart Flow
2. Fill in the recipient phone number
3. Select a first screen and configure screen data
4. Capture the full dialog
Save to: static/img/screenshots/developer-tools/whatsapp-flows/data-exchange/send-test-dialog.png
OptionDescription
Recipient phoneThe WhatsApp number to send the test to
Flow tokenA token for tracking the test session (auto-generated for Smart Flows)
First screenWhich screen to show first (defaults to the first screen)
Request data on first screenWhether to trigger a data exchange request when the first screen opens
Screen dataA JSON editor (Monaco) where you can provide initial data for the first screen — useful for testing dynamic content without a running server
  1. Click Send
  2. The flow is delivered to the selected contact's WhatsApp
tip

You can send test flows for Draft flows — no need to publish first. This is the best way to test data exchange, dynamic data, and validation rules before going live.

tip

Send test flows to yourself or team members to verify the full experience on a real device.


Tips

  • Use Smart Flow only when needed — Simple forms that collect static data can stay as Simple Flows. Smart Flow adds API connectivity and requires a running server endpoint.
  • Test with the Send Test dialog — Use the screen data JSON editor to simulate server responses without setting up a server.
  • Add validation rules for critical fields — Email and phone validators catch typos early. Unique validators prevent duplicate registrations.
  • Use Update Data for dependent fields — When one field's value should change another (like country → city), Update Data keeps the user on the same screen.
  • Keep payloads small — Only send the fields you need. Large payloads slow down the data exchange.