Skip to navigation

WhatsApp Media Template

Send a pre-approved WhatsApp Message Template with an image header and body variables.

Authentication

All requests require an apiKey header containing your Conversive API key.

apiKey: <YOUR_API_KEY>

Pass the API key as a request header named apiKey, not as a Bearer token in the Authorization header.

Request

POST
/api/v2/message/send
curl -X POST https://api.beconversive.com/api/v2/message/send \
-H "apiKey: <apiKey>" \
-H "Content-Type: application/json" \
-d '{
"userPayload": {
"type": "api",
"apiKey": "YOUR_API_KEY"
},
"messageDetails": [
{
"recipient": [
{
"channelType": "whatsapp",
"phone": "RECIPIENT_PHONE"
}
],
"sender": {
"channelType": "whatsapp",
"phone": "SENDER_PHONE"
},
"source": "1",
"messageId": "UNIQUE_MESSAGE_ID",
"message": {
"type": "custom",
"content": {
"custom": {
"template": {
"components": [
{
"parameters": [
{
"type": "image",
"value": {
"link": "https://example.com/path/to/image.png"
}
}
],
"type": "header"
},
{
"parameters": [
{
"type": "text",
"value": "VARIABLE_1"
},
{
"type": "text",
"value": "VARIABLE_2"
}
],
"type": "body"
}
],
"language": {
"code": "en",
"policy": "deterministic"
},
"name": "whatsapp_media_template_name"
},
"type": "template"
},
"messageText": "Sample media template message",
"type": "custom"
}
}
}
]
}'

Request

userPayloadobjectRequired
messageDetailslist of objectsRequired

Response

Response

responseobjectOptional

Errors

Status CodeMeaning
400Bad Request — missing or invalid parameters
401Unauthorized — invalid or missing API key
403Forbidden — insufficient permissions
404Not Found — endpoint or resource not found
429Too Many Requests — rate limit exceeded
500Internal Server Error — contact support