RevoplyAIDocs
Flow triggers

Flow triggers

Start a WhatsApp flow for a customer when something happens in your system, by posting JSON to the flow's private URL.

A flow whose trigger is Your system sends an event gets a private URL. When your system posts JSON to it (an order shipped, a form filled in, a payment failed), the flow starts for the customer the JSON names, on your WhatsApp Business number.

POST https://api.revoplyai.com/hooks/rvh_EXAMPLE…
Content-Type: application/json
Idempotency-Key: order-10482-shipped

Flow triggers are part of the Business plan. Only an Owner or an Admin can set them up.

Rules

  • WhatsApp Business numbers only. The flow sends from a whatsapp channel: a number connected through Meta. A WhatsApp QR number cannot be used.
  • The flow must start with a template. The customer has not written, so no service window is open; the flow cannot be published until it sends a template before anything else. See WhatsApp messaging rules.
  • The URL is the credential. There is no API key: anyone who has the URL can start the flow. Call it from your server only, never from a browser or an app.
  • An account can have up to 20 flow trigger URLs.

Set one up

  1. In Automations, create a flow and choose the trigger Your system sends an event.
  2. Choose the WhatsApp number the flow messages customers from.
  3. Create the URL and copy it. It is shown in full only once; afterwards the builder shows only its start.
  4. Say where the customer's phone number is in your JSON, such as customer.phone. Optionally, say where their name and language are, and which values to keep as variables for the flow's steps. Send one request first and the builder offers its fields to tap. See Sending requests.
  5. Build the flow, starting with a template step, then publish it and switch it on.

What happens when a request is accepted

  1. We find the contact with that number, or create one (a new contact is tagged webhook), and the WhatsApp conversation with them on the flow's number, or create it.
  2. A run of the flow is queued, and you get 202 with "status": "accepted" and the run's id at once. The run has not sent anything yet.
  3. When the run ends, flow.completed or flow.failed carries the same run id, if an endpoint subscribes to them.

When the customer answers, their reply lands in the conversation the flow is waiting in.

Every other answer is explained in Responses and errors.

Replace the URL

Replace the URL in the trigger makes a new URL and shows it once. The old URL stops working at once and answers 404 not_found; update every system that sends to it. Replace it whenever it may have leaked. Idempotency keys already used on the flow stay used.

When requests are refused on our side

If flow triggers are paused on our side, or we cannot count requests, every request is answered 503 service_unavailable. Retry later with the same Idempotency-Key.

On this page