Image

Request Parameters

KeyDescriptionValueData TypeRequired/OptionalConstraints
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}}StringOptionallanguageCode default value : en_US
contentThe body of the template. Character limit: 1028. For "Authentication" category the first line should be - {{1}} is your verification code.{{CONTENT}}StringRequiredcontent (not more than 1024 char.)
categoryThe category of your template. {{CATEGORY}}StringRequired
verticalTEXT{{VERTICAL}}StringRequiredvertical (not more than 180 char.)
footerFooter of the template.{{FOOTER}}StringOptional
templateTypeIMAGE {{TEMPLATE_TYPE}}StringRequired
exampleTemplate Example{{EXAMPLE}}StringRequired
exampleMediaHandle Id required to generate media templates{{ENABLE_MEDIA}}StringRequiredThis is handleId.

Generate handleId here
enableSampleRequired for creating all types of templates{{ENABLE_SAMPLE}}true/falseOptionalif enableSample is true then exampleMedia
allowTemplateCategoryChangeBoolean value. If True, Meta will automatically update the category of the template as per the template content. Default value is False.{{ALLOW_TEMPLATE_CATEGORY_CHANGE}}BooleanOptional
appIdApp 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 'Authorization: {{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 'footer={{FOOTER}}' \
--data-urlencode 'category={{CATEGORY}}' \
--data-urlencode 'templateType={{TEMPLATE_TYPE}}' \
--data-urlencode 'vertical={{VERTICAL}}' \
--data-urlencode 'example={{EXAMPLE}}' \
--data-urlencode 'exampleMedia={{EXAMPLE_MEDIA}}' \
--data-urlencode 'enableSample={{ENABLE_SAMPLE}}' \
--data-urlencode 'allowTemplateCategoryChange={{ALLOW_TEMPLATE_CATEGORY_CHANGE}}'

Sample Response

{
    "status": "success",
    "template": {
        "appId": "a41b30f4-d202-4fdb-911e-3a8fbfbfb797",
        "category": "MARKETING",
        "containerMeta": "{\"appId\":\"a41b30f4-d202-4fdb-911e-3a8fbfbfb797\",\"data\":\"Hi {{1}}.\",\"footer\":\"This is the footer\",\"sampleText\":\"Hi There.\",\"sampleMedia\":\"4::aW1hZ2UvcadG5n:ARYaMMMA2QvIXuQZdPjWVXTOqfoBU3n0L1Ftyg4w57yxi9nD105yQDvW2nu3-HNo9HGefxZ-Ig-HAi3YSsckwIsOEUwxSPatsxT0Niob30E63A:e:1634884682:2281283925530161:100033655335566:ARaBAxW-1L-ZRu6SMSg\",\"enableSample\":true,\"editTemplate\":false,\"allowTemplateCategoryChange\":true,\"addSecurityRecommendation\":false}",
        "createdOn": 1716282767027,
        "data": "Hi {{1}}.\nThis is the footer",
        "elementName": "image_element",
        "id": "e676c31d-ff1d-42f1-bea1-88049da5b94f",
        "languageCode": "en",
        "languagePolicy": "deterministic",
        "meta": "{\"example\":\"Hi There.\"}",
        "modifiedOn": 1716282767027,
        "namespace": "9c7fe92f_2a48_40ec_83d0_69c62a772433",
        "priority": 1,
        "quality": "UNKNOWN",
        "retry": 0,
        "stage": "NONE",
        "status": "PENDING",
        "templateType": "IMAGE",
        "vertical": "Ticket update",
        "wabaId": "104505526065633"
    }
}

Status Codes

Status CodeResponseComments
Success
200{
"status": "success",
"template": {
"appId": "a41b30f4-d202-4fdb-911e-3a8fbfbfb797",
"category": "MARKETING",
"containerMeta": "{"appId":"a41b30f4-d202-4fdb-911e-3a8fbfbfb797","data":"Hi {{1}}.","footer":"This is the footer","sampleText":"Hi There.","sampleMedia":"4::aW1hZ2UvcadG5n:ARYaMMMA2QvIXuQZdPjWVXTOqfoBU3n0L1Ftyg4w57yxi9nD105yQDvW2nu3-HNo9HGefxZ-Ig-HAi3YSsckwIsOEUwxSPatsxT0Niob30E63A:e:1634884682:2281283925530161:100033655335566:ARaBAxW-1L-ZRu6SMSg","enableSample":true,"editTemplate":false,"allowTemplateCategoryChange":true,"addSecurityRecommendation":false}",
"createdOn": 1716282767027,
"data": "Hi {{1}}.\nThis is the footer",
"elementName": "image_element",
"id": "e676c31d-ff1d-42f1-bea1-88049da5b94f",
"languageCode": "en",
"languagePolicy": "deterministic",
"meta": "{"example":"Hi There."}",
"modifiedOn": 1716282767027,
"namespace": "9c7fe92f_2a48_40ec_83d0_69c62a772433",
"priority": 1,
"quality": "UNKNOWN",
"retry": 0,
"stage": "NONE",
"status": "PENDING",
"templateType": "IMAGE",
"vertical": "Ticket update",
"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!