Catalog

Request Parameters

KeyDescriptionValueData TypeRequired/Optional Constraints
AuthorizationAccess Token for the application{{PARTNER_APP_TOKEN}}StringRequiredShould be a valid Partner App Access Token
elementNameThe name of a template. The element name is unique for a WABAs namespace.{{ELEMENT_NAME}}StringRequiredelementName (not more than 180 char.) Mandatory fields
languageCodeLanguage code for the template. Refer to all the language codes here.{{LANGUAGE_CODE}}StringOptional languageCode default value : en_US
contentThe body of the template.{{CONTENT}}StringRequiredcontent (not more than 1024 char.)
categoryThe category of your template.{{CATEGORY}}StringRequiredCategory Type: MARKETING UTILITY
verticalTEXT {{VERTICAL}}StringRequiredvertical (not more than 180 char.)
templateTypeCATALOG{{TEMPLATE_TYPE}}StringRequiredThe type of template: CATALOG
exampleTemplate Example{{EXAMPLE}}StringRequired
allowTemplateCategoryChangeBoolean value. If True, Meta will automatically update the template category as per the template content. The default value is False.{{ALLOW_TEMPLATE_CATEGORY_CHANGE}}true/falseOptional
APP IDApp ID to fetch the access token{{APP_ID}}StringRequiredThe 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

Sample Request

curl --location --request POST 'https://partner.gupshup.io/partner/app/{{APP_ID}}/templates' \
--header 'token: {{PARTNER_APP_TOKEN}}' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'elementName={{ELEMENT_NAME}}' \
--data-urlencode 'languageCode={{LANGUAGE_CODE}}' \
--data-urlencode 'content={{CONTENT}}' \
--data-urlencode 'category={{CATEGORY}}' \
--data-urlencode 'vertical={{VERTICAL}}' \
--data-urlencode 'templateType={{TEMPLATE_TYPE}}' \
--data-urlencode 'example={{EXAMPLE}}' \
--data-urlencode 'allowTemplateCategoryChange={{ALLOW_TEMPLATE_CATEGORY_CHANGE}}'

Sample Response

{
    "status": "success",
    "template": {
        "appId": "a41b30f4-d202-4fdb-911e-3a8fbfbfb797",
        "buttonSupported": "CLG",
        "category": "MARKETING",
        "containerMeta": "{\"appId\":\"a41b30f4-d202-4fdb-911e-3a8fbfbfb797\",\"data\":\"Dear BatMan, here are our products.\",\"buttons\":[{\"type\":\"CATALOG\",\"text\":\"View catalog\"}],\"sampleText\":\"Dear BatMan, here are our products.\",\"enableSample\":true,\"editTemplate\":false,\"allowTemplateCategoryChange\":true,\"addSecurityRecommendation\":false}",
        "createdOn": 1710799900239,
        "data": "Dear BatMan, here are our products. | [View catalog]",
        "elementName": "automation_template_503642",
        "id": "09c335c2-f9a5-44b7-b544-2e4be761840b",
        "languageCode": "en",
        "languagePolicy": "deterministic",
        "meta": "{\"example\":\"Dear BatMan, here are our products.\"}",
        "modifiedOn": 1710799900239,
        "namespace": "9c7fe92f_2a48_40ec_83d0_69c62a772433",
        "priority": 1,
        "quality": "UNKNOWN",
        "retry": 0,
        "stage": "NONE",
        "status": "PENDING",
        "templateType": "CATALOG",
        "vertical": "Internal_vertical",
        "wabaId": "104505526065633"
    }
}

Status Codes

Status CodeResponseComment
Success
200{ "status": "success", "template": { "appId": "a41b30f4-d202-4fdb-911e-3a8fbfbfb797", "buttonSupported": "CLG", "category": "MARKETING", "containerMeta": "{"appId":"a41b30f4-d202-4fdb-911e-3a8fbfbfb797","data":"Dear BatMan\\nHere are our products.","buttons":[{"type":"CATALOG","text":"View catalog"}],"sampleText":"Dear BatMan\\nHere are our products.","enableSample":true,"editTemplate":false,"allowTemplateCategoryChange":true,"addSecurityRecommendation":false}", "createdOn": 1715598979361, "data": "Dear BatMan\nHere are our products. | [View catalog]", "elementName": "auto_cattemplate", "id": "a4a77e59-f305-4964-bfad-5dcb0a7d1aa9", "languageCode": "en", "languagePolicy": "deterministic", "meta": "{"example":"Dear BatMan\\nHere are our products."}", "modifiedOn": 1715598979361, "namespace": "9c7fe92f_2a48_40ec_83d0_69c62a772433", "priority": 1, "quality": "UNKNOWN", "retry": 0, "stage": "NONE", "status": "PENDING", "templateType": "CATALOG", "vertical": "Internal_vertical", "wabaId": "104505526065633" } }
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
Language
Click Try It! to start a request and see the response here!