> ## 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.

# Send an event

> Tell FlowIQ that something happened to a customer in your own system, and start the flows waiting for it.

Your system knows things FlowIQ does not: a quote was sent, a class was booked, a trial ends in three days. Send that moment to FlowIQ as an **event**, and every live flow whose trigger is **An event from your own system** with the same event name starts for that customer, with its own checks, waits, messages and sending hours.

Build the flow first: in FlowIQ, Automation, Flows, pick the trigger **An event from your own system** and give it an event name such as `quote_sent`.

The same flows also start when an event with that name reaches one of your **Endpoints** (Automation, Endpoints), the webhook addresses your notification Rules already use. Use whichever your system finds easier: this API with an API key, or an Endpoint address.

## Request

```
POST https://api.flowiq.live/v1/events
```

Use an organisation API key with **write** permission (Settings, API Keys) as a Bearer token.

| Field | Type | |
| - | - | - |
| `event` | string, up to 64 characters | Required. Letters, digits, `_` `.` `:` `-`, starting with a letter or digit. Matched to the flow's event name, ignoring case |
| `contact` | object | Required. Who it happened to: `{ "id": "<FlowIQ contact id>" }`, `{ "whatsapp": "+27 82 123 4567" }` or `{ "email": "sam@example.com" }`. `contact_id`, `whatsapp` or `email` at the top level work too. The contact must already exist on the account |
| `properties` | object, up to 50 keys | Optional. Details of the event. Keys are letters, digits and `_`. Each text, number or true/false value can be used in the flow's messages as `{{trigger.<key>}}` |
| `unique_id` | string, up to 120 characters | Optional. Your own id for this event. The same `unique_id` is accepted once, so a retry never starts a flow twice |

```bash theme={null}
curl -X POST "https://api.flowiq.live/v1/events" \
  -H "Authorization: Bearer fiq_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "event": "quote_sent",
    "contact": { "whatsapp": "+27 82 123 4567" },
    "properties": { "quote_total": 4500, "rep": "Sam" },
    "unique_id": "quote-8812"
  }'
```

A flow message can then say, for example:

```text theme={null}
Hi {{contact.first_name}}, {{trigger.rep}} sent your quote of R{{trigger.quote_total}}.
```

## Response

`202 Accepted`:

```json theme={null}
{
  "organization_id": "1d44e4c4-…",
  "accepted": true,
  "event_id": "54395961-29dd-4c3e-81b0-e58e13360974",
  "contact_id": "99c0f133-90ca-4fb4-97c9-7ec65d5a69d7",
  "event": "quote_sent",
  "flows_listening": 1
}
```

The flows start within a minute. `flows_listening` is how many live flows wait for this event name right now; `0` means the event was stored but nothing will start.

When `unique_id` was sent before, the answer is `200` with `{ "accepted": false, "duplicate": true }` and nothing starts.

## Errors

| HTTP | `code` | When |
| - | - | - |
| 400 | `validation_error` | A field is missing or malformed; `message` names it |
| 401 | `unauthorized` | Missing or invalid API key |
| 403 | `forbidden_scope` | The key has no **write** permission |
| 404 | `contact_not_found` | No contact with that id, WhatsApp number or email on this account |
| 409 / 422 | `idempotency_in_progress` / `idempotency_key_reused` | See [Conventions](https://docs.flowapt.com/flowiq-api-reference/conventions.md) |
| 429 | `rate_limited` | More than 600 events a minute on one key |


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