curl --request POST \
--url https://api.jelou.ai/v2/whatsapp/{botId}/hsm \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"elementName": "<string>",
"destinations": [
"<string>"
],
"mediaUrl": "<string>",
"filename": "<string>",
"type": "text",
"language": "en",
"parameters": [
"<string>"
],
"buttonPayloads": [
{}
],
"actions": {},
"headerParameters": [
"<string>"
],
"buttonParameters": [
{
"type": "URL",
"payload": {},
"param": 123
}
],
"ltoParams": {
"expirationTime": 123
},
"cards": [
{
"mediaUrl": "<string>",
"params": [
"<string>"
],
"buttonParameters": [
{
"type": "URL",
"payload": {},
"param": 123
}
]
}
],
"expirationTime": "<string>",
"campaignId": "<string>"
}
'[
{
"id": "<string>",
"destination": "<string>"
}
]Send personalized HSM messages to individual recipients using the WhatsApp API
curl --request POST \
--url https://api.jelou.ai/v2/whatsapp/{botId}/hsm \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"elementName": "<string>",
"destinations": [
"<string>"
],
"mediaUrl": "<string>",
"filename": "<string>",
"type": "text",
"language": "en",
"parameters": [
"<string>"
],
"buttonPayloads": [
{}
],
"actions": {},
"headerParameters": [
"<string>"
],
"buttonParameters": [
{
"type": "URL",
"payload": {},
"param": 123
}
],
"ltoParams": {
"expirationTime": 123
},
"cards": [
{
"mediaUrl": "<string>",
"params": [
"<string>"
],
"buttonParameters": [
{
"type": "URL",
"payload": {},
"param": 123
}
]
}
],
"expirationTime": "<string>",
"campaignId": "<string>"
}
'[
{
"id": "<string>",
"destination": "<string>"
}
]POST https://api.jelou.ai/v2/whatsapp/{botId}/hsm
type): Defines the type of template to be sent.| Property | Type | Description | Required |
|---|---|---|---|
| mediaUrl | string | Public URL of the media file. Required if your template is of type video, image, or document. | Conditional |
| filename | string | File name for document-type templates. | Conditional |
| type | string | Message type: text, hsm, image, document, video, catalog, carousel. Defaults to text. | No |
| language | string | Template language: en, es, pt | No |
| elementName | string | Name of the approved template. | Yes |
| parameters | array | Set of strings that replace values in the template. | Yes |
| destinations | array | List of phone numbers. Numeric format with country code, without + or spaces. | Yes |
| buttonPayloads | array | Information for quick reply buttons. | No |
| actions | object | Template configuration and actions in payload format. | No |
| headerParameters | array | Header parameter, maximum 1 parameter. | No |
| thumbnailProduct | string | Thumbnail image URL. Required for catalog templates. | Conditional |
| expirationTime | string | Expiration time in timestamp format (milliseconds). | No |
| campaignId | string | Unique identifier of the associated campaign. | No |
| buttonParameters | array | Configuration for all button types. | No |
| ltoParams | object | Limited time offer (LTO) parameters. | No |
| cards | array | Content cards for carousel templates. | No |
Text message
curl --request POST \
--url 'https://api.jelou.ai/v2/whatsapp/BOT_ID/hsm' \
--header 'Authorization: Basic {{Base64EncodedUsername:Password}}' \
--header 'Content-Type: application/json' \
--data '{
"parameters": ["PARAMETER_1", "PARAMETER_2"],
"destinations": ["PHONE_NUMBER"],
"elementName": "ELEMENT_NAME"
}'
Message with image
curl --request POST \
--url 'https://api.jelou.ai/v2/whatsapp/BOT_ID/hsm' \
--header 'Authorization: Basic {{Base64EncodedUsername:Password}}' \
--header 'Content-Type: application/json' \
--data '{
"parameters": ["PARAMETER_1", "PARAMETER_2"],
"mediaUrl": "https://cdn.example.com/image.jpeg",
"type": "image",
"destinations": ["PHONE_NUMBER"],
"elementName": "ELEMENT_NAME"
}'
Message with video
curl --request POST \
--url 'https://api.jelou.ai/v2/whatsapp/BOT_ID/hsm' \
--header 'Authorization: Basic {{Base64EncodedUsername:Password}}' \
--header 'Content-Type: application/json' \
--data '{
"parameters": ["PARAMETER_1", "PARAMETER_2"],
"mediaUrl": "https://cdn.example.com/video.mp4",
"type": "video",
"destinations": ["PHONE_NUMBER"],
"elementName": "ELEMENT_NAME"
}'
Message with attached document
curl --request POST \
--url 'https://api.jelou.ai/v2/whatsapp/BOT_ID/hsm' \
--header 'Authorization: Basic {{Base64EncodedUsername:Password}}' \
--header 'Content-Type: application/json' \
--data '{
"parameters": ["PARAMETER_1"],
"mediaUrl": "https://cdn.example.com/document.pdf",
"type": "document",
"destinations": ["PHONE_NUMBER"],
"elementName": "ELEMENT_NAME"
}'
Text message with static URL action buttons
curl --request POST \
--url 'https://api.jelou.ai/v2/whatsapp/BOT_ID/hsm' \
--header 'Authorization: Basic {{Base64EncodedUsername:Password}}' \
--header 'Content-Type: application/json' \
--data '{
"parameters": ["PARAMETER_1"],
"destinations": ["PHONE_NUMBER"],
"elementName": "ELEMENT_NAME"
}'
Text message with dynamic URL action buttons
curl --request POST \
--url 'https://api.jelou.ai/v2/whatsapp/BOT_ID/hsm' \
--header 'Accept-Language: en' \
--header 'Authorization: Basic {{Base64EncodedUsername:Password}}' \
--header 'Content-Type: application/json' \
--data '{
"destinations": ["PHONE_NUMBER"],
"parameters": ["PARAMETER_1"],
"elementName": "ELEMENT_NAME",
"buttonParameters": [
{
"type": "URL",
"payload": {"param": "PARAM_URL"}
}
]
}'
Text message with Quick Reply buttons
curl --request POST \
--url 'https://api.jelou.ai/v2/whatsapp/BOT_ID/hsm' \
--header 'Authorization: Basic {{Base64EncodedUsername:Password}}' \
--header 'Content-Type: application/json' \
--data '{
"elementName": "ELEMENT_NAME",
"language": "en",
"type": "text",
"parameters": ["param1", "param2"],
"destinations": ["PHONE_NUMBER"],
"buttonParameters": [
{
"type": "QUICK_REPLY",
"payload": {"type": "edge", "action": "BTN1", "skillId": "1"}
},
{
"type": "QUICK_REPLY",
"payload": {"type": "edge", "action": "BTN2", "skillId": "2"}
},
{
"type": "QUICK_REPLY",
"payload": {"type": "edge", "action": "BTN3", "skillId": "3"}
}
]
}'
Personalized text message with header parameters
curl --request POST \
--url 'https://api.jelou.ai/v2/whatsapp/BOT_ID/hsm' \
--header 'Authorization: Basic {{Base64EncodedUsername:Password}}' \
--header 'Content-Type: application/json' \
--data '{
"elementName": "ELEMENT_NAME",
"destinations": ["PHONE_NUMBER"],
"parameters": ["PARAMETER_1", "PARAMETER_2"],
"headerParameters": ["PARAMETER_VALUE"]
}'
Full catalog
curl --request POST \
--url 'https://api.jelou.ai/v2/whatsapp/BOT_ID/hsm' \
--header 'Authorization: Basic {{Base64EncodedUsername:Password}}' \
--header 'Content-Type: application/json' \
--data '{
"elementName": "ELEMENT_NAME",
"destinations": ["PHONE_NUMBER"],
"parameters": ["PARAMETER_1"],
"type": "catalog",
"buttonParameters": [
{
"type": "CATALOG",
"payload": {"thumbnailProduct": "productId"}
}
]
}'
LTO with copy code button
curl --request POST \
--url 'https://api.jelou.ai/v2/whatsapp/BOT_ID/hsm' \
--header 'Authorization: Basic {{Base64EncodedUsername:Password}}' \
--header 'Content-Type: application/json' \
--data '{
"buttonOptions": {},
"elementName": "ELEMENT_NAME",
"destinations": ["PHONE_NUMBER"],
"parameters": ["PARAMETER_1", "PARAMETER_2"],
"type": "image",
"mediaUrl": "https://cdn.example.com/image.jpeg",
"ltoParams": {"expirationTime": 1733260800000},
"buttonParameters": [
{
"type": "COPY_CODE",
"param": 1,
"payload": {"param": "20OFF"}
}
]
}'
Authentication
curl --request POST \
--url 'https://api.jelou.ai/v2/whatsapp/BOT_ID/hsm' \
--header 'Authorization: Basic {{Base64EncodedUsername:Password}}' \
--header 'Content-Type: application/json' \
--data '{
"buttonOptions": {},
"elementName": "ELEMENT_NAME",
"destinations": ["PHONE_NUMBER"],
"parameters": ["PARAMETER_1"],
"type": "hsm"
}'
Carousel with 2 cards
curl --request POST \
--url 'https://api.jelou.ai/v2/whatsapp/BOT_ID/hsm' \
--header 'Authorization: Basic {{Base64EncodedUsername:Password}}' \
--header 'Content-Type: application/json' \
--data '{
"elementName": "ELEMENT_NAME",
"destinations": ["PHONE_NUMBER"],
"parameters": [],
"type": "carousel",
"cards": [
{
"mediaUrl": "https://cdn.example.com/product1.jpg",
"params": ["PARAMETER_VALUE"],
"buttonParameters": [
{
"type": "QUICK_REPLY",
"payload": {"action": "Button 1", "type": "edge", "skillId": "45515", "cardIndex": 0}
}
]
},
{
"mediaUrl": "https://cdn.example.com/product2.jpg",
"params": ["PARAMETER_VALUE_1", "PARAMETER_VALUE_2"],
"buttonParameters": [
{
"type": "QUICK_REPLY",
"payload": {"action": "Button 2", "type": "edge", "skillId": "10192", "cardIndex": 1}
}
]
}
]
}'
+ sign must be omitted, the country code must be included, and only numeric characters are allowed. Dashes or spaces are not accepted.
| ✅ Correct format | ❌ Incorrect format | ❌ Incorrect format |
|---|---|---|
| PHONE_NUMBER | +PHONE_NUMBER | 09XXXXXXXX |
Button Payload
buttonPayloads field when your template includes quick reply buttons using skills; this will allow you to activate additional flows within the conversation based on the action selected by the user.[
{"type": "edge", "action": "Yes", "skillId": "1"},
{"type": "edge", "action": "Reschedule", "skillId": "2"},
{"type": "edge", "action": "Cancel", "skillId": "3"}
]
type, action, and skillId. The action key defines the text that will appear on the button, while skillId indicates the ID of the skill that the button will activate.Actions Payload
{
"actions": {
"setSkill": {"id": 2222}
}
}
{
"actions": {
"setMemoryParams": {
"url": "https://apps.jelou.ai"
}
}
}
setMemoryParams with their respective key-value fields.
{
"actions": {
"setMemoryParams": {
"url": "https://apps.jelou.ai"
}
}
}
200 - Successful response
[
{
"id": "msg-12345-67890-abcde-fghij-klmno",
"destination": "PHONE_NUMBER"
}
]
400 - Bad Request
{
"message": ["Template does not exist"],
"status": "failed",
"_metadata": {
"error": {},
"body": {
"destinations": [{"destination": "PHONE_NUMBER"}],
"parameters": ["John", "example_value"],
"elementName": "sample_template",
"code": "en",
"type": "text",
"botId": "BOT_ID",
"botName": "Your Bot"
}
},
"error": {}
}
401 - Unauthorized
{
"message": "Authentication failed"
}
404 - Not Found
{
"message": ["The Bot could not be found at the moment."],
"statusMessage": "failed",
"status": 0,
"error": {
"code": "E1019",
"key": "BOT_NOT_FOUND",
"description": "Error to be thrown when trying to get a Bot.",
"developerMessages": {
"es": "El botId no se encuentra en la base de datos o ha sido eliminado.",
"en": "The botId is not found in the database or has been deleted."
},
"clientMessages": {
"es": "El Bot no se pudo encontrar por el momento.",
"en": "The Bot could not be found at the moment."
}
}
}
422 - Unprocessable Entity
{
"message": ["The values entered are not correct."],
"statusMessage": "failed",
"status": 0,
"error": {
"code": "E0422",
"key": "VALIDATOR_ERROR",
"description": "Error to be thrown when cannot process request because of incoming values",
"developerMessages": {
"es": "Los valores del request no son correctos para ser procesados.",
"en": "The request values are not correct for processing."
},
"clientMessages": {
"es": "Los valores ingresados no son correctos.",
"en": "The values entered are not correct."
}
},
"validationError": {
"parameters": [
{
"en": "The number of parameters is incorrect.",
"es": "El número de parámetros es incorrecto."
}
]
}
}
500 - Internal Server Error
{
"message": ["We are having trouble processing your request. Please try again later."],
"statusMessage": "failed",
"status": 0,
"error": {
"code": "E0000",
"key": "UNKNOWN_ERROR",
"description": "Error to be thrown when it couldn't be determined the reason of failure",
"developerMessages": {
"es": "Error inesperado occurido, revisar logs.",
"en": "Unexpected error occurred, check logs."
},
"clientMessages": {
"es": "Estamos teniendo problemas procesando la solicitud. Por favor intenta mas tarde.",
"en": "We are having trouble processing your request. Please try again later."
}
}
}
How many characters are allowed?
.pdf.mp4.jpg, .jpeg, .pngHow is the API consumed?
curl --request POST \
--url 'https://api.jelou.ai/v2/whatsapp/BOT_ID/hsm' \
--header 'Accept-Language: en' \
--header 'Authorization: Basic {{Base64EncodedUsername:Password}}' \
--header 'Content-Type: application/json' \
--data '{
"destinations": ["PHONE_NUMBER"],
"parameters": [],
"elementName": "your_template_name"
}'
Basic authentication using Base64 encoded clientId:clientSecret
The unique identifier of the bot
Approved template name
Phone numbers with country code, no + sign
Public URL for media (required for image/video/document templates)
Filename for document templates
text, hsm, image, document, video, catalog, carousel en, es, pt Template parameter values
1Show child attributes
Show child attributes
Show child attributes
Expiration timestamp in milliseconds
Was this page helpful?