---
title: API Trigger
slug: api-trigger
docTags: 
createdAt: 2022-05-11T06:46:16.000Z
---

## <font color="#ae1536">1. Overview</font>

The **API Trigger** feature allows you to start a chatbot flow using an API call, without requiring the user to interact with the bot manually.

This is useful for:

- Automating workflows&#x20;
- Triggering bot actions from external systems&#x20;
- Passing user data directly into bot flows

**NOTE: This feature is only for WhatsApp and RCS channel.**

## <font color="#ae1536">2. Availability</font>

API Trigger is available in our Enterprise plans based on an entitlement, please reach out to support\@engati.ai for assistance.

## <font color="#ae1536">3. Working Mechanism</font>

- A user’s data (e.g., phone number, attributes) is sent via an API request&#x20;
- The API triggers a specific bot **flow (using Flow Key)**&#x20;
- The flow executes based on the configured logic&#x20;
- A user is created/tracked in the bot with provided details

## <font color="#ae1536">4. API Endpoint</font>

**Method**: `Post`

**Request URL**:

:::BlockQuote
https\://api.engati.ai/bot-api/v2.0/customer/\<customer\_id>/bot/\<bot\_key>/flow/\<flow\_key>
:::

**Headers**:

:::BlockQuote
Authorization: Basic \<API Key>
Content-Type: application/json
:::

::Image[]{src="https://api.archbee.com/api/optimize/FEqjvWZnyymr_PEhXLLlG/10VPQZDG1XLZZcdxUBFke-20260224-184024.png" size="76" width="2684" height="588" position="center" showCaption="false"}

### WhatsApp Channel

:::BlockQuote
\{
&#x20; "user\_channel": "whatsapp",
&#x20; "user\_phone\_no": "\<phone\_number>",
&#x20; "attribute\_1": "value1",
&#x20; "attribute\_2": "value2"
}
:::

**Required Parameters**

| Parameter      | Description                             |
| -------------- | --------------------------------------- |
| customer\_id   | Unique customer identifier              |
| bot\_key       | Bot identifier                          |
| API Key        | Authentication key                      |
| flow\_key      | Flow to be triggered                    |
| user.phone\_no | User’s phone number (with country code) |

**Where to Find Keys**

- **Customer ID / Bot Key / API Key** → Integrations → Engati API&#x20;

::Image[]{src="https://api.archbee.com/api/optimize/FEqjvWZnyymr_PEhXLLlG/ABlOTCBRmYLQ0wMYxFOuF-20260224-173205.png" size="80" width="3396" height="928" position="center" showCaption="false"}

- **Flow Key** → Click the **"i" (Path Info)** icon in the flow builder

::Image[]{src="https://api.archbee.com/api/optimize/FEqjvWZnyymr_PEhXLLlG/JJHjt_rEQejCTzLMQKBzV_screenshot-2022-05-22-at-45915-pm.png" size="80" width="1228" height="193" position="center" showCaption="false"}

**Note**: For WhatsApp, if in any case, the user's name is not present with its phone number then the 'user.user\_name' attribute will capture and store its phone number.

**Flow Setup**

- Create a flow in the bot builder&#x20;
- Use attributes to receive API data&#x20;
- Add decision nodes to control logic&#x20;

**Example:**

- If user\_type = VIP → trigger VIP flow&#x20;
- Else → trigger standard flow

::Image[]{src="https://api.archbee.com/api/optimize/FEqjvWZnyymr_PEhXLLlG/MPpM0_SZcrnKsNSt1m-vg-20260417-093107.png" size="60" width="1808" height="1182" position="center" showCaption="false"}

**User tracking**

When the API will be triggered and the automation flow executed, a user will be created in the dedicated bot containing the details.

::Image[]{src="https://api.archbee.com/api/optimize/FEqjvWZnyymr_PEhXLLlG/cE0o7iOsKFvBPtE2n40RB_image.png" size="90" width="1024" height="42" position="center" showCaption="false"}

**cURL**

Version 1

```curl
curl --location --request POST 'https://api.engati.ai/bot-api/v1.0/customer/<cid>/bot/<bot_key>/flow/<flow_key>?user.phone_no=<phone_number>&resultCode=123&operationId=test123' \
--header 'Authorization: Basic <api_key>'
```

Version 2

When the API will be triggered the attribute data will be passed through the API into the flow and this flow will be executed. These attributes can be configured in the Request Body of API.

```curl
curl --location 'https://api.engati.ai/bot-api/v2.0/customer/<CID>/bot/<Bot_Key>/flow/<Flow_Key>' \
--header 'Authorization: Basic <API_Key>' \
--header 'Content-Type: application/json' \
--data '{
    "user.channel": "whatsapp",
    "user.phone_no":<To_Number>,
    "attribute_1":"This is Parameter 1",
    "attribute_2":"This is Parameter 2"
}'
```

### RCS Channel

API Trigger also works for **RCS channel**.

Key Differences:

- "user\_channel": "rcs"&#x20;
- Flow key remains in the URL&#x20;
- User must have RCS enabled

**Parameters**

| Parameter      | Description                             |
| -------------- | --------------------------------------- |
| customer\_id   | Unique customer identifier              |
| bot\_key       | Bot identifier                          |
| API Key        | Authentication key                      |
| flow\_key      | Flow to be triggered                    |
| user.phone\_no | User’s phone number (with country code) |

**Note:&#x20;**&#x50;lease refer to the WhatsApp channel section above for reference.

**Example cURL Request**

```curl
curl --location --globoff 'https://api.engati.ai/bot-api/v2.0/customer/{customer_id}/bot/{bot_id}}/flow/{flow_key}' \
--header 'Authorization: Basic <API_Key>' \
--header 'Content-Type: application/json' \
--data '{
    "user.channel": "rcs",
    "user.phone_no": "<To_Number>",
    "attribute_1":"This is Parameter 1",
    "attribute_2":"This is Parameter 2"

}'
```

**Important Notes**

- The **Flow Key must always be part of the request URL**.&#x20;
- The **channel must be specified as RCS** in the request body.&#x20;
- The phone number must include the **country code**.&#x20;
- The user must have **RCS enabled on their device** to receive messages.&#x20;

*In case of issues please reach out to support\@engati.ai*
