Location

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.)
templateTypeLOCATION {{TEMPLATE_TYPE}}StringRequiredThe type of template: LOCATION
exampleTemplate Example{{EXAMPLE}}StringRequired
enableSampleRequired for creating all types of templates{{ENABLE_SAMPLE}}true/falseOptionalif enableSample is true then exampleMedia
footerFooter of the template. Character limit: 60.{{FOOTER}}StringOptional
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
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 --request POST \
     --url https://partner.gupshup.io/partner/app/{{APP_ID}}/templates \
     --header 'accept: application/json' \
     --header 'content-type: application/x-www-form-urlencoded' \
     --header 'Authorization: sk_711916ad1d5d4f21a9520fdef20516a1' \
     --data elementName=template_automationk1 \
     --data languageCode=en \
     --data 'content=The place for the event is kothrud,Pune' \
     --data category=UTILITY \
     --data vertical=Internal_vertical \
     --data templateType=LOCATION \
     --data 'example=The place for the event is kothrud,Pune' \
     --data allowTemplateCategoryChange=true \
     --data 'footer=This is footer' \
     --data enableSample=true

Sample Response

{
  "status": "success",
  "template": {
    "appId": "947d28b8-459b-4dfe-9d4c-0ac8c6c245c9",
    "category": "UTILITY",
    "containerMeta": "{\"appId\":\"947d28b8-459b-4dfe-9d4c-0ac8c6c245c9\",\"data\":\"The place for the event is kothrud,Pune\",\"footer\":\"This is footer\",\"sampleText\":\"The place for the event is kothrud,Pune\",\"enableSample\":true,\"editTemplate\":false,\"allowTemplateCategoryChange\":true,\"addSecurityRecommendation\":false}",
    "createdOn": 1720713893197,
    "data": "The place for the event is kothrud,Pune\nThis is footer",
    "elementName": "template_automationk1",
    "id": "222d0517-b1b3-49ba-8861-e36be991a7a9",
    "languageCode": "en",
    "languagePolicy": "deterministic",
    "meta": "{\"example\":\"The place for the event is kothrud,Pune\"}",
    "modifiedOn": 1720713893197,
    "namespace": "8e58971e_b9b8_476c_b844_64a1aa63a73c",
    "priority": 2,
    "quality": "UNKNOWN",
    "retry": 0,
    "stage": "NONE",
    "status": "PENDING",
    "templateType": "LOCATION",
    "vertical": "Internal_vertical",
    "wabaId": "117529881248706"
  }
}

Status Codes

Status CodeResponseComment
Success
200{ "status": "success", "template": { "appId": "947d28b8-459b-4dfe-9d4c-0ac8c6c245c9", "category": "UTILITY", "containerMeta": "{\"appId\":\"947d28b8-459b-4dfe-9d4c-0ac8c6c245c9\",\"data\":\"The place for the event is kothrud,Pune\",\"footer\":\"This is footer\",\"sampleText\":\"The place for the event is kothrud,Pune\",\"enableSample\":true,\"editTemplate\":false,\"allowTemplateCategoryChange\":true,\"addSecurityRecommendation\":false}", "createdOn": 1720713893197, "data": "The place for the event is kothrud,Pune\\nThis is footer", "elementName": "template_automationk1", "id": "222d0517-b1b3-49ba-8861-e36be991a7a9", "languageCode": "en", "languagePolicy": "deterministic", "meta": "{\"example\":\"The place for the event is kothrud,Pune\"}", "modifiedOn": 1720713893197, "namespace": "8e58971e_b9b8_476c_b844_64a1aa63a73c", "priority": 2, "quality": "UNKNOWN", "retry": 0, "stage": "NONE", "status": "PENDING", "templateType": "LOCATION", "vertical": "Internal_vertical", "wabaId": "117529881248706" } }
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!