> ## Documentation Index
> Fetch the complete documentation index at: /docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Flow Builder API

> Trigger a published omnichannel flow from your own systems.

Flow Builder lets you design automated customer journeys in the CPaaS+ visual editor. One API call can start a multi-step flow across SMS, WhatsApp, Email and RCS, with dynamic variables injected at runtime. The flow then runs all configured steps, including messages, conditions and delays.

## Get your flow's webhook URL

The Base URL for this API is the unique webhook URL of the specific flow. It is generated when you publish the flow: in the portal, go to **Flow Builder, then your flow, then Webhook URL**.

```text theme={null}
https://api.yourcpaas.com/flow-api/webhook/trigger/{flow_id}
```

> [!WARNING]
>
> The flow must be **published and active** before you call this API.

## Trigger a flow

| Parameter | Required | Description |
| - | - | - |
| `phone` | Conditional | Recipient mobile number. Required if the flow uses SMS or WhatsApp. |
| `email` | Conditional | Recipient email address. Required if the flow uses Email. |
| `var1`, `var2`, ... | No | Dynamic values for the flow, for example customer name or order ID. How many you pass depends on how variables are configured in your flow. |

Provide `phone` and/or `email`, depending on the channels in the flow.

```bash theme={null}
curl --location --request POST 'https://api.yourcpaas.com/flow-api/webhook/trigger/FLOW_ID' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer YOUR_TOKEN' \
  --data '{
    "phone": "91XXXXXXXXXX",
    "email": "customer@example.com",
    "var1": "Variable1",
    "var2": "Variable2"
  }'
```

## Responses

> [tab] Success
>
> ```json theme={null}
> { "status": "success", "message": "Flow jobs dispatched successfully" }
> ```

> [tab] Flow not found
>
> ```json theme={null}
> { "status": "error", "message": "Flow not found." }
> ```

> [tab] Invalid body
>
> ```json theme={null}
> { "status": "error", "message": "Invalid JSON format. Please check your request body." }
> ```

| Error | Resolution |
| - | - |
| Invalid JSON format. Please check your request body. | Check that `phone`, `email` and variables are passed correctly as valid JSON. |
| Flow not found | Check the flow ID, and that the flow exists in the portal under Flow Builder. |
| Flow is not published or inactive | Publish and activate the flow in the portal before calling the API. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.