What is a template header?
The template header is the optional first component of a WhatsApp message template, shown above the body. A template can have one header, in one of six formats: TEXT, IMAGE, VIDEO, DOCUMENT, LOCATION or GIF. The format is fixed in the template definition; what fills it — the words, the file or the map pin — can change on every send.
A text header holds up to 60 characters and one variable, for example “Order {{1}} has shipped”, and should not contain Markdown formatting characters. Media headers turn the message into a richer card: an image (JPEG or PNG up to 5 MB), a video (MP4 or 3GPP up to 16 MB) or a document such as a PDF invoice (up to 100 MB). GIF headers are MP4 files up to 3.5 MB and are available only on the Marketing Messages API, and location headers are allowed only in utility and marketing templates.
Media headers are handled twice. At creation you upload a sample file through the Resumable Upload API and pass the returned handle in example.header_handle, so reviewers can see what the header will look like. At send time you supply the real media for that customer in a header component — a public link or an uploaded media id — or, for a location header, latitude, longitude, name and address.
The header is not where the message lives. The body is required, holds up to 1,024 characters and many variables, and carries the substance; the header is a 60-character headline or a visual that frames it. A header that merely repeats the body wastes the most visible line in the bubble.
Key takeaways
- A template header is the optional top component of a WhatsApp template: TEXT, IMAGE, VIDEO, DOCUMENT, LOCATION or GIF.
- A text header holds up to 60 characters and one variable, and a template can have only one header.
- Media headers need a sample uploaded through the Resumable Upload API at creation, and the real media on every send.
- Header media limits: image 5 MB, video 16 MB, document 100 MB; GIFs are MP4s up to 3.5 MB, on the Marketing Messages API only.
- Location headers work only in utility and marketing templates, and changing a header's format means an edit and a new review.
How does a template header work?
- Step 1
Choose the format
Text for a short headline; image or video for visual offers; document for invoices, tickets and statements; location for store or pickup directions (utility and marketing only).
- Step 2
Provide the sample
For text, write the line and give an example value for its variable in
example.header_text. For media, upload a representative file with the Resumable Upload API and pass the handle inexample.header_handle. - Step 3
Submit it with the template
The header is the first item in
components, e.g.{ "type": "HEADER", "format": "DOCUMENT", … }. Reviewers judge it together with the body, so the sample should match what customers will really get. - Step 4
Fill it on every send
Add a
headercomponent to the send request with one parameter of the matching type:text,image,video,document(with an optionalfilename) orlocation. - Step 5
Stay inside the media limits
Image 5 MB, video 16 MB, document 100 MB. Use fast, publicly reachable HTTPS links, or upload once and reuse the media ID — uploaded media IDs stay valid for 30 days.
A template header: key facts and limits
- Formats
- TEXT, IMAGE, VIDEO, DOCUMENT, LOCATION, GIF
- Per template
- At most one header
- Text header
- 60 characters, 1 variable
- Image
- JPEG or PNG, up to 5 MB
- Video
- MP4 or 3GPP, up to 16 MB
- Document
- PDF and Office formats, up to 100 MB
- GIF
- MP4 up to 3.5 MB, Marketing Messages API only
- Location
- Utility and marketing templates only
A template header in code
{"name": "monthly_statement","language": "en_IN","category": "UTILITY","components": [{"type": "HEADER","format": "DOCUMENT","example": { "header_handle": ["{SAMPLE_FILE_HANDLE}"] }},{"type": "BODY","text": "Hi {{1}}, your statement for {{2}} is attached. Amount due: {{3}} by {{4}}. Pay in the app to avoid a late fee.","example": { "body_text": [["Asha", "October 2026", "INR 1,240.00", "5 November"]] }}]}
{SAMPLE_FILE_HANDLE} is the handle the Resumable Upload API returns for the sample PDF — not a media ID.
Common mix-ups
Common mistakes with a template header
Uploading the sample the wrong way
Template samples need a handle from the Resumable Upload API in
header_handle. A media ID from the messages media endpoint is for sending, not for creating templates.Sending without the header parameter
A template approved with a media header needs that media on every send. Leaving out the
headercomponent, or sending a different media type, makes the send fail.Overloading the text header
Sixty characters includes the variable's value. A long product or customer name in
{{1}}can push it over, so keep the fixed text short.Slow or private media links
WhatsApp fetches
linkmedia itself. Links behind a login, signed URLs that expire too soon or slow servers cause failed deliveries; for bulk sends, upload once and reuse the media ID.Assuming GIF headers work everywhere
GIF headers are available only on the Marketing Messages API. On other routes, use a short video header instead.
Example: A statement PDF and an outage headline
A Pune electricity-bill payments app sends a monthly utility template with a DOCUMENT header. At creation the team uploads a sample statement through the Resumable Upload API and submits its handle. Each month the send request attaches the customer's own statement by link with a filename such as “Statement-Oct-2026.pdf”, so it arrives as a tappable document above a body that states the amount and due date. A second template for outage alerts uses a TEXT header instead — “Power cut in {{1}} today” — because a one-line headline is faster to scan than an attachment when the lights have just gone out.
Template Header FAQs
Can a template have both a text header and an image?+
Does the header image have to be the same for every customer?+
Can a text header have more than one variable?+
Why does my template need a sample file?+
Rules of thumb
Best practices for a template header
- Use a document header for anything the customer may want to keep: invoices, tickets, policy documents.
- Always pass a
filenamewith document headers so the file saves with a meaningful name. - Make the review sample representative — a blank placeholder image invites questions at review.
- Reuse one uploaded media ID across a broadcast instead of making WhatsApp fetch the same link thousands of times.
Why the difference matters
Why does a template header matter?
The header decides what a customer sees first in a busy chat list. An invoice PDF that opens in one tap, a product photo on an offer, or a short “Payment due tomorrow” line all change whether a message gets read and acted on. Getting the format right at creation matters, because it cannot be swapped at send time: a template approved with an image header needs an image on every send, and changing the format means editing the template and going back through review.