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
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://qa-partner-api.gupshup.io/partner/app/bf9ee64c-3d4d-4ac4-8668-732e577007c4/templates' \
--header 'token: sk_419da6a9b81e4377aea9a4f26951a38d' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'elementName=automation_template_908376' \
--data-urlencode 'languageCode=en' \
--data-urlencode 'content=The place for the event is kothrud,Pune' \
--data-urlencode 'category=UTILITY' \
--data-urlencode 'appId=bf9ee64c-3d4d-4ac4-8668-732e577007c4' \
--data-urlencode 'vertical=Internal_vertical' \
--data-urlencode 'templateType=LOCATION' \
--data-urlencode 'example=The place for the event is kothrud,Pune' \
--data-urlencode 'allowTemplateCategoryChange=true' \
--data-urlencode 'checkerApprovalRequired=false' \
--data-urlencode 'enableSample=true' \
--data-urlencode 'footer=This is footer'

Sample Response

{
    "status": "success",
    "template": {
        "appId": "bf9ee64c-3d4d-4ac4-8668-732e577007c4",
        "category": "UTILITY",
        "containerMeta": "{\"appId\":\"bf9ee64c-3d4d-4ac4-8668-732e577007c4\",\"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": 1710798305595,
        "data": "The place for the event is kothrud,Pune\nThis is footer",
        "elementName": "automation_template_908376",
        "id": "b61ee9a9-ef22-48e0-bc65-30b01b6f9917",
        "languageCode": "en",
        "languagePolicy": "deterministic",
        "meta": "{\"example\":\"The place for the event is kothrud,Pune\"}",
        "modifiedOn": 1710798305595,
        "namespace": "18cfa544_9c62_4dcd_b8f3_b3785d8c917c",
        "priority": 2,
        "quality": "UNKNOWN",
        "retry": 0,
        "stage": "NONE",
        "status": "PENDING",
        "templateType": "LOCATION",
        "vertical": "Internal_vertical",
        "wabaId": "216141188246170"
    }
}

Status Codes

Status CodeResponseComment
Success
200{
"status":"success",
"template":{
"appId":"a41b30f4-d202-4fdb-911e-3a8fbfbfb797",
"category":"UTILITY",
"containerMeta":"{"appId":"a41b30f4-d202-4fdb-911e-3a8fbfbfb797","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":1715598159948,
"data":"The place for the event is kothrud,Pune\nThis is footer",
"elementName":"template_automationkj",
"id":"8ab1d9bc-aa7a-4f75-a977-bf79ff128ff0",
"languageCode":"en",
"languagePolicy":"deterministic",
"meta":"{"example":"The place for the event is kothrud,Pune"}",
"modifiedOn":1715598159948,
"namespace":"9c7fe92f_2a48_40ec_83d0_69c62a772433",
"priority":2,
"quality":"UNKNOWN",
"retry":0,
"stage":"NONE",
"status":"PENDING",
"templateType":"LOCATION",
"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!