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
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 'https://qa-partner-api.gupshup.io/partner/app/a41b30f4-d202-4fdb-911e-3a8fbfbfb797/template/msg' \
--header 'Connection: keep-alive' \
--header 'Authorization: sk_f5ad875b74c84a22b3bfc7bdd7bc551a' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'source=918929874278' \
--data-urlencode 'sandbox=false' \
--data-urlencode 'destination=918888998545' \
--data-urlencode 'template={"id": "9ff51097-48c9-47c7-a4e4-a9bb5801d8ea","params": []}' \
--data-urlencode 'src.name=august18' \
--data-urlencode 'message={"type":"IMAGE","image":{"link":"https://storage.googleapis.com/glific1/uploads/outbound/2024-1/Harshita%20Jain/823e4974-0032-40f7-83a8-b3e332bf9928.png"}}'

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!