Sign inGet started

File & Video Templates

File and video templates display a document or video in the header section of the message, combined with a text body, optional footer, and optional buttons. These are ideal for sending contracts, invoices, instructional videos, and other media-rich messages.

Block Structure

BlockRequiredMax per templateDescription
File headerYes1Document, video, or animated GIF displayed at the top of the message
Text bodyYes1Main message content (max 1024 characters)
Text footerNo1Text below the body (max 60 characters, no rich formatting)
ButtonsNo10 totalInteractive action or quick reply buttons
Here's how a video template with action buttons renders on WhatsApp:
Videos display with a play button overlay and file size badge. Documents (PDFs, Word, etc.) show a download button instead -- see the file example below.

File Header

The file header attaches a document or video at the top of the message. You must specify both the mediaUrl and contentType.
Codevoorbeeld
{
  "type": "file",
  "role": "header",
  "file": {
    "mediaUrl": "https://example.com/docs/invoice.pdf",
    "contentType": "application/pdf",
    "filename": "Invoice-2024.pdf"
  }
}
PropertyRequiredDescription
mediaUrlYesPublic URL of the file (must be HTTPS)
contentTypeYesMIME type of the file (see supported types below)
filenameNoDisplay name for the file
isAnimatedNoRenders the header as an animated GIF. Marketing templates only; requires video/mp4 ≤ 3.5 MB. See Animated GIF header

Supported content types

Documents (max 100 MB)
Content typeFormat
application/pdfPDF
application/vnd.ms-powerpointPowerPoint (.ppt)
application/mswordWord (.doc)
application/vnd.ms-excelExcel (.xls)
application/vnd.openxmlformats-officedocument.wordprocessingml.documentWord (.docx)
application/vnd.openxmlformats-officedocument.presentationml.presentationPowerPoint (.pptx)
application/vnd.openxmlformats-officedocument.spreadsheetml.sheetExcel (.xlsx)
Video (max 16 MB)
Content typeFormat
video/mp4MP4 video (H.264 video codec, AAC audio codec)
video/3gpp3GPP video
A video/mp4 asset can also be used as an animated GIF header by setting isAnimated: true, in which case the limit is 3.5 MB.
Audio (max 16 MB)
Content typeFormat
audio/mp4MP4 audio
audio/mpegMPEG audio (MP3)
audio/amrAMR audio
audio/oggOGG audio (must use opus codec)
audio/opusOpus audio
Images via file block (max 5 MB)
Content typeFormat
image/jpegJPEG
image/pngPNG
For images, prefer the dedicated image block type (see Image Template Blocks). The file block with image content types is supported but the image block provides a better display experience.

Video Header Example

Codevoorbeeld
{
  "type": "file",
  "role": "header",
  "file": {
    "mediaUrl": "https://example.com/videos/product-demo.mp4",
    "contentType": "video/mp4",
    "filename": "Product Demo"
  }
}

Animated GIF header

A marketing template can use an animated header that autoplays and loops in the chat, rendered as a GIF. Set isAnimated: true on a file header block. The asset is still an mp4 — WhatsApp submits it under its GIF header format, distinct from a regular video header.
Codevoorbeeld
{
  "type": "file",
  "role": "header",
  "file": {
    "mediaUrl": "https://example.com/promos/new-season.mp4",
    "contentType": "video/mp4",
    "isAnimated": true
  }
}
Constraints:
RuleValue
contentTypeMust be video/mp4. Any other type is rejected
Max size3.5 MB (smaller than the 16 MB limit for a regular video header)
CategoryMarketing templates only — rejected for utility and authentication
The header autoplays on a loop with no play button and no download/file-size badge — the tell-tale differences from the video header, which shows both:
Omit isAnimated (or set it to false) and the same video/mp4 asset renders as a standard tap-to-play video header instead, subject to the 16 MB video limit.

Using a variable for the file URL

To make the file dynamic at send time:
Codevoorbeeld
{
  "type": "file",
  "role": "header",
  "file": {
    "mediaUrl": "{{documentUrl}}",
    "contentType": "application/pdf",
    "filename": "{{documentName}}"
  }
}

Uploading media via the Media Library

If you don't already have a publicly hosted URL, use the Media Library API to upload a file and get a mediaUrl to use in the template.
Step 1 -- Create an asset:
Codevoorbeeld
POST /workspaces/{workspaceId}/media-library-assets

