Request 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 |
|
elementName | The name of a template. Element name is unique for a WABAs namespace. | {{ELEMENT_NAME}} | String | Required | elementName (not more than 180char.) Mandatory fields |
languageCode | Language code for the template. Refer to all the language codes here. | {{LANGUAGE_CODE}} | String | Optional | languageCode default value : |
content | The body of the template. | {{CONTENT}} | String | Required | content (not more than 1024 char.) |
category | The category of your template. | {{CATEGORY}} | String | Required | Category Type: |
vertical | TEXT | {{VERTICAL}} | String | Required | vertical (not more than 180 char.) |
templateType | DOCUMENT | {{TEMPLATE_TYPE}} | String | Required | The type of template: PRODUCT |
example | Template Example | {{EXAMPLE}} | String | Required | |
enableSample | Required for creating all types of templates | {{ENABLE_SAMPLE}} | true/false | Optional | if enableSample is true then exampleMedia |
header | Header of the template. | {{HEADER}} | String | Optional | |
footer | Footer of the template. Character limit: 60. | {{FOOTER}} | String | Optional | |
exampleHeader | This is the header | {{EXAMPLE_HEADER}} | String | Optional | |
allowTemplateCategoryChange | Boolean value. If True, Meta will automatically update the category of the template as per the template content. Default | {{ALLOW_TEMPLATE_CATEGORY_CHANGE}} | String | Optional |
Sample Request
curl --location 'https://partner.gupshup.io/partner/app/:appId/templates' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: {{PARTNER_APP_TOKEN}}' \
--data-urlencode 'elementName=test_flows_1' \
--data-urlencode 'languageCode=en' \
--data-urlencode 'content=Hi {{1}},
Today is the last day of the BIg Billion Day'\''s sale. Make the most out of it!' \
--data-urlencode 'category=MARKETING' \
--data-urlencode 'templateType=IMAGE' \
--data-urlencode 'example=Hi Sam,
Today is the last day of the BIg Billion Day'\''s sale. Make the most out of it!' \
--data-urlencode 'enableSample=true' \
--data-urlencode 'allowTemplateCategoryChange=true' \
--data-urlencode 'vertical=Sample template using Flow button with others' \
--data-urlencode 'buttons=
[
{
"type": "FLOW",
"text": "Share Interests",
"flow_id": "3961313760791090",
"flow_action": "NAVIGATE",
"navigate_screen": "SEGMENTS_SCREEN",
"icon": "PROMOTION"
}
]' \
--data-urlencode
'exampleMedia=4::aW1hZ3UvanBlZw==:ARYNMS2RLy7ZxeZdLH6MlbuCHz2bm5naXIbAHYwsJjvrQLKCGZ9LPnNmBC4KYhH2j6WxJEHJ7L6u
vxYsIYonRecvTCm_jyObpUJS-BRgFNcxOQ:e:1749806891:2281283925530161:61551923013914:ARbcT9jwPAS_B423dLM'
Sample Response
{
"status": "success",
"template": {
"appId": "d79ad72e-01f0-98e0-aea4-9f3d60ea2c1e",
"buttonSupported": "FLOW",
"category": "MARKETING",
"containerMeta": {
"appId": "d79ad72e-01f0-98e0-aea4-9f3d60ea2c1e",
"data": "Hi {{1}}, \nToday is the last day of the Big Billion Day's sale. Make the most out of it!",
"buttons": [
{
"type": "FLOW",
"text": "Share Interests",
"flow_id": "2961313360793010",
"flow_action": "NAVIGATE",
"navigate_screen": "SEGMENTS_SCREEN"
}
],
"sampleText": "Hi Sam, \nToday is the last day of the Big Billion Day's sale. Make the most out of it!",
"sampleMedia": "4::aW1hZ2UvanBlZw==: ARYNMS2RLy9ZxeZdLH3MlbuCHz2bm5naXIbAHYwsJjvrQLKCGZ9LPnNmBC4KYhH2j6WxJEHJ7L6uvxYsIYonRecvTCm_jyObpUJSBRgFNcxOQ:e:2949806891:2181283925530161:61551923013914:ARbcT9jwPAS_B423dLM",
"enableSample": true,
"editTemplate": false,
"allowTemplateCategoryChange": true,
"addSecurityRecommendation": false,
"isCPR": false,
"cpr": false
},
"createdOn": 1749550623322,
"data": "Hi {{1}}, \nToday is the last day of the Big Billion Day's sale. Make the most out of it! | [Share Interests]",
"elementName": "test_flows_1",
"id": "b5ec0148-a2e3-1d96-b280-c1d161a5a0e7",
"languageCode": "en",
"languagePolicy": "deterministic",
"meta": {
"example": "Hi Sam, \nToday is the last day of the Big Billion Day's sale. Make the most out of it!"
},
"modifiedOn": 1749550623322,
"namespace": "8a499b40_4a56_518c_26fa_1f20f1d6aa18",
"priority": 1,
"quality": "UNKNOWN",
"retry": 0,
"stage": "NONE",
"status": "PENDING",
"templateType": "IMAGE",
"vertical": "Sample template using Flow button with others",
"wabaId": "145881286517812"
}
}
Status Codes
Status Code | Response | Comments |
---|---|---|
Success | ||
200 | { "status": "success", "template": { "appId": "d79ad72e-01f0-98e0-aea4-9f3d60ea2c1e", "buttonSupported": "FLOW", "category": "MARKETING", "containerMeta": { "appId": "d79ad72e-01f0-98e0-aea4-9f3d60ea2c1e", "data": "Hi {{1}}, \nToday is the last day of the Big Billion Day's sale. Make the most out of it!", "buttons": [ { "type": "FLOW", "text": "Share Interests", "flow_id": "2961313360793010", "flow_action": "NAVIGATE", "navigate_screen": "SEGMENTS_SCREEN" } ], "sampleText": "Hi Sam, \nToday is the last day of the Big Billion Day's sale. Make the most out of it!", "sampleMedia": "4::aW1hZ2UvanBlZw==: ARYNMS2RLy9ZxeZdLH3MlbuCHz2bm5naXIbAHYwsJjvrQLKCGZ9LPnNmBC4KYhH2j6WxJEHJ7L6uvxYsIYonRecvTCm_jyObpUJSBRgFNcxOQ:e:2949806891:2181283925530161:61551923013914:ARbcT9jwPAS_B423dLM", "enableSample": true, "editTemplate": false, "allowTemplateCategoryChange": true, "addSecurityRecommendation": false, "isCPR": false, "cpr": false }, "createdOn": 1749550623322, "data": "Hi {{1}}, \nToday is the last day of the Big Billion Day's sale. Make the most out of it! | [Share Interests]", "elementName": "test_flows_1", "id": "b5ec0148-a2e3-1d96-b280-c1d161a5a0e7", "languageCode": "en", "languagePolicy": "deterministic", "meta": { "example": "Hi Sam, \nToday is the last day of the Big Billion Day's sale. Make the most out of it!" }, "modifiedOn": 1749550623322, "namespace": "8a499b40_4a56_518c_26fa_1f20f1d6aa18", "priority": 1, "quality": "UNKNOWN", "retry": 0, "stage": "NONE", "status": "PENDING", "templateType": "IMAGE", "vertical": "Sample template using Flow button with others", "wabaId": "145881286517812" } } | |
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 the Issue still persists then contact Gupshup Dev Support" } | For any Internal Error |