---
updatedAt: 2025-04-03T06:41:43.000Z
agentTools:
  projectIndex: https://partner-docs.gupshup.io/llms.txt
---

# Text

Use this API to send messages using the Text template.

## Request Parameters

<HTMLBlock>{`
<table style="width: 100%; border-collapse: collapse;">
<thead>
<tr>
  <th style="border: 1px solid #ddd; padding: 8px;">Key</th>
  <th style="border: 1px solid #ddd; padding: 8px;">Description</th>
  <th style="border: 1px solid #ddd; padding: 8px;">Value</th>
  <th style="border: 1px solid #ddd; padding: 8px;">Data Type</th>
  <th style="border: 1px solid #ddd; padding: 8px;">Required/Optional</th>
  <th style="border: 1px solid #ddd; padding: 8px;">Constraints</th>
</tr>
</thead>
<tbody>
<tr>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>Authorization</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>Access Token for the application</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>{{PARTNER_APP_TOKEN}}</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>String</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>Required</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>Should be a valid Partner App Access Token</p>
</td>
</tr>
<tr>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>elementName</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>The name of a template. The element name is unique for a WABAs namespace.</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>{{ELEMENT_NAME}}</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>String</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>Required</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>elementName (not more than 180 char.) Mandatory fields</p>
</td>
</tr>
<tr>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>languageCode</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>Language code for the template. Refer to all the language codes <a href="https://support.gupshup.io/hc/en-us/articles/360013321939">here</a>.</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>{{LANGUAGE_CODE}}</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>String</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>Optional</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>languageCode default value : <code>en_US</code></p>
</td>
</tr>
<tr>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>content</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>The body of the template. Character limit: 1028. For &quot;Authentication&quot; category the first line should be - {{1}} is your verification code.</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>{{CONTENT}}</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>String</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>Required</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>content (not more than 1024 char.)</p>
</td>
</tr>
<tr>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>category</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>The category of your template.</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p> {{CATEGORY}}</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>String</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>Required</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"></td>
</tr>
<tr>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>vertical</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>TEXT</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>{{VERTICAL}}</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>String</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>Required</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>vertical (not more than 180 char.)</p>
</td>
</tr>
<tr>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>footer</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>Footer of the template.</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>{{FOOTER}}</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>String</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>Optional</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"></td>
</tr>
<tr>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>templateType</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>DOCUMENT</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p> {{TEMPLATE_TYPE}}</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>String</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>Required</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"></td>
</tr>
<tr>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>example</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>Template Example</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>{{EXAMPLE}}</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>String</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>Required</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"></td>
</tr>
<tr>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>exampleHeader</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>This is the header</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p> {{EXAMPLE_HEADER}}</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>String</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>Optional</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"></td>
</tr>
<tr>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>header</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>Header of the template.</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p> {{HEADER}}</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>String</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>Optional</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"></td>
</tr>
<tr>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>buttons</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>Buttons list</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>{{BUTTONS}}</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>String</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>Optional</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"></td>
</tr>
<tr>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>allowTemplateCategoryChange</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>Boolean value. If True, Meta will automatically update the category of the template as per the template content. Default value is False.</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>{{ALLOW_TEMPLATE_CATEGORY_CHANGE}}</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>Boolean</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>Optional</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"></td>
</tr>
<tr>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>appId</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>App ID to fetch the access token</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>{{APP_ID}}</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>String</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>Required</p>
</td>
  <td style="border: 1px solid #ddd; padding: 8px;"><p>The Id should be a valid app Id of Gupshup  </p>
<p>The App must be associated with the account that owns the PARTNER_APP_TOKEN being used</p>
</td>
</tr>
</tbody>
</table>
`}</HTMLBlock>

## Sample Request

```curl
curl --request POST \
     --url https://partner.gupshup.io/partner/app/{{APP_ID}}/templates \
     --header 'accept: application/json' \
     --header 'content-type: application/x-www-form-urlencoded' \
     --header 'Authorization: sk_711916ad1d5d4f21a9520fdef20516a1' \
     --data elementName=text_element1 \
     --data languageCode=en \
     --data 'content=your otp is {{1}}' \
     --data category=MARKETING \
     --data vertical=Internal_vertical \
     --data templateType=TEXT \
     --data 'example=your otp is {{1}}' \
     --data 'header=Hi All' \
     --data 'exampleHeader=Hi All' \
     --data 'footer=This is footer' \
     --data allowTemplateCategoryChange=true \
     --data 'buttons=[{\"type\":\"QUICK_REPLY\",\"text\":\"please check\"},{\"type\":\"URL\",\"text\":\"test\",\"url\":\"https://www.google.co.uk/\",\"buttonValue\":\"https://www.google.co.uk/\",\"suffix\":\"\"}]'
```

