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

# Send Flow to Contact: Trigger Automation for a Contact

> Trigger a ChatbotX automation flow for a specific contact, optionally targeting a particular inbox channel for the flow execution.

The Send Flow endpoint triggers a configured automation flow for a specific contact. You provide the `flowId` of the flow you want to run, and optionally an `inboxId` to specify which channel the flow should execute on. If `inboxId` is omitted, ChatbotX uses the contact's last active channel. A successful request returns HTTP `204 No Content`.

<Info>
  **POST** `/api/v1/contacts/{identifier}/flows`
</Info>

## Path Parameters

<ParamField path="identifier" type="string" required>
  A contact lookup string. Minimum length: 1 character.

  | Format          | Example                  |
  | --------------- | ------------------------ |
  | `id:<value>`    | `id:123456789`           |
  | `email:<value>` | `email:user@example.com` |
  | `phone:<value>` | `phone:+84708123123`     |
</ParamField>

## Request Body

<ParamField body="flowId" type="string" required>
  The ID of the flow to trigger. Must be a numeric string matching the pattern `\d+`. Call `GET /api/v1/flows` to list available flow IDs in your Workspace.
</ParamField>

<ParamField body="inboxId" type="string">
  The inbox (channel) to execute the flow on. If omitted, ChatbotX uses the contact's last active channel. Must be a numeric string matching `\d+`.
</ParamField>

## Code Examples

<CodeGroup>
  ```bash curl theme={null}
  curl --request POST \
    --url "https://app.chatbotx.io/api/v1/contacts/email:user@example.com/flows" \
    --header "Authorization: Bearer YOUR_API_TOKEN" \
    --header "Content-Type: application/json" \
    --data '{
      "flowId": "55",
      "inboxId": "42"
    }'
  ```

  ```python Python theme={null}
  import requests

  identifier = "email:user@example.com"
  url = f"https://app.chatbotx.io/api/v1/contacts/{identifier}/flows"
  headers = {
      "Authorization": "Bearer YOUR_API_TOKEN",
      "Content-Type": "application/json"
  }
  payload = {
      "flowId": "55",
      "inboxId": "42"
  }

  response = requests.post(url, json=payload, headers=headers)
  print(response.status_code)  # 204 on success
  ```

  ```javascript JavaScript theme={null}
  const identifier = 'email:user@example.com';
  const options = {
    method: 'POST',
    headers: {
      Authorization: 'Bearer YOUR_API_TOKEN',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      flowId: '55',
      inboxId: '42'
    })
  };

  fetch(`https://app.chatbotx.io/api/v1/contacts/${identifier}/flows`, options)
    .then(res => {
      if (res.status === 204) console.log('Flow triggered successfully');
    })
    .catch(err => console.error(err));
  ```
</CodeGroup>

## Response

A successful request returns **HTTP 204 No Content** with no response body, confirming that the flow has been triggered for the contact.

```
HTTP/1.1 204 No Content
```

<Tip>
  To find the correct `flowId`, call `GET /api/v1/flows` to list all flows in your Workspace. To find the correct `inboxId`, call `GET /api/v1/channels`.
</Tip>
