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

# Flow Events

> Receive a POST from FlowIQ whenever someone starts a flow, a flow sends them a message, or their run ends.

Register a URL with [Create Webhook](https://docs.flowapt.com/flowiq-api-reference/endpoint/create-webhook.md) using `"platform": "flows"`, or add it in the app under **Automation → Webhooks → Event webhooks → Add → Events from: Flows**. FlowIQ then POSTs every matching event from every flow on your account: a running feed for your CRM, data warehouse or reporting.

```bash theme={null}
curl -X POST "https://api.flowiq.live/set-webhooks" \
  -H "Authorization: Bearer fiq_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://your-system.example.com/flowiq/flows",
    "platform": "flows",
    "type": "all",
    "secret": "a-long-random-string"
  }'
```

> [!NOTE]
>
> This is a feed of every flow. To call your system at one point in one flow (for example "add them to the CRM when they reach this step"), use the flow step [Send to your webhook](https://docs.flowapt.com/flowiq-api-reference/flow-definition.md#send-to-your-webhook) instead: it has its own URL and is not one of these webhooks.

Register one webhook per event with `type` set to the event name, or one with `"type": "all"`. The same authentication options as the other webhooks apply (`auth_type`: bearer, basic, api\_key, oauth2\_client\_credentials), and with a `secret` every request carries an `X-Flowiq-Signature: sha256=<hex>` HMAC of the raw body ([how to verify](https://docs.flowapt.com/flowiq-api-reference/webhooks.md#verifying-signatures)). Test runs (Test in the flow editor) send nothing.

## Events

| `event_type` | When |
| - | - |
| `flow.started` | Someone entered a flow (a run started) |
| `flow.message_sent` | A WhatsApp or email step in the run sent its message. `step` says which |
| `flow.finished` | The run ended. `result.status` is `completed`, `cancelled` (stopped early: `result.reason` says why, for example `exit_rule`, `conditions_not_met`, `flow_disabled`, `recipient_not_contactable`) or `failed` (`result.error`) |

## Payload

```json theme={null}
{
  "event_type": "flow.message_sent",
  "event_id": "85108ffa-31c7-43e6-ad8f-47efdb48ee74",
  "occurred_at": "2026-12-01T22:50:29.592Z",
  "organization_id": "c3243e47-…",
  "flow": { "id": "7c869e84-…", "name": "Abandoned checkout" },
  "run_id": "9597ac9d-…",
  "contact": { "id": "f97d6d20-…", "full_name": "Jane Mokoena", "whatsapp_id": "27821234567", "email": "jane@example.com" },
  "trigger_event": "checkouts/create",
  "step": { "id": "m1", "type": "action", "channel": "whatsapp", "template_name": "cart_reminder_v2", "message_id": "0b1c…" },
  "result": null
}
```

| Field | Notes |
| - | - |
| `event_id` | Unique per event (also in the `X-Flowiq-Event-Id` header). A retry resends the same id: use it to ignore a repeat |
| `run_id` | One person's run through one flow. Every event of that run carries it |
| `trigger_event` | What started the flow, for example `orders/paid`, `contact.tag_added`, `api.event` |
| `step` | On `flow.message_sent`: the step's id, `type` (`action` = WhatsApp, `email`), `channel`, `template_name` (WhatsApp) and `message_id` (the message in the inbox). `null` otherwise |
| `result` | On `flow.finished`: `{ "status", "reason", "error" }`. `null` otherwise |

Headers: `X-Flowiq-Event` (the event type), `X-Flowiq-Event-Id`, `X-Flowiq-Delivery-Id`, `X-Flowiq-Attempt`, `X-Flowiq-Timestamp`, and `X-Flowiq-Signature` when a secret is set.

> [!NOTE]
>
> Events are recorded in the same save as the run change, so none is lost while your endpoint is down. Answer with a `2xx` within 10 seconds and do the work afterwards. A failed delivery is retried for about 33 hours ([how](https://docs.flowapt.com/flowiq-api-reference/webhooks.md#delivery-behaviour)), and every attempt is in the [delivery log](https://docs.flowapt.com/flowiq-api-reference/endpoint/list-webhook-deliveries.md). For counts per step and per path, use the flow's [report](https://docs.flowapt.com/flowiq-api-reference/endpoint/flow-report.md).


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