Skip to main content
Use a Flow endpoint when you need to load screens dynamically or process data submitted by a WhatsApp user. Configure your public HTTPS URL as endpointUri when you create a Flow or update its metadata. This guide describes the plain JSON requests YCloud forwards to your endpoint. It does not describe a direct connection to Meta’s encrypted data endpoint. See Manage WhatsApp Flows for Flow creation, preview, publishing, and lifecycle management.

Before you begin

  • Expose a public HTTPS endpoint that accepts POST requests.
  • Return JSON within 15 seconds.
  • Define the screens and their data fields in your Flow JSON.
  • Generate a flow_token when sending the Flow message so you can correlate the interaction with your application session.
  • Use server-side validation before accepting submitted data.

Request flow

  1. The user opens or interacts with a Flow in WhatsApp.
  2. YCloud forwards a JSON request to your configured endpoint.
  3. Your endpoint reads action and processes the request.
  4. Your JSON response selects a screen and supplies its data, or completes the Flow.

Handle a health check

A health check contains action: ping:
Return:
Keep this path lightweight. Do not perform a business transaction during a health check.

Handle an error notification

Error notifications include data.error and data.error_message. They can use INIT or data_exchange as the action. Check for this error data before routing ordinary requests by action.
Record the error for investigation and return an acknowledgement:

Handle data exchange

Handle each action according to the screens you have defined:
The screen must exist in your Flow JSON. Its declared data schema must accept the fields in data.

Return a validation error

Stay on the current screen and return an error field that your screen displays:

Complete the Flow

Return screen: SUCCESS with extension_message_response.params. Include the original flow_token and any additional result fields you want in the Flow response message.
This closes the Flow and sends a Flow response message to the chat. Parse the result from the inbound Flow response webhook.

Implementation example

This Express example handles all three request categories. Match the screen IDs and response fields to your own Flow JSON. Mount any endpoint access controls used by your deployment before this handler.

Verify the endpoint

Test ping, error acknowledgement, INIT without screen or data, valid and invalid submissions, BACK, and SUCCESS completion. Check the 15-second response limit and confirm that the completion webhook carries your original flow_token. Preview the Flow before publishing it.