This API creates Pix Templates
If the waba is in Brazil then user has to use sendAsPixTemplate and button text would be Copy Pix code.
Parameters
Key | Description | Value | Data type | Required/Optional | Constraints |
|---|---|---|---|---|---|
Authorization | Access Token for the application | {PARTNER_APP_TOKEN} | String | Required | • Should be a valid Partner App Access Token |
appId | App ID to fetch the access token | {APP_ID} | String | Required | • The Id should be a valid app Id of Gupshup• The App must be associated with the account that owns the PARTNER_APP_TOKEN being used |
elementName | The name of a template. Element name is unique for a WABAs namespace. | {ELEMENT_NAME} | String | Required | • elementName (not more than 200 char.) Mandatory fields |
languageCode | Language code for the template. Refer to all the language codes . | {LANGUAGE_CODE} | String | optional | • languageCode default value : en_US |
content | The body of the template. Character limit: 1028. For "Authentication" category the first line should be - {{1}} is your verification code. | String | NA | • content (not more than 1024 char.) | |
category | The category of your template. Possible Values: MARKETING and UTILITY. | String | NA | • category (not more than 180 char.) | |
vertical | TEXT | String | NA | vertical (not more than 180 char.) | |
templateType | TEXT/IMAGE | String | NA | The type of template: TEXT, IMAGE, LOCATION, PRODUCT, CATALOG, LTO, CAROUSEL, VIDEO & DOCUMENTCATALOG, LTO, CAROUSEL templates are not available with the On-premises API CATALOG, LTO, CAROUSEL and PRODUCT templates are available for MARKETING & UTILITY category only.Cards to be cards only to be passed if template type is CAROUSEL | |
example | Template Example | String | NA | ||
enableSample | Required for creating all types of templates | true/false | NA | if enableSample is true then exampleMedia | |
header | Header of the template. Applicable for templateType = Text Character limit: 60. Not applicable for "Authentication" category. | String | NA | ||
footer | Footer of the template. Character limit: 60. Not applicable for "Authentication" category, only set based on code_expiration_minutes value | String | NA | ||
buttons |
| Array of objects | NA | ||
exampleHeader | This is the header | String | NA | ||
sendAsPixTemplate | true | Boolean | Required | ||
parameterFormat | POSITIONAL | String | Required |
Sample Request
curl --location 'https://partner.gupshup.io/partner/app/926470c5-d617-43b3-aea4-2c2a389dc9d4/templates' \
--header 'accept: application/json, text/plain, */*' \
--header 'content-type: application/x-www-form-urlencoded' \
--header 'Authorization: sk_0b3a6cf96e8axxxxb2' \
--data-urlencode 'elementName=test_copypix_temp' \
--data-urlencode 'languageCode=en' \
--data-urlencode 'content=Please Pay to continue subscription' \
--data-urlencode 'category=MARKETING' \
--data-urlencode 'vertical=Test01' \
--data-urlencode 'templateType=TEXT' \
--data-urlencode 'example=Please Pay to continue subscription' \
--data-urlencode 'exampleHeader=Order' \
--data-urlencode 'enableSample=false' \
--data-urlencode 'parameterFormat=POSITIONAL' \
--data-urlencode 'checkerApprovalRequired=false' \
--data-urlencode 'footer=Thankyou' \
--data-urlencode 'header=Order' \
--data-urlencode 'buttons=[{"type":"ORDER_DETAILS","text":"Copy Pix code"}]' \
--data-urlencode 'sendAsPixTemplate=true'Sample Response
{
"status": "success",
"template": {
"appId": "926470c5-d617-43b3-aea4-2c2a389dc9d4",
"buttonSupported": "OD",
"category": "MARKETING",
"containerMeta": "{\"appId\":\"926470c5-d617-43b3-aea4-2c2a389dc9d4\",\"data\":\"Please Pay to continue subscription\",\"buttons\":[{\"type\":\"ORDER_DETAILS\",\"text\":\"Copy Pix code\"}],\"header\":\"Order\",\"footer\":\"Thankyou\",\"sampleText\":\"Please Pay to continue subscription\",\"sampleHeader\":\"Order\",\"enableSample\":true,\"editTemplate\":false,\"allowTemplateCategoryChange\":false,\"addSecurityRecommendation\":false,\"isCPR\":false,\"cpr\":false}",
"createdOn": 1765985415929,
"data": "Order\nPlease Pay to continue subscription\nThankyou | [Copy Pix code]",
"elementName": "test_copypix_temp_vini",
"id": "c8d28b6f-0939-4260-9352-d10e76709c9f",
"languageCode": "en",
"languagePolicy": "deterministic",
"meta": "{\"example\":\"Please Pay to continue subscription\"}",
"modifiedOn": 1765985415929,
"namespace": "b01e6d56_443a_419e_9e2f_1559e7b31309",
"parameterFormat": "POSITIONAL",
"priority": 1,
"quality": "UNKNOWN",
"retry": 0,
"stage": "NONE",
"status": "PENDING",
"templateType": "TEXT",
"vertical": "Test01",
"wabaId": "914254047448183"
}
}Status codes
Status Code | Response | Comments |
|---|---|---|
Success | ||
200 | { "status": "success","template":{"appId": "bf9ee64c-3d4d-4ac4-8668-732e577007c4","category": "MARKETING","containerMeta": "{"appId":"bf9ee64c-3d4d-4ac4-8668-732e577007c4","data":"This is category for copy code button template.","footer":"This is footer","sampleText":"This is category for copy code button template.","enableSample":true,"editTemplate":false,"addSecurityRecommendation":false}","createdOn": 1708205191624,"data": "This is category for copy code button template.\nThis is footer","elementName": "automation_template_2956534","id": "e8e837c2-a3a8-4845-958f-ec7febb54aec","languageCode": "en","languagePolicy": "deterministic","meta": "{"example":"This is category for copy code button template."}","modifiedOn": 1708205191624,"namespace": "18cfa544_9c62_4dcd_b8f3_b3785d8c917c","priority": 1,"quality": "UNKNOWN","retry": 0, "stage": "NONE", "status": "PENDING", "templateType": "TEXT", "vertical": "Internal_vertical", "wabaId": "216141188246170" } } | |
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, then contact Gupshup Dev Support"} | For any Internal Error |
