post
https://partner.gupshup.io/partner/bizgate/app//template/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
| Key | Description | Values | Data Type | Required/Optional |
|---|---|---|---|---|
| appId | Identifier of the WhatsApp app the call acts on. | 6f414190-d45c-4671-bca1-fb6c3018cb13 | String | Required |
Body
| Key | Description | Values | Data Type | Required/Optional |
|---|---|---|---|---|
| elementName | Unique element name for the template | order_shipped | — | Required |
| category | Template category (e.g. UTILITY, MARKETING, AUTHENTICATION) | UTILITY | — | Required |
| languageCode | BCP-47 language code | en | — | Required |
| libraryTemplateName | Meta library template name to instantiate | utility_order_shipped | — | Required |
| buttons | Button 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 |
| libraryTemplateBodyInputs | Body variable inputs as a JSON object string. Pass when the library template has body variables to fill. | {"add_security_recommendation":false} | — | Optional |
| addSecurityRecommendation | Add security recommendation to OTP templates. Used to build libraryTemplateBodyInputs when that field is blank. | — | — | Optional |
| codeExpirationMinutes | OTP code expiration in minutes. Used to build libraryTemplateBodyInputs when that field is blank. | — | — | Optional |
| addContactNumber | Include 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
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
Loading…