---
updatedAt: 2025-07-15T16:01:38.000Z
agentTools:
  projectIndex: https://developers.kaleyra.io/llms.txt
---

# Create a Multi-Product Message Template

POST Method

The **Create a Multi-Product Message Template** API allows you to create Multi-Product Message (MPM) templates in template messages.

1. Sign up for free

***

Before you get started, [create a Kaleyra.io account](https://developers.kaleyra.io/docs/create-an-account-in-kcloud) for free and [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).

2. Pre-requisites

***

A prerequisite for using Kaleyra WhatsApp APIs is to have an active WhatsApp plan on kaleyra.io.\
To set up a WhatsApp account on kaleyra.io, see: <https://developers.kaleyra.io/docs/manual-signup>\
And <https://developers.kaleyra.io/docs/embedded-signup>

To have a product catalogue associated with the WABA, For more information, see [Product Catalog Messages](https://developers.kaleyra.io/docs/whatsapp-product-catalog-messages) page.

3. Create a Multi-Product Template Message API request.

***

You can use this API to create a Multi-Product Message template through your WhatsApp account.

<BaseURLSMS />

## 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 a Multi-Product Message Template

To create a Multi-Product Message template, use the `/whatsapp/template` endpoint with the following request method:

## Request Format

The following is the request format to create a Multi-Product Message Template:

```curl
curl --location --request POST 'https://<api_domain>/v1/<sid>/whatsapp/template' \
--header 'api-key: <api_key>' \
--form 'name="<template_name>"' \
--form 'category="<category>"' \
--form 'language="<language>"' \
--form 'header="{\"type\": \"<header_type>\",
     \"content\": \"<content>\"
}";type=application/json' \
--form 'body="\"<body>\""' \
--form 'sample_body="\"<sample_body>\""' \
--form 'button_data="[{
          \"type\": \"<type>\",
          \"text\": \"<text>\"
        }]";type=application/json' \
--form 'sample_header_content="<sample_header_content>"'
```

## Sample Request Format

The following is the sample request format to create a Multi-Product Message Template:

```curl
curl --location--request POST 'https://api.in.kaleyra.io/v1/HXXXXXXX071IN/whatsapp/template' \
--header 'api-key: Axxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx3' \
--form 'name="my_first_mpm"' \
--form 'category="marketing"' \
--form 'language="en"' \
--form 'header="{\"type\": \"text\",
     \"content\": \"Hi there\"
}";type=application/json' \
--form 'body="\"come and see our latest product collections"\""' \
--form 'sample_body="\"come and see our latest product collections"\""' \
--form 'button_data="[{
          \"type\": \"MPM\",
          \"text\": \"View items\"
        }]";type=application/json' \
--form 'sample_header_content="Hi there"'
```

## Parameters and Data Types

Following is the list of parameters and data types supported for Multi-Product Message Template:

| Parameter               | Data Type         | Description                                                                                                                              | Examples                                    | Mandatory? |
| :---------------------- | :---------------- | :--------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------ | :--------- |
| `sid`                   | String            | Account SID (Security Identifier).                                                                                                       | HXXXXXXX071IN                               | Yes        |
| `api_key`               | String            | Your API Key generated by Kaleyra.io.                                                                                                    | Axxxxxxxxxxxxxxxxxxxxxxxxxxxx3              | Yes        |
| `template_name`         | String or Integer | Specifies the template name. Maximum 512 characters.                                                                                     | my\_first\_mpm                              | Yes        |
| `category`              | String            | Enter the template category. Only Marketing is supported.                                                                                | marketing                                   | Yes        |
| `language`              | String            | The language in which, you want to create the template.                                                                                  | en                                          | Yes        |
| `header_type`           | String            | Specifies the header type. Only supported type is "Text".                                                                                | Text                                        | Yes        |
| `content`               | String            | Specifies the text data that has to be sent". The supported format is Text.                                                              | Hi there                                    | Yes        |
| `body`                  | String            | Body of the message. Maximum 1024 characters. Body can have different variables that are included in the text.                           | come and see our latest product collections | Yes        |
| `sample_body`           | String            | Specifies the sample body of the message. You can send any value in the body variable.                                                   | come and see our latest product collections | Yes        |
| `button_data`           | String            | The button\_data object in the API request defines the fields that will be shown to the end-user. The supported button data type is MPM. | Type is MPM and the text is View items      | Yes        |
| `sample_header_content` | String            | Specifies the sample header text.                                                                                                        | Hi there                                    | Yes        |

The following table describes the different attributes used for the button\_data object

| parameter | Data Type | Description                                                          | Examples   | Mandatory? |
| :-------- | :-------- | :------------------------------------------------------------------- | :--------- | :--------- |
| `type`    | String    | Specifies the button data type.                                      | MPM        | Yes        |
| `text`    | String    | Specifies the text to be displayed on the button with 25 characters. | View items | Yes        |

## Sample Success Response to create MPM template

The following success message appears with the status 200 Accepted:

```json
{
    "status": 200,
    "message": "Template created successfully.",
    "data": [],
    "error": {}
}
```

## Sample Failure Response to create MPM template

The following is the failure response to create an MPM template.

```json
{
    "error": {
        "code": "E1035",
        "type": "VALIDATION_ERROR",
        "parameter": "button_data",
        "message": "Text for button type 'MPM' cannot be modified and must always be 'View items'.",
        "reference": ""
    }
}
```

## Error Codes

For information related to the WhatsApp error code, see [WhatsApp Error Codes](https://developers.kaleyra.io/docs/whatsapp-error-codes).