Location

Request Parameters

Key Description Value Data Type Required/Optional Constraints

Authorization

Access Token for the application

{{PARTNER_APP_TOKEN}}

String

Required

Should be a valid Partner App Access Token

elementName

The name of a template. The element name is unique for a WABAs namespace.

{{ELEMENT_NAME}}

String

Required

elementName (not more than 180 char.) Mandatory fields

languageCode

Language code for the template. Refer to all the language codes here.

{{LANGUAGE_CODE}}

String

Optional

languageCode default value : en_US

content

The body of the template.

{{CONTENT}}

String

Required

content (not more than 1024 char.)

category

The category of your template.

{{CATEGORY}}

String

Required

Category Type: MARKETING UTILITY

vertical

TEXT

{{VERTICAL}}

String

Required

vertical (not more than 180 char.)

templateType

LOCATION

{{TEMPLATE_TYPE}}

String

Required

The type of template: LOCATION

example

Template Example

{{EXAMPLE}}

String

Required

enableSample

Required for creating all types of templates

{{ENABLE_SAMPLE}}

true/false

Optional

if enableSample is true then exampleMedia

footer

Footer of the template. Character limit: 60.

{{FOOTER}}

String

Optional

allowTemplateCategoryChange

Boolean 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/false

Optional

appId

App ID to fetch the access token

{{APP_ID}}

String

Required

The 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!