Limited Time Offer (LTO)

Use this API to create a LTO template.

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.)
templateTypeCAROUSEL{{TEMPLATE_TYPE}}StringRequiredThe type of template: CAROUSEL

Cards only to be passed if template type is CAROUSEL
exampleTemplate Example{{EXAMPLE}}StringRequired
enableSampleRequired for creating all types of templates{{ENABLE_SAMPLE}}true/falseOptionalif enableSample is true then exampleMedia
buttonsbuttons list[{"type":"COPY_CODE","example":"250FF"},{"type":"URL","text":"Shop Now","url":"<https://www.luckyshrub.com/shop?promo={{1}}","example":["summer2023"]},{"type":"URL","text":"Website","url":"https://www.luckyshrub.com/shop?promo={{1}}","example":["summer2023"]},{"type":"PHONE_NUMBER","text":"Call","phone_number":"918016337728"},{"type":"QUICK_REPLY","text":"Yes"},{"type":"QUICK_REPLY","text":"No"},{"type":"QUICK_REPLY","text":"Unsubscribe> from Promos"},{"type":"QUICK_REPLY","text":"Red"},{"type":"QUICK_REPLY","text":"Blue"},{"type":"QUICK_REPLY","text":"Green"}]StringRequired
hasExpirationSet true to add expiration to LTO templates{{HAS_EXPIRATION}}BooleanRequiredCopy code button component required if "has_expiration" is set to true.
isLTOLTO creation param{{ISLTO}}BooleanRequiredNeeds to be true to create LTO templates
limitedOfferTextLTO creation param{{LIMITED_OFFER_TEXT}}StringRequired
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 --request POST \
     --url https://partner.gupshup.io/partner/app/07c7c72d-20e3-4ff9-a5a1-14d1186eeec8/templates \
     --header 'accept: application/json' \
     --header 'content-type: application/x-www-form-urlencoded' \
     --header 'token: sk_8eb35b1f81c24af293a405164a392f30' \
     --data hasExpiration=true \
     --data isLTO=true \
     --data elementName=lto_temp_1 \
     --data languageCode=en \
     --data 'content=Hi All, Here are our products.' \
     --data category=MARKETING \
     --data vertical=aaa \
     --data templateType=TEXT \
     --data 'example=Hi All, Here are our products.' \
     --data allowTemplateCategoryChange=false \
     --data enableSample=false \
     --data 'buttons=[{"type":"COPY_CODE","example":"250FF"},{"type":"URL","text":"Shop Now","url":"https://www.luckyshrub.com/shop?promo={{1}}","example":["summer2023"]},{"type":"URL","text":"Website","url":"https://www.luckyshrub.com/shop?promo={{1}}","example":["summer2023"]},{"type":"PHONE_NUMBER","text":"Call","phone_number":"918016337728"},{"type":"QUICK_REPLY","text":"Yes"},{"type":"QUICK_REPLY","text":"No"},{"type":"QUICK_REPLY","text":"Unsubscribe from Promos"},{"type":"QUICK_REPLY","text":"Red"},{"type":"QUICK_REPLY","text":"Blue"},{"type":"QUICK_REPLY","text":"Green"}]' \
     --data 'limitedOfferText=offer limited'

Sample Response

