Create Template
Use this API to create WhatsApp message templates, including text, media, call-to-action, quick reply, authentication, catalog, carousel, limited-time offer, multi-product, payment, and flow templates.
Endpoint details
| Field | Value |
|---|---|
| URL | https://apis.rmlconnect.net/wba/template/create |
| Authorization | jwt |
| API Key | jwt |
| Header parameter name | Authorization |
| Request Body schema | application/json |
Template type overview
Create templates with phone number and URL buttons.
Create templates with quick reply button options.
Create templates with image, video, or document headers.
Create text-based WhatsApp templates.
Create authentication templates with copy code OTP buttons.
Create authentication templates with one-tap autofill details.
Create catalog templates.
Create copy code templates.
Create carousel templates with cards and buttons.
Create limited-time offer templates.
Create multi-product message templates.
Create payment order details templates.
Create templates that launch a WhatsApp Flow.
Base request sample
{
"components": {
"body": {
"text": "{body text}"
},
"buttons": {
"elements": [
{
"contact_no": "{phone number with + and country code}",
"label": "{phone number label}"
},
{
"label": "{url label}",
"type": "static/dynamic",
"website": "{url with https}"
}
],
"type": "call_to_action"
},
"footer": {
"text": "{footer text}"
},
"header": {
"example": "{sample media url}",
"type": "image/video/document"
}
},
"language": [
"{lang code}"
],
"template_category": "ACCOUNT_UPDATE",
"template_name": "{template name}",
"template_type": "template"
}Request body schema
| Field | Type | Description |
|---|---|---|
| components | object (wbatemplatecreate_components) | The message components describe the template contents and include placeholders for dynamic variables. |
| language | Array of strings | Language code of language in which message text is written, such as "en" for English. |
| template_category | string | The best notification category that fits your WhatsApp template. For example, MARKETING, AUTHENTICATION, UTILITY. |
| template_name | string | Unique name of the WhatsApp message template that has only lowercase alphanumeric characters. |
| template_type | string | The type of media template that WhatsApp allows. |
Template examples
2). Call To Action
Request Sample
{
"template_name": "{template name}",
"language": [
"{lang code}"
],
"template_type": "template",
"template_category": "{template category}",
"components": {
"header": {
"type": "image/video/document",
"example": "{sample media url}"
},
"body": {
"text": "{body text}"
},
"footer": {
"text": "{footer text}"
},
"buttons": {
"type": "call_to_action",
"elements": [
{
"label": "{phone number label}",
"contact_no": "{phone number with + and country code}"
},
{
"label": "{url label}/{url label/{{1}}}",
"type": "static/dynamic",
"website": "{url with https}/{url with https/{{1}}}"
}
]
}
}
}Request Body schema
| Field | Type | Description |
|---|---|---|
| template_name | string | Name of the template. |
| language | Array of strings | Language code of language in which message text is written, such as "en" for English. |
| template_type | string | The type of media template that WhatsApp allows. |
| template_category | string | The category of the template. Must be one of: MARKETING, UTILITY, AUTHENTICATION. |
| components | object | Object containing the components of the template. |
3). Quick Reply Templates
Request Sample
{
"template_name": "{template name}",
"language": [
"{lang code}"
],
"template_type": "template",
"template_category": "{template category}",
"components": {
"header": {
"type": "image/video/document",
"example": "{sample media url}"
},
"body": {
"text": "{body text}"
},
"footer": {
"text": "{footer text}"
},
"buttons": {
"type": "quick_reply",
"elements": [
{
"label": "{button 1 label}"
},
{
"label": "{button 2 label}"
},
{
"label": "{button 3 label}"
}
]
}
}
}4). Media Template
Request Sample
{
"template_name": "{template name}",
"language": [
"{lang code}"
],
"template_type": "template",
"template_category": "ACCOUNT_UPDATE",
"components": {
"header": {
"type": "image/video/document",
"example": "{sample media url}"
},
"body": {
"text": "{body text}"
},
"footer": {
"text": "{footer text}"
}
}
}5). Text Template
Request Sample
{
"template_name": "{template name}",
"language": [
"{lang code}"
],
"template_type": "template",
"template_category": "{template category}",
"components": {
"body": {
"text": "{body text}"
},
"footer": {
"text": "{footer text}"
}
}
}6). Auth Copycode
Request Sample
{
"template_name": "{template name}",
"language": [
"{lang code}"
],
"template_type": "template",
"template_category": "AUTHENTICATION",
"components": {
"body": {
"add_security_recommendation": "true/false"
},
"footer": {
"code_expiration_minutes": {
"code expiry upto 90mins": "string"
}
},
"buttons": {
"type": "OTP",
"otp_type": "COPY_CODE",
"text": "Copy Code"
}
}
}7). Auth Autofill
Request Sample
{
"template_name": "{template_name}",
"language": [
"{lang code}"
],
"template_type": "template",
"template_category": "AUTHENTICATION",
"components": {
"body": {
"add_security_recommendation": "true/false"
},
"footer": {
"code_expiration_minutes": {
"upto 90 mins possible": "string"
}
},
"buttons": {
"type": "OTP",
"otp_type": "ONE_TAP",
"text": "Copy Code",
"autofill_text": "Autofill",
"package_name": "{package name of App}",
"signature_hash": "{signature_hash of App}"
}
}
}8). Catalog Template
Request Sample
{
"template_name": "{template name}",
"language": [
"en"
],
"template_category": "{template category}",
"template_type": "{template type}",
"components": {
"body": {
"text": "{body text}",
"example": [
"{example}"
]
},
"buttons": {
"type": "{button type}",
"elements": [
{
"type": "{button elements type}"
}
]
},
"footer": {
"text": "Thank You"
}
}
}9). Copy Code Template
Request Sample
{
"template_name": "{template name}",
"language": [
"en"
],
"template_category": "{template category}",
"template_type": "{ template type }",
"components": {
"body": {
"text": "{body text}",
"example": [
"10"
]
},
"header": {
"type": "{header type}",
"text": "{header text}"
},
"buttons": {
"type": "{button type}",
"elements": [
{
"type": "{button element type}",
"label": "{button element label}",
"website": "{sample url}"
},
{
"type": "{button element type}",
"example": "{button text example}"
}
]
},
"footer": {
"text": "{footer text}"
}
}
}10). Carousel Template
Request Sample
{
"template_name": "{template name}",
"language": [
"{lang code}"
],
"template_category": "{template category}",
"template_type": "{template type}",
"components": {
"body": {
"text": "{body text}",
"example": [
"100"
]
},
"cards": {
"header_type": "{ card header type}",
"header_example": "xxxxx://xxxxxxxxxxxx/200/300?xxxxxxxx",
"button_types": [
"{button type 1}",
"{button type 2}"
],
"elements": [
{
"body": {
"text": "{element body text}",
"example": [
"{example 1}",
"{example 2}"
]
},
"buttons": [
{
"type": "{element button type}",
"text": "{element button text}"
},
{
"type": "{element button type}",
"label": "{element button label}",
"website": "xxxxx://xxxxxxx/{{1}}",
"website_example": "xxxxx://xxxxxxxxxx/client"
}
]
},
{
"body": {
"text": "{element body text}",
"example": [
"{example 1}",
"{example 2}"
]
},
"buttons": [
{
"type": "{element button type}",
"text": "{element button text}"
},
{
"type": "{element button type}",
"label": "{element button label}",
"website": "xxxxx://xxxxxxxx/{{1}}",
"website_example": "xxxxx://xxxxxxx/student"
}
]
}
]
}
}
}11). Limited Time Offer Template
Request Sample
{
"template_name": "{template_name}",
"language": [
"{lang code}"
],
"template_type": "template",
"template_category": "MARKETING",
"components": {
"limited_time_offer": {
"text": "{lto text}",
"has_expiration": true
},
"body": {
"text": "{body text}"
},
"buttons": {
"type": "{button type}",
"elements": [
{
"type": "{button element type}",
"example": "{button element example}"
},
{
"label": "{button element label}",
"type": "{button element type}",
"website": "xxxxx://xxxxxxxx/",
"website_example": "xxxxx://xxxxxxxxxx/student"
}
]
}
}
}12). Multi Product Message Template
Request Sample
{
"template_name": "{template_name}",
"language": [
"{lang code}"
],
"template_type": "{template type}",
"template_category": "{template category}",
"components": {
"header": {
"type": "{header type}",
"text": "{header text}"
},
"body": {
"text": "{body text}"
},
"buttons": {
"type": "{button type}",
"elements": [
{
"text": "{button element text}"
}
]
}
}
}13). Payment Order Details Template
Request Sample
{
"template_name": "{template_name}",
"language": [
"{lang code}"
],
"template_type": "{template type}",
"template_category": "{template category}",
"template_sub_category": "{template sub category}",
"components": {
"header": {
"type": "{header type}",
"text": "{header text}"
},
"body": {
"text": "{body text}"
},
"footer": {
"text": "{fotter text}"
},
"buttons": {
"type": "{button type}",
"elements": [
{
"text": "{button element text}"
}
]
}
}
}14). Flow Creation Template
Request Sample
{
"template_name": "{template_name}",
"language": [
"{lang code}"
],
"template_type": "{template type}",
"template_category": "{template category}",
"components": {
"header": {
"type": "{header type}",
"text": "{header text}"
},
"body": {
"text": "{body text}"
},
"buttons": {
"type": "{button type}",
"elements": [
{
"text": "{button element text}",
"flow_id": "{flow id}",
"navigation_screen": "{Flows Json screen name}",
"flow_action": "{flow action}"
}
]
}
}
}Responses
200 Success
Response
{
"id": "79804437842xxxx",
"status": "APPROVED",
"category": "MARKETING"
}Response Schema: application/json
| Field | Type | Description |
|---|---|---|
| id | string | The unique identification of a template. |
| status | string | The status of the template. |
| category | string | The template category. Must be one of: MARKETING, UTILITY, AUTHENTICATION. |
400 Bad Request
Response
{
"message": "template with name : testdocum1 and language : ['en'] already exists."
}Response Schema: application/json
| Field | Type | Description |
|---|---|---|
| message | string | The message response. |
401 Authentication Failure
Response
{
"message": "unable to process campaign request",
"reason": "jwt token expired",
"status": "failure"
}Response Schema: application/json
| Field | Type | Description |
|---|---|---|
| message | string | The message response. |
| reason | string | The reason for not processing a request. |
| status | string | The status of the template. |
404 Page Not Found
Response
{
"message": "The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again."
}Response Schema: application/json
| Field | Type | Description |
|---|---|---|
| message | string | The message response. |
422 Unprocessable Entity (WebDAV)
Response
{
"template_category": [
"Must be one of: MARKETING, UTILITY, AUTHENTICATION."
]
}Response Schema: application/json
| Field | Type | Description |
|---|---|---|
| template_category | Array of strings | The template category. Must be one of: MARKETING, UTILITY, AUTHENTICATION. |
500 Internal Server Error
Response
{
"message": "Internal Server Error"
}Response Schema: application/json
| Field | Type | Description |
|---|---|---|
| message | string | The message response. |
Updated 12 days ago