Skip to content
Send templates

Send templates with a media header

If your template was approved with a HEADER of type IMAGE, VIDEO, DOCUMENT, or LOCATION, you must supply the runtime media under components[].type = "header". Header text variables ({{1}} in a TEXT header) use the same shape with { type: "text" }.

Terminal window
curl -X POST \
https://api.kirimdev.com/v1/$PHONE_ID/messages \
-H "Authorization: Bearer $KIRIM_KEY" \
-H "Content-Type: application/json" \
-d '{
"messaging_product": "whatsapp",
"to": "+628123456789",
"type": "template",
"template": {
"name": "promo_weekend",
"language": "id",
"components": [
{
"type": "header",
"parameters": [
{
"type": "image",
"image": { "link": "https://cdn.example.com/promo.jpg" }
}
]
},
{
"type": "body",
"parameters": [
{ "type": "text", "text": "Andi" }
]
}
]
}
}'
{
"type": "header",
"parameters": [
{
"type": "video",
"video": { "link": "https://cdn.example.com/demo.mp4" }
}
]
}
{
"type": "header",
"parameters": [
{
"type": "document",
"document": {
"link": "https://cdn.example.com/invoice-4521.pdf",
"filename": "invoice-4521.pdf"
}
}
]
}

filename is optional but recommended — WhatsApp shows it in the chat.

{
"type": "header",
"parameters": [
{
"type": "location",
"location": {
"latitude": -6.2088,
"longitude": 106.8456,
"name": "Toko Pusat",
"address": "Jl. Sudirman 1, Jakarta"
}
}
]
}

You can also reference a Meta media id instead of a public link — useful when you’ve already uploaded the asset:

{
"type": "image",
"image": { "id": "1539128376424123" }
}

Use either link or id, not both.

FieldConstraint
Header media typeMust match what was approved (IMAGE, VIDEO, DOCUMENT, LOCATION)
image.link / video.link / document.linkPublic HTTPS URL Meta can fetch once at send time
Image formatJPG, PNG — ≤ 5 MB
Video formatMP4, 3GPP — ≤ 16 MB
Document formatPDF, DOC(X), XLS(X), PPT(X), TXT — ≤ 100 MB