# Send a flow

🔒 WhatsApp 24-Hour Session Rule

> Before sending a free-form message, make sure the WhatsApp session with the user is **active**.
>
> **If the user has not messaged your business within the last 24 hours, WhatsApp requires the first message to be a&#x20;*****template message***.
>
> After the customer replies, the 24-hour session opens and you may send free-form messages using this API.\
> **For sandbox testing**, send your join code to the sandbox number to activate your session.\
> [Learn more](https://app.gitbook.com/o/rJyj7TfON4zeW56KoQjM/s/2JHt6V4YwZLX6ZUdLqMy/~/changes/87/guides/joincodes)

```shellscript
POST https://gateway.lipachat.com/api/v1/whatsapp/interactive/flows
```

**Header**

| Name         | Value                                                                           |
| ------------ | ------------------------------------------------------------------------------- |
| Content-Type | application/json                                                                |
| apiKey       | Get apiKey from app portal settings tab <https://app.lipachat.com/app/settings> |

**Body**

| Name               | Type   | Description                                                                                                        |
| ------------------ | ------ | ------------------------------------------------------------------------------------------------------------------ |
| messageId          | string | A unique identifier for the message. This will be used to track the message status and for deduplication purposes. |
| to                 | string | PhonReceiver phone number. It should start with a country code.                                                    |
| from               | string | Sandbox number +254110090747 or your own WABA phone number.                                                        |
| text               | string |                                                                                                                    |
| flowId             | string | Id of the flow you want to send                                                                                    |
| flowCta            | string | Text to appear on the submit button of the flow                                                                    |
| screen             | string | First screen of your json request/flow                                                                             |
| data.service       | string |                                                                                                                    |
| data.serviceOption | string |                                                                                                                    |
| data.package       | string |                                                                                                                    |

**Example Request**

```json
{
  "messageId": "{{$randomUUID}}",
  "to": "254717746565",
  "from": "{{SANDBOX_NUMBER}}",
  "text": "Thank you share your details and one of our agents will be in touch",
  "flowId": "YOUR_FLOW_ID",
  "flowCta": "Share Details!",
  "screen": "First screen in your JSON request",
  "data": {
    "service": "",
    "serviceOption": "",
    "package": ""
  }
}
```

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
  "timestamp": "2024-03-22T11:42:18.625016916",
  "data": {
    "messageId": "1a85c604-0f08-4182-8011-407ba84598c5",
    "waId": "wamid.HBgMMjU0NzE3NzQ2NTY1FQIAERgSMDUxNjI2OEE5OUUyMzQzMjM4AA==",
    "status": "SENT",
    "statusDesc": "Message sent successfully"
  },
  "status": "success",
  "message": "",
  "errors": null
}
```

{% endtab %}

{% tab title="400" %}

```json
{
    "timestamp": "2024-09-15T20:06:38.675567555",
    "data": null,
    "status": "error",
    "message": "Request failed.",
    "errors": null
}
```

{% endtab %}

{% tab title="401" %}

```json
{
    "timestamp": "2024-09-15T20:07:23.464199513",
    "data": null,
    "status": "success",
    "message": "Invalid credentials",
    "errors": null
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.lipachat.com/api/whatsapp-flows/send-flow.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
