Get Templates

Use this API to get the list of templates for your Gupshup App

Starting June 1, 2024, to ensure that all templates are correctly categorized, Meta has implemented a recurring process that automatically identifies and updates the category of any marketing or utility templates that have been miscategorized, according to their guidelines.

In this process, meta will now send two webhook events for template_category_update.

  1. The first one is the alert event which informs about the template’s current category and the correct category it belongs to.
  2. The second event (sent on the 1st of the next month after the alert event) is the actual category update event informing that the template’s category has now been updated.

Parameters

KeyDescriptionValuesRequired/OptionalTypeConstraints
AuthorizationAccess Token for the application{{PARTNER_APP_TOKEN}}RequiredStringShould be a valid Partner App Access Token
APP IDApp ID to fetch the access tokenbf9ee64c-3d4d-4ac4-xxxx-732e577007c4RequiredStringThe 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 GET 'https://partner.gupshup.io/partner/app/{{APP_ID}}/templates' \
--header 'Authorization: {{PARTNER_APP_TOKEN}}'

Sample Response

{
  "status": "success",
  "templates": [
    {
      "appId": "3cb92fbd-0bac-41d7-818e-4e4326d90335",
      "buttonSupported": "PN,URL",
      "category": "MARKETING",
      "containerMeta": "{\"data\":\"Exclusive deals on car and train bookings. Book now..!! flejpaiqah9z\",\"buttons\":[{\"type\":\"PHONE_NUMBER\",\"text\":\"Contact\",\"phone_number\":\"+919139472766\"},{\"type\":\"URL\",\"text\":\"Gupshup\",\"url\":\"https://www.google.com/\"}],\"header\":\"Dear {{1}}\",\"footer\":\"Thank you\",\"sampleText\":\"Exclusive deals on car and train bookings. Book now..!! flejpaiqah9z\",\"sampleHeader\":\"Dear [user]\",\"enableSample\":true,\"editTemplate\":false,\"allowTemplateCategoryChange\":false,\"addSecurityRecommendation\":false,\"correctCategory\":\"UTILITY\"}",
      "createdOn": 1717510871793,
      "data": "Dear {{1}}\nExclusive deals on car and train bookings. Book now..!! flejpaiqah9z\nThank you | [Contact,+919139472766] | [Gupshup,https://www.google.com/]",
      "elementName": "qa_automation_qa_automation_112907flejpaiqah9z",
      "externalId": "<metaTemplateId>",
      "id": "51eddb1e-8e36-44df-a9e5-2815e4f8463b",
      "internalCategory": 0,
      "internalType": 0,
      "languageCode": "en",
      "languagePolicy": "deterministic",
      "meta": "{\"example\":\"Exclusive deals on car and train bookings. Book now..!! flejpaiqah9z\"}",
      "modifiedOn": 1717511304250,
      "namespace": "<namespace>",
      "oldCategory": "UTILITY",
      "priority": 1,
      "quality": "UNKNOWN",
      "retry": 0,
      "stage": "NONE",
      "status": "APPROVED",
      "templateType": "TEXT",
      "wabaId": "106579118720596"
    }
  ]
}

Response

Status CodeResponseComments
Success
200{ "status": "success", "templates": \[ { "appId": "3cb92fbd-0bac-41d7-818e-4e4326d90335", "buttonSupported": "PN,URL", "category": "MARKETING", "containerMeta": "{\"data\":\"Exclusive deals on car and train bookings. Book now..!! flejpaiqah9z\",\"buttons\":[{\"type\":\"PHONE_NUMBER\",\"text\":\"Contact\",\"phone_number\":\"+919139472766\"},{\"type\":\"URL\",\"text\":\"Gupshup\",\"url\":\"https://www.google.com/\"}],\"header\":\"Dear {{1}}\",\"footer\":\"Thank you\",\"sampleText\":\"Exclusive deals on car and train bookings. Book now..!! flejpaiqah9z\",\"sampleHeader\":\"Dear [user]\",\"enableSample\":true,\"editTemplate\":false,\"allowTemplateCategoryChange\":false,\"addSecurityRecommendation\":false,\"correctCategory\":\"UTILITY\"}", "createdOn": 1717510871793, "data": "Dear {{1}}\\nExclusive deals on car and train bookings. Book now..!! flejpaiqah9z\\nThank you | [Contact,+919139472766] | [Gupshup,https://www.google.com/]", "elementName": "qa_automation_qa_automation_112907flejpaiqah9z", "externalId": "<metaTemplateId>", "id": "51eddb1e-8e36-44df-a9e5-2815e4f8463b", "internalCategory": 0, "internalType": 0, "languageCode": "en", "languagePolicy": "deterministic", "meta": "{\"example\":\"Exclusive deals on car and train bookings. Book now..!! flejpaiqah9z\"}", "modifiedOn": 1717511304250, "namespace": "<namespace>", "oldCategory": "UTILITY", "priority": 1, "quality": "UNKNOWN", "retry": 0, "stage": "NONE", "status": "APPROVED", "templateType": "TEXT", "wabaId": "106579118720596" } ] }
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!