← Blog

·

WhatsApp template with a video or document header

Updated on November 24, 2026

A WhatsApp template with a video or document header is created with a HEADER component in VIDEO or DOCUMENT format plus a sample file, uploaded beforehand through the Resumable Upload API, which returns the header_handle used for review. Once approved, every send carries the real media in the header component, either as a link (public URL) or an id (media ID). Videos can be up to 16 MB (MP4 or 3GPP, H.264 and AAC) and documents up to 100 MB.

This guide focuses on what is specific to this kind of header: uploading the sample, the difference between header_handle and media ID, the document filename, and the most common errors.

When to use a video or document header

Meta’s template components page lists four media header formats: IMAGE, VIDEO, GIF and DOCUMENT (plus TEXT and LOCATION). The header is optional and a template can have only one. For utility templates, Meta states that all header types are supported.

FormatTypical useLikely category
DOCUMENT (PDF)The customer’s own invoice, boleto, contract, ticket or lab reportUtility
VIDEOProduct launch, demo, event invitationMarketing
VIDEOSetup tutorial for a product the customer boughtUtility, if there is no promotion
GIFShort animation in a campaignMarketing (Marketing Messages API only)

Meta decides the category based on the text, not the media. A PDF of the customer’s own bill is utility; the same template with “pay today and get 5% off” becomes marketing. The criteria are in WhatsApp template categories. Also keep in mind that collecting third-party debt is prohibited by the WhatsApp Business Messaging Policy, PDF or not. (In Brazil, a boleto is a bank payment slip, the most common document sent this way.) For Meta, a GIF is an MP4 of up to 3.5 MB; larger files show up as video.

Supported formats and sizes

Meta’s supported media table applies to the media you send in the header:

TypeExtensionsMax sizeNotes
Video.mp4, .3gp16 MBH.264 video and AAC audio codecs only, with one audio stream or none
Document.pdf, .doc, .docx, .xls, .xlsx, .ppt, .pptx, .txt100 MBOnly these types are guaranteed to display correctly
Image.jpeg, .png, static .webp5 MB8-bit RGB or RGBA, up to 4,096 pixels per side

Meta highlights two video details for Android compatibility: avoid the H.264 “High” profile with B-frames (use “Main” without B-frames, or “Baseline”) and place the moov box before mdat. With ffmpeg:

ffmpeg -i original.mov -c:v libx264 -profile:v main -bf 0 -c:a aac -movflags +faststart -fs 15M video-whatsapp.mp4

-fs 15M stops at 15 MB; for long videos, lower the resolution or bitrate instead.

Want to try it while you read? Create a Vectalk account and send your first message through the official API. Create free account →

Step 1: upload the sample with the Resumable Upload API

Review requires a sample file, and the template media page asks you to upload it through the Resumable Upload API, which returns a handle. It takes two calls.

First, open a session on your Meta app ID, with the file name, size in bytes and MIME type:

curl -X POST "https://graph.facebook.com/v27.0/$APP_ID/uploads?file_name=product-demo.mp4&file_length=8421337&file_type=video/mp4&access_token=$ACCESS_TOKEN"

The response contains the session ID:

{ "id": "upload:MTphdHRhY2htZW50OjVmYjA3..." }

Then send the bytes to the session. Authorization uses OAuth, not Bearer, and file_offset starts at 0:

curl -X POST "https://graph.facebook.com/v27.0/upload:MTphdHRhY2htZW50OjVmYjA3..." \
  -H "Authorization: OAuth $ACCESS_TOKEN" \
  -H "file_offset: 0" \
  --data-binary @product-demo.mp4

The response is the handle, in the h field:

{ "h": "4::dmlkZW8vbXA0:ARa..." }

If the connection drops, a GET on /upload:<SESSION_ID> with the same header returns the file_offset already received, and you repeat the POST from there. Meta’s guide lists application/pdf, image/jpeg, image/jpg, image/png and video/mp4 as accepted file_type values. Use a PDF as the document sample and an MP4 as the video sample.

Step 2: create the template with header_handle

With the handle, create the template at POST /<WABA_ID>/message_templates. This is a utility template with an invoice PDF:

{
  "name": "invoice_pdf",
  "language": "en_US",
  "category": "UTILITY",
  "components": [
    {
      "type": "HEADER",
      "format": "DOCUMENT",
      "example": { "header_handle": ["4::YXBwbGljYXRpb24vcGRm:ARb..."] }
    },
    {
      "type": "BODY",
      "text": "Hi {{1}}, the invoice for order {{2}} is attached to this message. Keep it for your warranty.",
      "example": { "body_text": [["Carla", "58412"]] }
    }
  ]
}

And this is a marketing template with a launch video and a URL button:

{
  "name": "launch_video",
  "language": "en_US",
  "category": "MARKETING",
  "components": [
    {
      "type": "HEADER",
      "format": "VIDEO",
      "example": { "header_handle": ["4::dmlkZW8vbXA0:ARa..."] }
    },
    {
      "type": "BODY",
      "text": "Hi {{1}}! Watch the video to see how the new {{2}} line works. It just arrived in store.",
      "example": { "body_text": [["Rafael", "Pro Coffee Makers"]] }
    },
    {
      "type": "BUTTONS",
      "buttons": [
        { "type": "URL", "text": "See the collection", "url": "https://shop.example.com/new" },
        { "type": "QUICK_REPLY", "text": "Stop promotions" }
      ]
    }
  ]
}