## Sample Response

```json
{
  "status": "success",
  "template": {
    "appId": "947d28b8-XXXX-XXXX-XXXX-0acXXX245c9",
    "category": "MARKETING",
    "containerMeta": "{\"appId\":\"947d28b8-XXXX-XXXX-XXXX-0acXXX245c9\",\"data\":\"your otp is {{1}}\",\"header\":\"Hi All\",\"footer\":\"This is footer\",\"sampleText\":\"your otp is {{1}}\",\"sampleHeader\":\"Hi All\",\"enableSample\":true,\"editTemplate\":false,\"allowTemplateCategoryChange\":true,\"addSecurityRecommendation\":false}",
    "createdOn": 1721652028616,
    "data": "Hi All\nyour otp is {{1}}\nThis is footer",
    "elementName": "text_element1",
    "id": "dd57a883-5e98-44f5-9379-f6179011a186",
    "languageCode": "en",
    "languagePolicy": "deterministic",
    "meta": "{\"example\":\"your otp is {{1}}\"}",
    "modifiedOn": 1721652028616,
    "namespace": "8e58971e_b9b8_476c_b844_64a1aa63a73c",
    "priority": 1,
    "quality": "UNKNOWN",
    "retry": 0,
    "stage": "NONE",
    "status": "PENDING",
    "templateType": "TEXT",
    "vertical": "Internal_vertical",
    "wabaId": "117529881248706"
  }
}
```

## Status Codes