{
  "name": "invoice-sample.pdf"
}
Returns an asset with id and uploadStatus: "pending".
Step 2 -- Get a presigned upload URL:
Codevoorbeeld
POST /workspaces/{workspaceId}/media-library-assets/{assetId}/presigned-upload

{
  "contentType": "application/pdf"
}
Returns uploadUrl, uploadMethod, uploadFormData, and mediaUrl.
Step 3 -- Upload the file using the returned uploadUrl and uploadFormData (direct S3 upload).
Step 4 -- Complete the upload:
Codevoorbeeld
PATCH /workspaces/{workspaceId}/media-library-assets/{assetId}

{
  "mediaUrl": "https://media.api.bird.com/workspaces/{workspaceId}/media-library-assets/{assetId}/media"
}
Use the mediaUrl from step 2. The asset status changes to "complete" and the URL can now be used in template blocks.
WhatsApp media limits by type:
TypeFormatsMax size
DocumentsPDF, DOC, DOCX, PPTX, XLSX100 MB
VideoMP4 (H.264/AAC), 3GP16 MB
Animated GIFMP4 (isAnimated: true)3.5 MB
AudioAAC, AMR, MP3, M4A, OGG (opus)16 MB
ImagesJPEG, PNG5 MB
The contentType in the presigned upload request must match the file format (e.g. application/pdf, video/mp4).

Body

The body is mandatory and supports up to 1024 characters with variables.
Codevoorbeeld
{
  "type": "text",
  "role": "body",
  "text": {
    "text": "Hi {{customerName}}, please find your invoice attached for order {{orderNumber}}."
  }
}
The body is mandatory and supports up to 1024 characters with variables. For marketing templates, WhatsApp truncates the body after approximately 5 lines with a "Read more" link -- see body truncation.
Optional text footer, max 60 characters.
Codevoorbeeld
{
  "type": "text",
  "role": "footer",
  "text": {
    "text": "Contact support for questions"
  }
}

Buttons

Buttons are optional interactive elements appended after the footer. Templates support up to 10 buttons total, but there are restrictions on the number and combination of each type.

Action buttons

Action buttons trigger a specific action when tapped.
Link button
Opens a URL. Up to 2 link buttons per template. Button text max 20 characters. The URL can include a variable suffix:
Codevoorbeeld
{
  "type": "link-action",
  "linkAction": {
    "text": "View order",
    "url": "https://example.com/orders/{{orderId}}"
  }
}
Phone number button
Dials a phone number. 1 per template. Button text max 25 characters, phone number max 20 characters.
Codevoorbeeld
{
  "type": "call-phone-number-action",
  "callPhoneNumberAction": {
    "text": "Call support",
    "phoneNumber": "+14155551234"
  }
}
Copy code button
Copies a code to the clipboard. 1 per template. When used, the body must also contain the same variable.
Codevoorbeeld
{
  "type": "copy-code-action",
  "copyCodeAction": {
    "code": "{{code}}"
  }
}

Quick reply buttons

Quick reply buttons send a predefined response back when tapped. Up to 10 per template.
Codevoorbeeld
{
  "type": "reply-action",
  "replyAction": {
    "text": "Yes, confirm",
    "payload": "confirm_order"
  }
}

Button ordering rules

When combining button types, they must follow this order:
  1. copy-code-action
  2. link-action
  3. call-phone-number-action
  4. reply-action
Quick reply buttons and action buttons must be grouped separately -- they cannot be interleaved.

Button limits

Button typeMaximum per template
copy-code-action1
link-action2
call-phone-number-action1
reply-action10

Button Rendering Behavior

WhatsApp displays buttons differently depending on the total count. These rules are the same as for text templates.

3 or fewer buttons

When a template has 3 or fewer buttons, all buttons are shown directly below the message:

More than 3 buttons

When a template has more than 3 buttons, WhatsApp shows the first 2 buttons inline and collapses the rest behind a "See all options" link. Here's an example with a file (document) header:
Tapping "See all options" opens a bottom sheet with all buttons. See text template button overflow for an example of the bottom sheet.

Complete Example -- PDF Document

