Create template from metalibrary

Creates a new WhatsApp template on the app by cloning an entry from the shared template library rather than authoring the copy from scratch.

Request parameters

Path parameters

KeyDescriptionValuesData TypeRequired/Optional
appIdIdentifier of the WhatsApp app the call acts on.6f414190-d45c-4671-bca1-fb6c3018cb13StringRequired

Body

KeyDescriptionValuesData TypeRequired/Optional
elementNameUnique element name for the templateorder_shipped—Required
categoryTemplate category (e.g. UTILITY, MARKETING, AUTHENTICATION)UTILITY—Required
languageCodeBCP-47 language codeen—Required
libraryTemplateNameMeta library template name to instantiateutility_order_shipped—Required
buttonsButton parameters as a JSON array string. Each element: {"type":"QUICK_REPLY","parameter":{"type":"payload","payload":"VALUE"}}[{"type":"QUICK_REPLY","parameter":{"type":"payload","payload":"YES"}}]—Optional
libraryTemplateBodyInputsBody variable inputs as a JSON object string. Pass when the library template has body variables to fill.{"add_security_recommendation":false}—Optional
addSecurityRecommendationAdd security recommendation to OTP templates. Used to build libraryTemplateBodyInputs when that field is blank.——Optional
codeExpirationMinutesOTP code expiration in minutes. Used to build libraryTemplateBodyInputs when that field is blank.——Optional
addContactNumberInclude contact number in OTP templates. Used to build libraryTemplateBodyInputs when that field is blank.——Optional

Sample cURL — Create template from metalibrary.

curl --request POST \
  --url 'https://partner.gupshup.io/partner/bizgate/app/6f414190-d45c-4671-bca1-fb6c3018cb13/template/metalibrary' \
  --header 'Authorization: Bearer <UT>' \
  --header 'Accept: application/json' \
  --data-urlencode 'elementName=order_shipped' \
  --data-urlencode 'category=UTILITY' \
  --data-urlencode 'languageCode=en' \
  --data-urlencode 'libraryTemplateName=utility_order_shipped' \
  --data-urlencode 'buttons=[{"type":"QUICK_REPLY","parameter":{"type":"payload","payload":"YES"}}]' \
  --data-urlencode 'libraryTemplateBodyInputs={"add_security_recommendation":false}' \
  --data-urlencode 'addSecurityRecommendation=' \
  --data-urlencode 'codeExpirationMinutes=' \
  --data-urlencode 'addContactNumber='

Sample success response (200)

{
  "status": "success",
  "template": {
    "appId": "72aeca04-1839-4b1a-bc0d-4ec2140d0e58",
    "category": "MARKETING",
    "containerMeta": "{\"appId\":\"72aeca04-1839-4b1a-bc0d-4ec2140d0e58\",\"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\"]}],\"sampleText\":\"Hi All, Here are our products.\",\"enableSample\":true,\"editTemplate\":false,\"addSecurityRecommendation\":false,\"limitedTimeOffer\":{\"text\":\"offer limited\",\"has_expiration\":true},\"isCPR\":false,\"cpr\":false}",
    "createdOn": 1787728719434,
    "data": "Hi All, Here are our products.\noffer limited | true | [Copy offer code,{{1}}] | [Shop Now,https://www.luckyshrub.com/shop?promo={{1}}]",
    "elementName": "flash_sale_lto_v2",
    "id": "e2f5248e-5d2c-4248-b466-d8af0fa47347",
    "languageCode": "en",
    "languagePolicy": "deterministic",
    "meta": "{\"example\":\"Hi All, Here are our products.\"}",
    "modifiedOn": 1787728719434,
    "namespace": "28245a35_2995_4998_a7a7_d4e86fa48eab",
    "priority": 1,
    "quality": "UNKNOWN",
    "retry": 0,
    "stage": "NONE",
    "status": "PENDING",
    "templateType": "TEXT",
    "vertical": "Promotion",
    "wabaId": "1399511105666438"
  }
}
Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Path Params
string
required

Identifier of the WhatsApp app the call acts on.

Form Data

Metalibrary create form fields

string
required

Unique element name for the template

string
required

Template category (e.g. UTILITY, MARKETING, AUTHENTICATION)

string
required

BCP-47 language code

string
required

Meta library template name to instantiate

string

Button parameters as a JSON array string. Each element: {"type":"QUICK_REPLY","parameter":{"type":"payload","payload":"VALUE"}}

string

Body variable inputs as a JSON object string. Pass when the library template has body variables to fill.

boolean

Add security recommendation to OTP templates. Used to build libraryTemplateBodyInputs when that field is blank.

int32

OTP code expiration in minutes. Used to build libraryTemplateBodyInputs when that field is blank.

boolean

Include contact number in OTP templates. Used to build libraryTemplateBodyInputs when that field is blank.

Responses

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