| Status Code | Response                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           | Comments               |
| :---------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :--------------------- |
| **Success** |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |                        |
| 200         | `{     "status": "success",     "template": {       "appId": "947d28b8-XXXX-XXXX-XXXX-0acXXX245c9",       "category": "MARKETING",       "containerMeta": "{\"appId\":\"947d28b8-XXXX-XXXX-XXXX-0acXXX245c9\",\"data\":\"your otp is {{1}}\",\"header\":\"Hi All\",\"footer\":\"This is footer\",\"sampleText\":\"your otp is {{1}}\",\"sampleHeader\":\"Hi All\",\"enableSample\":true,\"editTemplate\":false,\"allowTemplateCategoryChange\":true,\"addSecurityRecommendation\":false}",       "createdOn": 1721652028616,       "data": "Hi All\\nyour otp is {{1}}\\nThis is footer",       "elementName": "text_element1",       "id": "dd57a883-5e98-44f5-9379-f6179011a186",       "languageCode": "en",       "languagePolicy": "deterministic",       "meta": "{\"example\":\"your otp is {{1}}\"}",       "modifiedOn": 1721652028616,       "namespace": "8e58971e_b9b8_476c_b844_64a1aa63a73c",       "priority": 1,       "quality": "UNKNOWN",       "retry": 0,       "stage": "NONE",       "status": "PENDING",       "templateType": "TEXT",       "vertical": "Internal_vertical",       "wabaId": "117529881248706"     }   }` |                        |
| **Error**   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |                        |
| 429         | `{   "status": "error",   "message": "Too Many Requests" }`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        | 10 Requests per Minute |
| 500         | `{   "status": "error",   "message": "Internal server error. Please try again later and If Issue still persist than contact Gupshup Dev Support" }`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                | For any Internal Error |

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "Create Text Type Template",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://partner.gupshup.io"
    }
  ],
  "paths": {
    "/partner/app/{appId}/templates": {
      "post": {
        "tags": [
          "default"
        ],
        "summary": "Create Text Type template",
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "required": [
                  "elementName",
                  "category",
                  "templateType",
                  "content",
                  "example",
                  "exampleHeader",
                  "vertical"
                ],
                "properties": {
                  "elementName": {
                    "type": "string",
                    "description": "The name of a template. Element name is unique for a WABAs namespace.",
                    "example": "text_element"
                  },
                  "languageCode": {
                    "type": "string",
                    "description": "Language code for the template. Refer to all the language codes here.",
                    "example": "en"
                  },
                  "content": {
                    "type": "string",
                    "description": "The body of the template.",
                    "example": "your otp is {{1}}"
                  },
                  "category": {
                    "type": "string",
                    "description": "Template category",
                    "example": "MARKETING"
                  },
                  "vertical": {
                    "type": "string",
                    "description": "Vertical (not more than 180 char.)",
                    "example": "Internal_vertical"
                  },
                  "templateType": {
                    "type": "string",
                    "description": "Template type",
                    "example": "TEXT"
                  },
                  "example": {
                    "type": "string",
                    "description": "Template example",
                    "example": "your otp is {{1}}"
                  },
                  "header": {
                    "type": "string",
                    "description": "Header of the template.",
                    "example": "Hi All"
                  },
                  "exampleHeader": {
                    "type": "string",
                    "description": "This is the header",
                    "example": "Hi All"
                  },
                  "footer": {
                    "type": "string",
                    "description": "Footer of the template.",
                    "example": "This is footer"
                  },
                  "allowTemplateCategoryChange": {
                    "type": "boolean",
                    "description": "Boolean value. If True, Meta will automatically update the category of the template as per the template content. Default value is False.",
                    "example": "true"
                  },
                  "buttons": {
                    "type": "string",
                    "description": "Buttons list",
                    "example": "[{\\\"type\\\":\\\"QUICK_REPLY\\\",\\\"text\\\":\\\"please check\\\"},{\\\"type\\\":\\\"URL\\\",\\\"text\\\":\\\"test\\\",\\\"url\\\":\\\"https://www.google.co.uk/\\\",\\\"buttonValue\\\":\\\"https://www.google.co.uk/\\\",\\\"suffix\\\":\\\"\\\"}]"
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "description": "Your app token, please refer [**Get access token api**](https://docs.gupshup.io/reference/get_partner-app-appid-token) to get the token from partner documentation.",
            "example": "sk_61b3021c97214370b341f8baaae0xxxx",
            "required": true
          },
          {
            "name": "appId",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "Unique identifier of the app.",
            "example": "9e97650d-xxxx-xxxx-xxxx-4cdf47c3fa68"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "example": "success"
                    },
                    "template": {
                      "type": "object",
                      "properties": {
                        "appId": {
                          "type": "string",
                          "example": "a41b30f4-d202-4fdb-911e-3a8fbfbfb797"
                        },
                        "category": {
                          "type": "string",
                          "example": "MARKETING"
                        },
                        "containerMeta": {
                          "type": "string",
                          "example": {
                            "appId": "a41b30f4-d202-4fdb-911e-3a8fbfbfb797",
                            "data": "your otp is {{1}}",
                            "header": "Hi All",
                            "footer": "This is footer",
                            "sampleText": "your otp is {{1}}",
                            "sampleHeader": "Hi All",
                            "enableSample": true,
                            "editTemplate": false,
                            "allowTemplateCategoryChange": true,
                            "addSecurityRecommendation": false
                          }
                        },
                        "createdOn": {
                          "type": "integer",
                          "format": "int64",
                          "example": "1716279657119"
                        },
                        "data": {
                          "type": "string",
                          "example": "Hi All your otp is {{1}} This is footer"
                        },
                        "elementName": {
                          "type": "string",
                          "example": "text_element"
                        },
                        "id": {
                          "type": "string",
                          "example": "6511a5dc-aecb-4625-a39a-c8476278801e"
                        },
                        "languageCode": {
                          "type": "string",
                          "example": "en_US"
                        },
                        "languagePolicy": {
                          "type": "string",
                          "example": "deterministic"
                        },
                        "meta": {
                          "type": "string",
                          "example": {
                            "example": "your otp is {{1}}"
                          }
                        },
                        "modifiedOn": {
                          "type": "integer",
                          "format": "int64",
                          "example": "1716279657119"
                        },
                        "namespace": {
                          "type": "string",
                          "example": "9c7fe92f_2a48_40ec_83d0_69c62a772433"
                        },
                        "priority": {
                          "type": "integer",
                          "format": "int32",
                          "example": "1"
                        },
                        "quality": {
                          "type": "string",
                          "example": "UNKNOWN"
                        },
                        "retry": {
                          "type": "integer",
                          "format": "int32",
                          "example": "0"
                        },
                        "stage": {
                          "type": "string",
                          "example": "NONE"
                        },
                        "status": {
                          "type": "string",
                          "example": "PENDING"
                        },
                        "templateType": {
                          "type": "string",
                          "example": "TEXT"
                        },
                        "vertical": {
                          "type": "string",
                          "example": "Internal_vertical"
                        },
                        "wabaId": {
                          "type": "string",
                          "example": "104505526065633"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "property1": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "Too Many Requests"
                    },
                    "status": {
                      "type": "string",
                      "example": "error"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "Internal server error"
                    },
                    "status": {
                      "type": "string",
                      "example": "error"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  }
}
```