{
  "status": "success",
  "template": {
    "appId": "07c7c72d-20e3-4ff9-a5a1-14d1186eeec8",
    "buttonSupported": "CC,PN,QR,URL",
    "category": "MARKETING",
    "containerMeta": "{\"appId\":\"07c7c72d-20e3-4ff9-a5a1-14d1186eeec8\",\"data\":\"Hi All, Here are our products.\",\"buttons\":[{\"type\":\"COPY_CODE\",\"example\":\"250FF\"},{\"type\":\"URL\",\"text\":\"Shop Now\",\"url\":\"https://www.luckyshrub.com/shop?promo={{1}}\",\"example\":[\"summer2023\"]},{\"type\":\"URL\",\"text\":\"Website\",\"url\":\"https://www.luckyshrub.com/shop?promo={{1}}\",\"example\":[\"summer2023\"]},{\"type\":\"PHONE_NUMBER\",\"text\":\"Call\",\"phone_number\":\"918016337728\"},{\"type\":\"QUICK_REPLY\",\"text\":\"Yes\"},{\"type\":\"QUICK_REPLY\",\"text\":\"No\"},{\"type\":\"QUICK_REPLY\",\"text\":\"Unsubscribe from Promos\"},{\"type\":\"QUICK_REPLY\",\"text\":\"Red\"},{\"type\":\"QUICK_REPLY\",\"text\":\"Blue\"},{\"type\":\"QUICK_REPLY\",\"text\":\"Green\"}],\"sampleText\":\"Hi All, Here are our products.\",\"enableSample\":true,\"editTemplate\":false,\"allowTemplateCategoryChange\":false,\"addSecurityRecommendation\":false,\"limitedTimeOffer\":{\"text\":\"offer limited\",\"has_expiration\":true}}",
    "createdOn": 1720520894377,
    "data": "Hi All, Here are our products.\noffer limited | true | [Copy offer code,{{1}}] | [Shop Now,https://www.luckyshrub.com/shop?promo={{1}}] | [Website,https://www.luckyshrub.com/shop?promo={{1}}] | [Call,918016337728] | [Yes] | [No] | [Unsubscribe from Promos] | [Red] | [Blue] | [Green]",
    "elementName": "lto_temp_2",
    "id": "fe6be44e-11f1-4c31-8ea3-08c06b51ded9",
    "languageCode": "en",
    "languagePolicy": "deterministic",
    "meta": "{\"example\":\"Hi All, Here are our products.\"}",
    "modifiedOn": 1720520894377,
    "namespace": "5ff5f84e_789b_44df_80dd_6844d48a6a4a",
    "priority": 1,
    "quality": "UNKNOWN",
    "retry": 0,
    "stage": "NONE",
    "status": "PENDING",
    "templateType": "TEXT",
    "vertical": "aaa",
    "wabaId": "116676371511027"
  }
}

Status Codes

Status CodeResponseComment
Success
200{ "status": "success", "template": { "appId": "07c7c72d-20e3-4ff9-a5a1-14d1186eeec8", "buttonSupported": "CC,PN,QR,URL", "category": "MARKETING", "containerMeta": "{\"appId\":\"07c7c72d-20e3-4ff9-a5a1-14d1186eeec8\",\"data\":\"Hi All, Here are our products.\",\"buttons\":\[{\"type\":\"COPY_CODE\",\"example\":\"250FF\"},{\"type\":\"URL\",\"text\":\"Shop Now\",\"url\":\"<https://www.luckyshrub.com/shop?promo={{1}}\",\"example\":[\"summer2023\"]},{\"type\":\"URL\",\"text\":\"Website\",\"url\":\"https://www.luckyshrub.com/shop?promo={{1}}\",\"example\":[\"summer2023\"]},{\"type\":\"PHONE_NUMBER\",\"text\":\"Call\",\"phone_number\":\"918016337728\"},{\"type\":\"QUICK_REPLY\",\"text\":\"Yes\"},{\"type\":\"QUICK_REPLY\",\"text\":\"No\"},{\"type\":\"QUICK_REPLY\",\"text\":\"Unsubscribe> from Promos\"},{\"type\":\"QUICK_REPLY\",\"text\":\"Red\"},{\"type\":\"QUICK_REPLY\",\"text\":\"Blue\"},{\"type\":\"QUICK_REPLY\",\"text\":\"Green\"}],\"sampleText\":\"Hi All, Here are our products.\",\"enableSample\":true,\"editTemplate\":false,\"allowTemplateCategoryChange\":false,\"addSecurityRecommendation\":false,\"limitedTimeOffer\":{\"text\":\"offer limited\",\"has_expiration\":true}}", "createdOn": 1720520894377, "data": "Hi All, Here are our products.\\noffer limited | true | [Copy offer code,{{1}}] | [Shop Now,https://www.luckyshrub.com/shop?promo={{1}}] | [Website,https://www.luckyshrub.com/shop?promo={{1}}] | [Call,918016337728] | [Yes] | [No] | [Unsubscribe from Promos] | [Red] | [Blue] | [Green]", "elementName": "lto_temp_2", "id": "fe6be44e-11f1-4c31-8ea3-08c06b51ded9", "languageCode": "en", "languagePolicy": "deterministic", "meta": "{\"example\":\"Hi All, Here are our products.\"}", "modifiedOn": 1720520894377, "namespace": "5ff5f84e_789b_44df_80dd_6844d48a6a4a", "priority": 1, "quality": "UNKNOWN", "retry": 0, "stage": "NONE", "status": "PENDING", "templateType": "TEXT", "vertical": "aaa", "wabaId": "116676371511027" } }
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!