Skip to main content
Dynamic WhatsApp Flows call your data endpoint to fetch screen content at runtime.

How it works

  1. User opens the flow in WhatsApp
  2. Meta sends an encrypted request to Kapso
  3. Kapso decrypts and forwards to your function
  4. Your function returns screen data
  5. Kapso encrypts and returns to Meta
  6. User sees the dynamic content

Setup requirements

Before using data endpoints:
  1. WhatsApp phone number - Set in the Info tab
  2. Flows encryption - One-time setup per phone number (Kapso handles the key exchange)
  3. Function - Your code that returns screen data

Request format

Kapso sends this payload to your function:
The data_exchange object contains Meta’s original payload with the current screen and any user-submitted data.

Response format

Your function must return:

Completing the flow

To end the flow and close it:

Limits

Error handling

If your function fails or times out, Kapso returns an error screen to the user. Check the Invocations in your function dashboard for debugging.