Three things to remember:

  • A handle is not a media ID. The id returned by POST /<PHONE_NUMBER_ID>/media is for sending messages; the h from the Resumable Upload API is for template review. One does not replace the other.
  • The sample is only for the reviewer. Customers never receive it. Use something representative, with no real customer data.
  • The format is fixed. A template approved with VIDEO only accepts video when sending. To switch to a document, create another template.

See also creating templates via API and positional vs. named variables.

Step 3: send it with the real media

The send request carries the header component with a parameter of the same type as the template. For an invoice PDF generated on the fly by your server, link plus filename is usually the simplest path:

{
  "messaging_product": "whatsapp",
  "to": "15551234567",
  "type": "template",
  "template": {
    "name": "invoice_pdf",
    "language": { "code": "en_US" },
    "components": [
      {
        "type": "header",
        "parameters": [
          {
            "type": "document",
            "document": {
              "link": "https://files.shop.example.com/invoices/58412.pdf",
              "filename": "invoice-58412.pdf"
            }
          }
        ]
      },
      {
        "type": "body",
        "parameters": [
          { "type": "text", "text": "Carla" },
          { "type": "text", "text": "58412" }
        ]
      }
    ]
  }
}

filename is optional, but according to the document messages documentation the app uses its extension to pick the file icon. Use a name the customer will recognize later.

For a campaign video that goes out unchanged to everyone, upload it once and use the id:

{
  "type": "header",
  "parameters": [
    { "type": "video", "video": { "id": "1166846181421424" } }
  ]
}

Meta recommends id to reduce errors and requests to your server. A media ID is valid for 30 days after upload. How to reuse uploads is covered in WhatsApp media ID expiration, and the POST /media walkthrough in how to send images, PDFs, audio and video. The full link vs. id comparison, with every other send component, is in how to send a template message via the API.

Best practices

  • Documents for what customers need to keep. Invoices, bills, tickets and receipts work well as a PDF header in a utility template, because they stay in the chat. For a bill, repeat the amount or payment code in the body so the notification alone makes sense.
  • Short, light video. Above 16 MB the send fails. Compress first and make the body self-explanatory: not everyone taps play.
  • One URL per file. With link, the Cloud API caches the media for 10 minutes, according to the send messages documentation. If each customer’s PDF is always served from the same URL, use unique URLs (with the order ID in the path) or append a random query string.
  • Public, stable URL. Signed links that expire quickly or pages behind a login make the send fail. Test the URL in a private window.
  • Handle sensitive data with care. The document stays on the customer’s phone; reports and contracts should go only to the data subject, in line with privacy laws such as Brazil’s LGPD (Law 13,709/2018). This is not legal advice.
  • Marketing needs an exit. For promotional videos, include an opt-out button such as “Stop promotions”.

Common errors

Symptom or codeLikely causeFix
Error when creating the media templateheader_handle filled with something other than the h handle from the Resumable Upload API, the format Meta documentsGenerate the handle with the Resumable Upload API
132000Send without the header component on a media header template, or with too few or too many parametersAlways include the header with the media
132012Parameter type differs from the template, e.g. image on a VIDEO templateUse the same type as at creation
131053Media upload or download failed: MIME type does not match the file, unreachable URL, unsupported codecCheck the file with file -I, the URL and the codec
Video won’t play on some Android phonesH.264 “High” profile with B-frames, or moov at the endRe-encode with the ffmpeg command above
PDF arrives with an odd nameSent without filenameSet filename with the extension
Outdated or wrong PDFSame URL reused within the 10-minute cacheOne unique URL per file

Media troubleshooting has its own article on error 131053, and parameter errors are covered in errors 132000 and 132012.

Cost

Pricing is per delivered message, based on the template category and the recipient’s country. For recipients in Brazil, since October 1, 2026: BRL 0.3217 per marketing template and BRL 0.0350 per utility template, including inside the customer service window. Estimate your volume with the pricing calculator.

How to do it with Vectalk

Vectalk is a proxy for the official WhatsApp Business API, so payloads are Meta’s. You create the template in the dashboard, in the templates area with the Template Library, or through the Create Template endpoint with an instance token (the account is resolved from the token). For the media you send, the Media Upload endpoint (POST https://apis.vectalk.com.br/api/media, multipart with file, type and messaging_product) returns the id for the header, and the send goes to POST https://apis.vectalk.com.br/api/messages, as in the send template reference.

Each delivered message is deducted from your prepaid balance, using Vectalk’s credit line on your number, with no card registered at Meta. There is no native bulk sending in the dashboard: campaigns run in your own system or in a tool connected to the API. Create your account to try it.

Frequently asked questions

Can I change the video or PDF on every send?

Yes. The header_handle file is only for review. On each send you can pass any media you want, as long as it is the approved type (video for a video template, document for a document template).

Does a document template accept spreadsheets or Word files?

When sending, yes: Meta lists .doc, .docx, .xls, .xlsx, .ppt, .pptx, .txt and .pdf as supported documents. For the approval sample, the Resumable Upload API guide lists PDF among the accepted types, so use a PDF.

Can a video header template be utility?

Yes, if the content is utility, such as a tutorial for a product the customer bought. Launch or offer videos are marketing, and Meta may change the category if the text is promotional. For deadline-driven offers, see the limited-time offer template.


Official sources checked on November 24, 2026: Template components (Meta), Template media (Meta), Utility templates (Meta), Media / supported media types (Meta), Document messages (Meta), Send messages (Meta), Resumable Upload API (Meta), Vectalk: Create Template, Vectalk: Media Upload, Vectalk: Template.

Put your business on the official WhatsApp

Create your account, connect your number to the official API (you can keep the app with coexistence) and start serving customers and sending messages.