# How to Set Up a PDF (Document) Header Correctly

### What is a PDF (Document) Header?

A PDF header lets you send a document (invoice, receipt, report, etc.) **at the top of a message**.

***

#### Steps:&#x20;

When creating a WhatsApp template and choosing the **Header** as **Media** type, follow the steps below to successfully pass the correct PDF during the API call:

1. From the **Header** drop-down, select **Media**, then choose **Document** as the media type.
2. Set the **Type** to **Dynamic**. Only **Dynamic** headers can accept documents sent via the Mercuri API.

<figure><img src="/files/3FTe9Od3ndZFlRfdxDYD" alt="" width="563"><figcaption></figcaption></figure>

3. In the **Value** field, enter a variable name (for example: `document`).&#x20;
4. In the **Sample Value** field, upload a sample `.pdf`, `.doc`, or `.docx` file. This file is used **only for preview and template approval** and will **not** be sent to users.
5. Complete and submit the WhatsApp template for approval.&#x20;
6. **Once the template is approved**, update your **Mercuri API payload** by adding the required details, such as the **template ID** . Make sure the **same variable name** used in the template is passed again in the API parameters.

> {> \
> "**parameters**": {> \
> "**document**": "<https://your-storage.com/invoice\\_123.pdf>"> \
> }> \
> }

7. When sending the message using the Mercuri API, pass the **PDF as a publicly accessible URL**, not as an auto-download link.

***

Following the steps above ensures that the **correct PDF** is picked up from the Mercuri API and displayed properly in the message header.&#x20;

This allows you to send the intended document smoothly and consistently to your users.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.mercuri.cx/features/templates/whatsapp-templates/how-to-set-up-media-headers-when-sending-messages-using-the-mercuri-api/how-to-set-up-a-pdf-document-header-correctly.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
