Create Template from Template Library

API to create template from pre approved Meta Library Template

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

Rate Limit

10 Requests per Minute


Sample Request

curl --location --request POST 'https://partner.gupshup.io/partner/app/:appId/template/metalibrary' \
--header 'Authorization: {{PARTNER_APP_TOKEN}}' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'elementName={{NEW_ELEMENT_NAME}}' \
--data-urlencode 'category=UTILITY' \
--data-urlencode 'languageCode={{LANGUAGE_CODE_OF_LIBRARY_TEMPLATE}}' \
--data-urlencode 'libraryTemplateName={{NAME_OF_LIBRARY_TEMPLATE}}' \
--data-urlencode 'buttons={{BUTTONS_IN_SAME_FORMAT_LIKE_LIBRARY_TEMPLATE}}}'

Sample Response

      {
  "status": "success",
  "templates": {
    "buttonSupported": "URL",
    "category": "UTILITY",
    "containerMeta": "{\"data\":\"Hei, {{1}}\\n\\nDen nye kontoen din er opprettet.\\n\\nBekreft {{2}} hello.\",\"buttons\":[{\"type\":\"URL\",\"text\":\"Bekreft konto\",\"url\":\"https://www.example.com/\"}],\"header\":\"hello\",\"sampleText\":\"Hei, John\\n\\nhello.\\n\\nhello.\",\"sampleHeader\":\"hello\",\"enableSample\":true,\"editTemplate\":false,\"allowTemplateCategoryChange\":false,\"addSecurityRecommendation\":false}",
    "createdOn": 1721897898300,
    "data": "Fullfør konfigurering av konto\nHei, {{1}}\n\nhellot.\n\nhello {{2}} hello",
    "elementName": "jul23libtest1_8",
    "externalId": "399568216474711",
    "id": "0cc281c9-dc45-4ea3-bf50-411e9b8ff9b3",
    "languageCode": "nb",
    "languagePolicy": "deterministic",
    "meta": "{\"example\":\"Hei, John\\n\\nhello.\\n\\nhello\"}",
    "modifiedOn": 1721897898300,
    "namespace": "18cfa544_9c62_4dcd_b8f3_b3785d8c917c",
    "quality": "UNKNOWN",
    "status": "APPROVED",
    "templateType": "TEXT",
    "wabaId": "216141188246170"
  }
}

Request Parameters

KeyDescriptionConstraints
Headers
PARTNER_APP_TOKENApp Access Token issued post partner loginShould be a valid partner app access token belonging to the passed appId
Form Params
elementNameName of new element name to be createdTemplate name
categoryCategory nameCurrently only UTILITY and AUTHENTICATION is supported
languageCodeMeta language code
libraryTemplateNameName of meta library template used as base templateElement name of meta library template
buttonsButtons list for new templateButtons list of meta library template
libraryTemplateBodyInputs

Provide authentication related details.

(AUTHENTICATION)

Path Params
appIdApp Id for the app that is linked to the Partner Account

Status Codes

Status CodeResponseComments
Error
401{
"message": "Authentication Failed",
"status": "error"
}
429{
"status": "error",
"message": "Too Many Requests"
}
10 Requests per Minute
500{
"status": "error",
"message": "Internal Server Error"
}
For any Internal Error
400{
"status": "error",
"message": "Language is missing"
}
If languageCode is not provided
400{
"status": "error",
"message": "Library Template Name is missing"
}
If libraryTemplateName is not provided
400{
"status": "error",
"message": " The parameter library_template_button_inputs[0]['type'] is required. - null, null"
}
If button type is not provided
400{
"status": "error",
"message": "Template Already exists with same namespace and elementName and languageCode"
}
If name of template already exists
400{
"status": "error",
"message": "Category is missing"
}
If category is not provided
400{
"status": "error",
"message": "Template Name is missing"
}
If elementName is not provided
Path Params
string
required
Query Params
requestParams
object
required
Responses

Language
Credentials
Bearer
JWT
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json