Codevoorbeeld
{
  "defaultLocale": "en",
  "deployments": [
    {
      "key": "whatsappTemplateName",
      "platform": "whatsapp",
      "value": "product_brochure"
    },
    {
      "key": "whatsappCategory",
      "platform": "whatsapp",
      "value": "MARKETING"
    },
    {
      "key": "whatsappAllowCategoryChange",
      "platform": "whatsapp",
      "value": "true"
    }
  ],
  "variables": [
    {
      "key": "customerName",
      "description": "Customer's name",
      "type": "string",
      "format": "none",
      "examplesLocale": {
        "en": {
          "exampleValueStrings": ["Jane Doe"]
        }
      }
    },
    {
      "key": "promoCode",
      "description": "Promotional discount code",
      "type": "string",
      "format": "none",
      "examplesLocale": {
        "en": {
          "exampleValueStrings": ["NEWSEASON20"]
        }
      }
    }
  ],
  "platformContent": [
    {
      "locale": "en",
      "type": "text",
      "platform": "whatsapp",
      "channelGroupIds": [
        "3f979241-dea3-4f55-b7bb-d769eec27e51"
      ],
      "blocks": [
        {
          "type": "file",
          "role": "header",
          "file": {
            "mediaUrl": "https://example.com/brochures/new-season.pdf",
            "contentType": "application/pdf",
            "filename": "New-Season-Collection.pdf"
          }
        },
        {
          "type": "text",
          "role": "body",
          "text": {
            "text": "Hi {{customerName}}, our new season collection is here! Download the brochure above and use code {{promoCode}} for 20% off your first order."
          }
        },
        {
          "type": "text",
          "role": "footer",
          "text": {
            "text": "Reply STOP to unsubscribe"
          }
        },
        {
          "type": "link-action",
          "linkAction": {
            "text": "Shop now",
            "url": "https://example.com/new-season"
          }
        }
      ]
    }
  ],
  "supportedPlatforms": ["whatsapp"]
}

Complete Example -- Video

Codevoorbeeld
{
  "defaultLocale": "en",
  "deployments": [
    {
      "key": "whatsappTemplateName",
      "platform": "whatsapp",
      "value": "product_tutorial"
    },
    {
      "key": "whatsappCategory",
      "platform": "whatsapp",
      "value": "MARKETING"
    },
    {
      "key": "whatsappAllowCategoryChange",
      "platform": "whatsapp",
      "value": "true"
    }
  ],
  "platformContent": [
    {
      "locale": "en",
      "type": "text",
      "platform": "whatsapp",
      "channelGroupIds": [
        "3f979241-dea3-4f55-b7bb-d769eec27e51"
      ],
      "blocks": [
        {
          "type": "file",
          "role": "header",
          "file": {
            "mediaUrl": "https://example.com/videos/tutorial.mp4",
            "contentType": "video/mp4",
            "filename": "Getting Started Tutorial"
          }
        },
        {
          "type": "text",
          "role": "body",
          "text": {
            "text": "Watch our quick tutorial to get started with your new product. It only takes 2 minutes!"
          }
        },
        {
          "type": "reply-action",
          "replyAction": {
            "text": "Helpful",
            "payload": "tutorial_helpful"
          }
        },
        {
          "type": "reply-action",
          "replyAction": {
            "text": "Need more help",
            "payload": "tutorial_need_help"
          }
        }
      ]
    }
  ],
  "supportedPlatforms": ["whatsapp"]
}

Complete Example -- Animated GIF

Codevoorbeeld
{
  "defaultLocale": "en",
  "deployments": [
    {
      "key": "whatsappTemplateName",
      "platform": "whatsapp",
      "value": "season_launch_gif"
    },
    {
      "key": "whatsappCategory",
      "platform": "whatsapp",
      "value": "MARKETING"
    },
    {
      "key": "whatsappAllowCategoryChange",
      "platform": "whatsapp",
      "value": "true"
    }
  ],
  "platformContent": [
    {
      "locale": "en",
      "type": "text",
      "platform": "whatsapp",
      "channelGroupIds": [
        "3f979241-dea3-4f55-b7bb-d769eec27e51"
      ],
      "blocks": [
        {
          "type": "file",
          "role": "header",
          "file": {
            "mediaUrl": "https://example.com/promos/new-season.mp4",
            "contentType": "video/mp4",
            "isAnimated": true
          }
        },
        {
          "type": "text",
          "role": "body",
          "text": {
            "text": "See our latest product launch above and what's new this season!"
          }
        },
        {
          "type": "text",
          "role": "footer",
          "text": {
            "text": "Tap below to learn more"
          }
        },
        {
          "type": "link-action",
          "linkAction": {
            "text": "Shop now",
            "url": "https://example.com/new-season"
          }
        }
      ]
    }
  ],
  "supportedPlatforms": ["whatsapp"]
}