---
updatedAt: 2025-07-15T17:28:56.000Z
agentTools:
  projectIndex: https://developers.kaleyra.io/llms.txt
---

# Create Flow

POST Method

Kaleyra platform's Create Flow API allows you to create [WhatsApp Flows](https://developers.facebook.com/docs/whatsapp/flows/). Using the WhatsApp Flow you can build structured interactions for business messaging. With Flows, businesses can define, configure, and customize messages with rich interactions that give customers more structure in the way they communicate.

For example, an automotive dealer wants its customers to schedule an appointment for a test drive for a car from car showrooms located at multiple locations. Using the flow, the brand can provide options to its customers to select a showroom and book an appointment based on State, District, PIN or ZIP code, Area, and so on. When a customer selects a State, the defined flow can give them an option to select the District within the State in the next District field. Similarly, they can collect other details from customers using the flow templates.

## Benefits

The following are the benefits of WhatsApp Flow:

* You can define, configure, and customize messages with rich interactions that give customers more structure in the way they communicate.
* Helps in generating leads, recommending products, getting new sales leads, or anything else where structured communication is more natural or comfortable for your customers.

## Prerequisites

1. Before you get started, [Create an API Key](https://developers.kaleyra.io/docs/generating-an-api-key). To view the API Key and the SID, see[ View API Key and SID](https://developers.kaleyra.io/docs/view-api-key-and-sid).\
   A prerequisite for using Kaleyra WhatsApp APIs is to have an active WhatsApp plan on Kaleyra platform.
2. To set up a WhatsApp account on Kaleyra platform, see [Manual Signup](https://developers.kaleyra.io/docs/manual-signup)\
   and [Embedded Signup](https://developers.kaleyra.io/docs/embedded-signup).
3. An active WhatsApp for Business API plan that includes:
   * A WhatsApp business number.
   * An associated profile with the business number.
   * A WhatsApp verified and approved profile.
   * A WABA ID onboarded on Kaleyra WhatsApp API V2.

## Base URL

`https://<api_domain>/v2/<SID>`

## API Domain and Value

| api\_domain | Value             |
| :---------- | :---------------- |
| IN pod      | api.in.kaleyra.io |
| SG Pod      | api.ap.kaleyra.io |
| EU Pod      | api.eu.kaleyra.io |

## API request to create WhatsApp Flow

To create WhatsApp Flow, use the `https://<api_domain>/v2/<sid>/whatsapp/<waba_id>/flows` endpoint with the following request method.

## Request Format

The following is the request format to create WhatsApp Flow:

```curl
curl --location POST \ 'https://<api_domain>/v2/<sid>/whatsapp/<waba_id>/flows' \
--header 'api-key: <api-key>' \
--header 'Content-Type: application/json' \
--data '{
  "name": "<name>",
  "endpoint_uri" : "<endpoint_uri>",
  "categories": [ "categories" ]
}'
```

## Sample Request Format

The following is the sample request format to create a WhatsApp Flow:

```curl
curl --location POST \ 'https://api.in.kaleyra.io/v2/HXAP16XXXXXX97IN/whatsapp/1090xxxxxxxxxxxx/flows' \
--header 'api-key: Axxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx3' \
--header 'Content-Type: application/json' \
--data '{
  "name": "First flow demo",
  "endpoint_uri" : "https://www.tatacommunications.com/",
  "categories": [ "APPOINTMENT_BOOKING" ]
}'
```

> 📘 Note:
>
> * New Flows are by default created in DRAFT status and you can make changes to the Flow by uploading a JSON file.
> * You can create a new published Flow in a single request by specifying `flow_json` and publish parameters.
> * The above request format is only to show the POST method to create a Flow. For more information about the different possible types of WhatsApp Flow that can be created please refer to the [Send Flow Messages](https://developers.kaleyra.io/docs/whatsapp-message-api-v2-send-flow-messages).

## URL Parameters and Headers

The following is the list of parameters and headers to send the outgoing message request:

| Parameter / Headers | Data Type | Description                                                                                                                                                        | Example                                     | Mandatory? |
| :------------------ | :-------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------ | :--------- |
| `sid`               | String    | Account SID (Security Identifier).                                                                                                                                 | HXAP16XXXXXX97IN                            | Yes        |
| `waba_id`           | String    | WhatsApp Business Account. For more information, see step 1 to step 3 of [Adding a new WABA ID](https://developers.kaleyra.io/docs/whatsapp-adding-a-new-waba-id). | `1090xxxxxxxxxxxx`                          | Yes        |
| `Content-Type`      | String    | Indicates the format of the content the API will be processing.                                                                                                    | The only allowed value is application/json. | Yes        |
| `api-key`           | String    | API key generated from Kaleyra platform account.                                                                                                                   | Axxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx3           | Yes        |

> 📘 Note:
>
> For the complete list of supported parameters, see [Flows API](https://developers.facebook.com/docs/whatsapp/flows/reference/flowsapi/).

Following is the list of a few supported parameters to be used in the payload to create the WhatsApp Flow:

<Table align={["left","left","left","left","left"]}>
  <thead>
    <tr>
      <th>
        Parameter
      </th>

      <th>
        Data Type
      </th>

      <th>
        Description
      </th>

      <th>
        Example
      </th>

      <th>
        Mandatory?
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `name`
      </td>

      <td>
        String
      </td>

      <td>
        The name you want to provide for your WhatsApp Flow.
      </td>

      <td>
        First flow demo
      </td>

      <td>
        Yes
      </td>
    </tr>

    <tr>
      <td>
        `endpoint_uri`
      </td>

      <td>
        String
      </td>

      <td>
        The URI you want to use in the WhatsApp Flow from your business link.
      </td>

      <td>
        `https://www.tatacommunications.com/`
      </td>

      <td>
        No
      </td>
    </tr>

    <tr>
      <td>
        `categories`
      </td>

      <td>
        Array of string
      </td>

      <td>
        The category templates using which you want to define the WhatsApp Flow. The following are the supported categories:  

        * SIGN\_UP
        * SIGN\_IN
        * APPOINTMENT\_BOOKING
        * LEAD\_GENERATION
        * SHOPPING
        * CONTACT\_US
        * CUSTOMER\_SUPPORT
        * SURVEY
        * OTHER  
          * \*Note\*\*: You can use multiple categories separated by a comma based on your WhatsApp Flow.
      </td>

      <td>
        APPOINTMENT\_BOOKING
      </td>

      <td>
        Yes
      </td>
    </tr>
  </tbody>
</Table>

## Sample Success Response

The following success message appears with the status 200 Accepted:

```json
200 OK
{
 "code":"WA200",
"message": "Request Processed Successfully",
"data": {
"id": "112xxxxxxxxxx207"
}
"error": {}
}
```

## Sample Failure Response

The following are the failure responses:

```json
401 Unauthorized
{
    "code": "RBC001",
    "message": "Incorrect SID or API key.",
    "data": [],
    "error": {
        "error": "Incorrect SID or API key."
    }
}
```

```json
401 Wrong account
{
    "code": "WA-401",
    "message": "API is not available for given customer.Please contact support for more info",
    "data": {},
    "error": "API is not available for given customer.Please contact support for more info"
}
```

```json
400 Incorrect payload
{
    "code": "WA-400",
    "message": "Refer to correct payload format",
    "data": {},
    "error": {
        "payload": "Incorrect payload format"
    }
}
```

```json
500 Internal Server Error
{
    "code": "WA-500",
    "message": "Please try again later",
    "data": {},
    "error": {
        "error": "Internal server error"
    }
}
```

```json
{
    "code": "WA-401",
    "message": "The flow_id either does not exist or does not belong to the account.",
    "data": {},
    "error": {
        "flow_id": "The flow_id either does not exist or does not belong to the account."
    }
}
```