Crear Plantilla
curl --request POST \
--url https://api.jelou.ai/v1/bots/{botId}/templates \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"language": "<string>",
"elementName": "<string>",
"template": "<string>",
"isVisible": true,
"params": [
{
"param": "<string>",
"label": "<string>",
"example": "<string>"
}
],
"paramsNumber": 123,
"displayName": "<string>",
"mediaUrl": "<string>",
"buttons": [
{
"text": "<string>",
"url": "<string>",
"phone_number": "<string>",
"example": "<string>"
}
],
"header": "<string>",
"exampleHeader": "<string>",
"headerParams": [
{}
],
"example": "<string>",
"extraSettings": {
"addSecurityRecommendation": true,
"codeExpirationMinutes": 45,
"allowChangeCategory": true
}
}
'import requests
url = "https://api.jelou.ai/v1/bots/{botId}/templates"
payload = {
"language": "<string>",
"elementName": "<string>",
"template": "<string>",
"isVisible": True,
"params": [
{
"param": "<string>",
"label": "<string>",
"example": "<string>"
}
],
"paramsNumber": 123,
"displayName": "<string>",
"mediaUrl": "<string>",
"buttons": [
{
"text": "<string>",
"url": "<string>",
"phone_number": "<string>",
"example": "<string>"
}
],
"header": "<string>",
"exampleHeader": "<string>",
"headerParams": [{}],
"example": "<string>",
"extraSettings": {
"addSecurityRecommendation": True,
"codeExpirationMinutes": 45,
"allowChangeCategory": True
}
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
language: '<string>',
elementName: '<string>',
template: '<string>',
isVisible: true,
params: [{param: '<string>', label: '<string>', example: '<string>'}],
paramsNumber: 123,
displayName: '<string>',
mediaUrl: '<string>',
buttons: [
{
text: '<string>',
url: '<string>',
phone_number: '<string>',
example: '<string>'
}
],
header: '<string>',
exampleHeader: '<string>',
headerParams: [{}],
example: '<string>',
extraSettings: {
addSecurityRecommendation: true,
codeExpirationMinutes: 45,
allowChangeCategory: true
}
})
};
fetch('https://api.jelou.ai/v1/bots/{botId}/templates', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.jelou.ai/v1/bots/{botId}/templates",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'language' => '<string>',
'elementName' => '<string>',
'template' => '<string>',
'isVisible' => true,
'params' => [
[
'param' => '<string>',
'label' => '<string>',
'example' => '<string>'
]
],
'paramsNumber' => 123,
'displayName' => '<string>',
'mediaUrl' => '<string>',
'buttons' => [
[
'text' => '<string>',
'url' => '<string>',
'phone_number' => '<string>',
'example' => '<string>'
]
],
'header' => '<string>',
'exampleHeader' => '<string>',
'headerParams' => [
[
]
],
'example' => '<string>',
'extraSettings' => [
'addSecurityRecommendation' => true,
'codeExpirationMinutes' => 45,
'allowChangeCategory' => true
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.jelou.ai/v1/bots/{botId}/templates"
payload := strings.NewReader("{\n \"language\": \"<string>\",\n \"elementName\": \"<string>\",\n \"template\": \"<string>\",\n \"isVisible\": true,\n \"params\": [\n {\n \"param\": \"<string>\",\n \"label\": \"<string>\",\n \"example\": \"<string>\"\n }\n ],\n \"paramsNumber\": 123,\n \"displayName\": \"<string>\",\n \"mediaUrl\": \"<string>\",\n \"buttons\": [\n {\n \"text\": \"<string>\",\n \"url\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"example\": \"<string>\"\n }\n ],\n \"header\": \"<string>\",\n \"exampleHeader\": \"<string>\",\n \"headerParams\": [\n {}\n ],\n \"example\": \"<string>\",\n \"extraSettings\": {\n \"addSecurityRecommendation\": true,\n \"codeExpirationMinutes\": 45,\n \"allowChangeCategory\": true\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.jelou.ai/v1/bots/{botId}/templates")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"language\": \"<string>\",\n \"elementName\": \"<string>\",\n \"template\": \"<string>\",\n \"isVisible\": true,\n \"params\": [\n {\n \"param\": \"<string>\",\n \"label\": \"<string>\",\n \"example\": \"<string>\"\n }\n ],\n \"paramsNumber\": 123,\n \"displayName\": \"<string>\",\n \"mediaUrl\": \"<string>\",\n \"buttons\": [\n {\n \"text\": \"<string>\",\n \"url\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"example\": \"<string>\"\n }\n ],\n \"header\": \"<string>\",\n \"exampleHeader\": \"<string>\",\n \"headerParams\": [\n {}\n ],\n \"example\": \"<string>\",\n \"extraSettings\": {\n \"addSecurityRecommendation\": true,\n \"codeExpirationMinutes\": 45,\n \"allowChangeCategory\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.jelou.ai/v1/bots/{botId}/templates")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"language\": \"<string>\",\n \"elementName\": \"<string>\",\n \"template\": \"<string>\",\n \"isVisible\": true,\n \"params\": [\n {\n \"param\": \"<string>\",\n \"label\": \"<string>\",\n \"example\": \"<string>\"\n }\n ],\n \"paramsNumber\": 123,\n \"displayName\": \"<string>\",\n \"mediaUrl\": \"<string>\",\n \"buttons\": [\n {\n \"text\": \"<string>\",\n \"url\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"example\": \"<string>\"\n }\n ],\n \"header\": \"<string>\",\n \"exampleHeader\": \"<string>\",\n \"headerParams\": [\n {}\n ],\n \"example\": \"<string>\",\n \"extraSettings\": {\n \"addSecurityRecommendation\": true,\n \"codeExpirationMinutes\": 45,\n \"allowChangeCategory\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"message": [
"<string>"
],
"status": "<string>",
"data": {}
}{
"message": "<string>",
"statusMessage": "<string>",
"status": 123,
"error": {
"code": "<string>",
"key": "<string>",
"description": "<string>",
"developerMessages": {},
"clientMessages": {}
},
"validationError": {}
}{
"message": "<string>",
"statusMessage": "<string>",
"status": 123,
"error": {
"code": "<string>",
"key": "<string>",
"description": "<string>",
"developerMessages": {},
"clientMessages": {}
},
"validationError": {}
}{
"message": "<string>",
"statusMessage": "<string>",
"status": 123,
"error": {
"code": "<string>",
"key": "<string>",
"description": "<string>",
"developerMessages": {},
"clientMessages": {}
},
"validationError": {}
}Templates
Create Template
Create a new HSM template and submit it to WhatsApp for approval
POST
/
v1
/
bots
/
{botId}
/
templates
Crear Plantilla
curl --request POST \
--url https://api.jelou.ai/v1/bots/{botId}/templates \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"language": "<string>",
"elementName": "<string>",
"template": "<string>",
"isVisible": true,
"params": [
{
"param": "<string>",
"label": "<string>",
"example": "<string>"
}
],
"paramsNumber": 123,
"displayName": "<string>",
"mediaUrl": "<string>",
"buttons": [
{
"text": "<string>",
"url": "<string>",
"phone_number": "<string>",
"example": "<string>"
}
],
"header": "<string>",
"exampleHeader": "<string>",
"headerParams": [
{}
],
"example": "<string>",
"extraSettings": {
"addSecurityRecommendation": true,
"codeExpirationMinutes": 45,
"allowChangeCategory": true
}
}
'import requests
url = "https://api.jelou.ai/v1/bots/{botId}/templates"
payload = {
"language": "<string>",
"elementName": "<string>",
"template": "<string>",
"isVisible": True,
"params": [
{
"param": "<string>",
"label": "<string>",
"example": "<string>"
}
],
"paramsNumber": 123,
"displayName": "<string>",
"mediaUrl": "<string>",
"buttons": [
{
"text": "<string>",
"url": "<string>",
"phone_number": "<string>",
"example": "<string>"
}
],
"header": "<string>",
"exampleHeader": "<string>",
"headerParams": [{}],
"example": "<string>",
"extraSettings": {
"addSecurityRecommendation": True,
"codeExpirationMinutes": 45,
"allowChangeCategory": True
}
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
language: '<string>',
elementName: '<string>',
template: '<string>',
isVisible: true,
params: [{param: '<string>', label: '<string>', example: '<string>'}],
paramsNumber: 123,
displayName: '<string>',
mediaUrl: '<string>',
buttons: [
{
text: '<string>',
url: '<string>',
phone_number: '<string>',
example: '<string>'
}
],
header: '<string>',
exampleHeader: '<string>',
headerParams: [{}],
example: '<string>',
extraSettings: {
addSecurityRecommendation: true,
codeExpirationMinutes: 45,
allowChangeCategory: true
}
})
};
fetch('https://api.jelou.ai/v1/bots/{botId}/templates', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.jelou.ai/v1/bots/{botId}/templates",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'language' => '<string>',
'elementName' => '<string>',
'template' => '<string>',
'isVisible' => true,
'params' => [
[
'param' => '<string>',
'label' => '<string>',
'example' => '<string>'
]
],
'paramsNumber' => 123,
'displayName' => '<string>',
'mediaUrl' => '<string>',
'buttons' => [
[
'text' => '<string>',
'url' => '<string>',
'phone_number' => '<string>',
'example' => '<string>'
]
],
'header' => '<string>',
'exampleHeader' => '<string>',
'headerParams' => [
[
]
],
'example' => '<string>',
'extraSettings' => [
'addSecurityRecommendation' => true,
'codeExpirationMinutes' => 45,
'allowChangeCategory' => true
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.jelou.ai/v1/bots/{botId}/templates"
payload := strings.NewReader("{\n \"language\": \"<string>\",\n \"elementName\": \"<string>\",\n \"template\": \"<string>\",\n \"isVisible\": true,\n \"params\": [\n {\n \"param\": \"<string>\",\n \"label\": \"<string>\",\n \"example\": \"<string>\"\n }\n ],\n \"paramsNumber\": 123,\n \"displayName\": \"<string>\",\n \"mediaUrl\": \"<string>\",\n \"buttons\": [\n {\n \"text\": \"<string>\",\n \"url\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"example\": \"<string>\"\n }\n ],\n \"header\": \"<string>\",\n \"exampleHeader\": \"<string>\",\n \"headerParams\": [\n {}\n ],\n \"example\": \"<string>\",\n \"extraSettings\": {\n \"addSecurityRecommendation\": true,\n \"codeExpirationMinutes\": 45,\n \"allowChangeCategory\": true\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.jelou.ai/v1/bots/{botId}/templates")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"language\": \"<string>\",\n \"elementName\": \"<string>\",\n \"template\": \"<string>\",\n \"isVisible\": true,\n \"params\": [\n {\n \"param\": \"<string>\",\n \"label\": \"<string>\",\n \"example\": \"<string>\"\n }\n ],\n \"paramsNumber\": 123,\n \"displayName\": \"<string>\",\n \"mediaUrl\": \"<string>\",\n \"buttons\": [\n {\n \"text\": \"<string>\",\n \"url\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"example\": \"<string>\"\n }\n ],\n \"header\": \"<string>\",\n \"exampleHeader\": \"<string>\",\n \"headerParams\": [\n {}\n ],\n \"example\": \"<string>\",\n \"extraSettings\": {\n \"addSecurityRecommendation\": true,\n \"codeExpirationMinutes\": 45,\n \"allowChangeCategory\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.jelou.ai/v1/bots/{botId}/templates")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"language\": \"<string>\",\n \"elementName\": \"<string>\",\n \"template\": \"<string>\",\n \"isVisible\": true,\n \"params\": [\n {\n \"param\": \"<string>\",\n \"label\": \"<string>\",\n \"example\": \"<string>\"\n }\n ],\n \"paramsNumber\": 123,\n \"displayName\": \"<string>\",\n \"mediaUrl\": \"<string>\",\n \"buttons\": [\n {\n \"text\": \"<string>\",\n \"url\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"example\": \"<string>\"\n }\n ],\n \"header\": \"<string>\",\n \"exampleHeader\": \"<string>\",\n \"headerParams\": [\n {}\n ],\n \"example\": \"<string>\",\n \"extraSettings\": {\n \"addSecurityRecommendation\": true,\n \"codeExpirationMinutes\": 45,\n \"allowChangeCategory\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"message": [
"<string>"
],
"status": "<string>",
"data": {}
}{
"message": "<string>",
"statusMessage": "<string>",
"status": 123,
"error": {
"code": "<string>",
"key": "<string>",
"description": "<string>",
"developerMessages": {},
"clientMessages": {}
},
"validationError": {}
}{
"message": "<string>",
"statusMessage": "<string>",
"status": 123,
"error": {
"code": "<string>",
"key": "<string>",
"description": "<string>",
"developerMessages": {},
"clientMessages": {}
},
"validationError": {}
}{
"message": "<string>",
"statusMessage": "<string>",
"status": 123,
"error": {
"code": "<string>",
"key": "<string>",
"description": "<string>",
"developerMessages": {},
"clientMessages": {}
},
"validationError": {}
}Create custom HSM templates with positional parameters, interactive buttons, and media. Optionally, submit the template directly to WhatsApp for approval.
POST /v1/bots/{botId}/templates
Templates must be approved by the WhatsApp team before they can be used. Follow Meta’s guidelines to avoid rejections.
Path Parameters
| Property | Type | Description |
|---|---|---|
| botId | string | Unique bot ID. Example: 123456789 |
Query Parameters
| Property | Type | Description |
|---|---|---|
| sendToAprove | boolean | Defines whether the template should be submitted to WhatsApp for approval. |
Request Body
| Property | Type | Description |
|---|---|---|
| category | string | HSM template category. Values: UTILITY, MARKETING, AUTHENTICATION |
| language | string | Template language. |
| isVisible | boolean | Defines whether the template should be shown to operators. |
| params | array | Parameter structure. For the authentication category, Meta has restricted to one parameter. |
| paramsNumber | number | Number of parameters. For the authentication category, Meta has restricted to one parameter. |
| elementName | string | Unique identifier for the template. Can only contain lowercase letters, underscores (_), and numbers. |
| displayName | string | Display name of the template. |
| template | string | Template body. For the authentication category, Meta has restricted the content. |
| type | string | HSM type. Values: HSM, IMAGE, VIDEO, DOCUMENT |
| mediaUrl | string | Media URL. Required when the HSM type is IMAGE, VIDEO, DOCUMENT. Not applicable for the authentication category. |
| interactiveAction | string | HSM interactive action. Values: NONE, CALL_TO_ACTION, QUICK_REPLY, OTP |
| buttons | array | Button structure. Required when the HSM interactive action is CALL_TO_ACTION, QUICK_REPLY, or OTP. |
| header | string | Template header. Applicable only for text-type templates. Not applicable for the authentication category and has a 60-character limit. |
| exampleHeader | string | Header example. Required only if the template will have a header. |
| headerParams | array | Parameter structure. The header supports a maximum of one parameter. |
| example | string | Template example. If the template has a parameter, it must be replaced with an example. |
| extraSettings | object | Optional settings for the template. |
Request Examples
Text
Text
curl --request POST \
--url 'https://api.jelou.ai/v1/bots/BOT_ID/templates?sendToAprove=true' \
--header 'Authorization: Basic {{Base64EncodedUsername:Password}}' \
--header 'Content-Type: application/json' \
--data '{
"displayName": "text_template_utility",
"template": "Thank you for your order, {{1}}! Your confirmation number is {{2}}. If you have any questions, contact support.",
"example": "Thank you for your order, Maria! Your confirmation number is 71936. If you have any questions, contact support.",
"elementName": "text_template_utility",
"params": [
{"param": "1", "label": "customer", "example": "Maria"},
{"param": "2", "label": "order", "example": "71936"}
],
"paramsNumber": 2,
"type": "HSM",
"language": "en",
"category": "UTILITY",
"interactiveAction": "NONE"
}'
Text with quick reply buttons
Text with quick reply buttons
curl --request POST \
--url 'https://api.jelou.ai/v1/bots/BOT_ID/templates?sendToAprove=true' \
--header 'Authorization: Basic {{Base64EncodedUsername:Password}}' \
--header 'Content-Type: application/json' \
--data '{
"displayName": "template_quick_reply",
"template": "Thank you for your order, {{1}}! Your confirmation number is {{2}}. Use the buttons to contact us.",
"example": "Thank you for your order, Maria! Your confirmation number is 57893. Use the buttons to contact us.",
"elementName": "template_quick_reply",
"params": [
{"param": "1", "label": "customer", "example": "Maria"},
{"param": "2", "label": "order", "example": "57893"}
],
"paramsNumber": 2,
"type": "HSM",
"language": "en",
"category": "UTILITY",
"interactiveAction": "QUICK_REPLY",
"buttons": [
{"text": "Contact Support", "type": "QUICK_REPLY"},
{"text": "Contact Sales", "type": "QUICK_REPLY"}
]
}'
Text with CTA buttons
Text with CTA buttons
curl --request POST \
--url 'https://api.jelou.ai/v1/bots/BOT_ID/templates?sendToAprove=true' \
--header 'Authorization: Basic {{Base64EncodedUsername:Password}}' \
--header 'Content-Type: application/json' \
--data '{
"displayName": "template_call_action",
"template": "Thank you for your order, {{1}}! Your confirmation number is {{2}}. Use the buttons to contact us.",
"example": "Thank you for your order, Maria! Your confirmation number is 67996. Use the buttons to contact us.",
"elementName": "template_call_action",
"params": [
{"param": "1", "label": "customer", "example": "Maria"},
{"param": "2", "label": "order", "example": "67996"}
],
"paramsNumber": 2,
"type": "HSM",
"language": "en",
"category": "UTILITY",
"interactiveAction": "CALL_TO_ACTION",
"buttons": [
{"text": "Contact Support", "type": "URL", "url": "https://apps.jelou.ai", "example": "https://apps.jelou.ai"},
{"text": "Call", "type": "PHONE_NUMBER", "phone_number": "+PHONE_NUMBER"}
]
}'
Image
Image
curl --request POST \
--url 'https://api.jelou.ai/v1/bots/BOT_ID/templates?sendToAprove=true' \
--header 'Authorization: Basic {{Base64EncodedUsername:Password}}' \
--header 'Content-Type: application/json' \
--data '{
"displayName": "image_template",
"template": "Hello {{1}}. We invite you to check out our promotions.",
"example": "Hello Maria. We invite you to check out our promotions.",
"elementName": "image_template",
"params": [
{"param": "1", "label": "customer", "example": "Maria"}
],
"paramsNumber": 1,
"type": "IMAGE",
"language": "en",
"category": "MARKETING",
"mediaUrl": "https://cdn.example.com/image.jpeg",
"interactiveAction": "NONE"
}'
Document
Document
curl --request POST \
--url 'https://api.jelou.ai/v1/bots/BOT_ID/templates?sendToAprove=true' \
--header 'Authorization: Basic {{Base64EncodedUsername:Password}}' \
--header 'Content-Type: application/json' \
--data '{
"displayName": "document_template",
"template": "Hello {{1}}. Please find your requested document attached.",
"example": "Hello Maria. Please find your requested document attached.",
"elementName": "document_template",
"params": [
{"param": "1", "label": "customer", "example": "Maria"}
],
"paramsNumber": 1,
"type": "DOCUMENT",
"language": "en",
"category": "MARKETING",
"mediaUrl": "https://cdn.example.com/document.pdf",
"interactiveAction": "NONE"
}'
Video
Video
curl --request POST \
--url 'https://api.jelou.ai/v1/bots/BOT_ID/templates?sendToAprove=true' \
--header 'Authorization: Basic {{Base64EncodedUsername:Password}}' \
--header 'Content-Type: application/json' \
--data '{
"displayName": "video_template",
"template": "Hello {{1}}. Watch our new video.",
"example": "Hello Maria. Watch our new video.",
"elementName": "video_template",
"params": [
{"param": "1", "label": "customer", "example": "Maria"}
],
"paramsNumber": 1,
"type": "VIDEO",
"language": "en",
"category": "MARKETING",
"mediaUrl": "https://cdn.example.com/video.mp4",
"interactiveAction": "NONE"
}'
Responses
200 - Successful response
200 - Successful response
{
"message": ["Template has been created."],
"status": "success",
"data": {
"template": "Hello! We are *Jelou*. \nWelcome _{{1}}_. Soon {{2}} from the team will reach out to you.",
"displayName": "Welcome",
"elementName": "test_hsm_api",
"params": [
{"label": "Customer name", "param": "1"},
{"label": "Agent name", "param": "2"}
],
"paramsNumber": 2,
"isVisible": false,
"language": "EN",
"createdAt": "2021-01-28T15:08:38.492Z",
"updatedAt": "2021-01-28T15:08:38.492Z",
"botId": "BOT_ID",
"companyId": 100,
"status": "APPROVED"
}
}
400 - Bad Request
400 - Bad Request
{
"message": ["Template name already exists"],
"status": "failed"
}
401 - Unauthorized
401 - Unauthorized
{
"message": "Authentication failed"
}
404 - Not Found
404 - Not Found
{
"message": ["The Bot could not be found at the moment."],
"statusMessage": "failed",
"error": {
"code": "E1019",
"key": "BOT_NOT_FOUND"
}
}
The
status field in the response indicates whether your template has been approved by WhatsApp.Language
The language supported by WhatsApp is detailed on the official page. Please review it carefully at the following link.Content Restrictions (Authentication Category)
Meta has restricted content for the authentication category. The content will be according to the template language. Meta is restricted to a single parameter.Language
| Language | Code | Content |
|---|---|---|
| English | en | {{1}} is your verification code. |
| Portuguese (BR) | pt_BR | Seu código de verificação é {{1}}. |
| Spanish | es | Tu código de verificación es {{1}}. |
Parameter Structure
Use the following structure in theparams field when creating a template:
[
{"label": "Customer name", "param": "1"},
{"label": "Order number", "param": "2"}
]
Button Structure
Use the following structure in thebuttons field when the interactive actions are CALL_TO_ACTION, QUICK_REPLY, or OTP.
QUICK_REPLY
Used to obtain quick replies. It is an array of objects and can have a maximum of 3 buttons.| Property | Description |
|---|---|
| text | Button text, this value cannot be updated. |
| type | Button type. Value: QUICK_REPLY |
[
{"text": "More information", "type": "QUICK_REPLY"},
{"text": "Talk to an operator", "type": "QUICK_REPLY"},
{"text": "Sales", "type": "QUICK_REPLY"}
]
CALL_TO_ACTION
Used to offer a call to action. Can have a maximum of 2 buttons and a maximum of 1 button of each type.| Property | Description |
|---|---|
| text | Button text, this value cannot be updated. |
| type | Button type. Values: PHONE_NUMBER, URL |
| phone_number | Button phone number. |
| url | Button URL. |
| example | URL example. Required when the button type is URL. |
[
{"text": "Sales", "phone_number": "+PHONE_NUMBER", "type": "PHONE_NUMBER"},
{"type": "URL", "text": "View site", "url": "https://apps.jelou.ai/{{1}}", "example": "https://apps.jelou.ai/offers"}
]
OTP
Used to obtain a “One Time Password”. Can have a maximum of 1 button.| Property | Description |
|---|---|
| text | Button text, this value cannot be updated. |
| type | Button type. Value: OTP |
[
{"text": "COPY CODE", "type": "OTP"}
]
extraSettings Structure
| Property | Type | Description |
|---|---|---|
| addSecurityRecommendation | boolean | Adds an additional security message in authentication templates. |
| codeExpirationMinutes | number | Adds a footer message with the code expiration time. Values between 1 and 90 minutes. |
| allowChangeCategory | boolean | Allows Meta to update the template category if necessary. |
Authorizations
Basic authentication using Base64 encoded clientId:clientSecret
Path Parameters
Query Parameters
Body
application/json
Available options:
UTILITY, MARKETING, AUTHENTICATION Pattern:
^[a-z0-9_]+$Show child attributes
Show child attributes
Available options:
HSM, IMAGE, VIDEO, DOCUMENT Available options:
NONE, CALL_TO_ACTION, QUICK_REPLY, OTP Show child attributes
Show child attributes
Maximum string length:
60Show child attributes
Show child attributes
Was this page helpful?
⌘I