#2584-Webhook: Dynamic Media URL Variable Mapping
ZarkChat
Summary
When using Webhook Workflows with WhatsApp template messages that include a document or media header component, the current UI only offers a manual file upload option ("CARREGAR MÍDIA"). There is no variable selector/dropdown to dynamically map a document URL from the webhook payload — unlike phone number, name, and other body variables which already have dropdown selectors.
Current Behavior
In Webhook Workflow → Webhook Response Mapping, the media/document header section provides only a static file upload. If my webhook payload contains a field like document_url with a unique PDF link per recipient, there is no way to map it to the template's document header.
Example payload structure:
json
{
"recipient_name": "John Doe",
"phone": "5531999999999",
"amount": 330.93,
"due_date": "2026-04-10",
"document_url": "@example.com.../unique-file.pdf"
}
The document_url field cannot be mapped to the template header — only a single static file can be uploaded, which is the same for every recipient.
Expected Behavior
- Add a toggle or selector in the media/document header section: "Manual Upload" vs. "Webhook Variable"
- When "Webhook Variable" is selected, show a dropdown (identical to existing body variable dropdowns) to pick the payload field containing the document/media URL
- Include a Formatter field next to it, consistent with other variable mappings
Why This Matters
Any use case that requires sending personalized documents at scale via webhook — invoices, receipts, contracts, reports, tickets — is currently blocked. The only workaround is calling the WhatsApp Cloud API directly via HTTP, manually building the template payload with document URLs. This bypasses BotSailor's workflow entirely, losing message tracking and template management benefits.
The WhatsApp Cloud API already supports this natively:
json
"components": [{
"type": "header",
"parameters": [{
"type": "document",
"document": {
"link": "@example.com.../document.pdf",
"filename": "document.pdf"
}
}]
}]
The backend capability exists — only the frontend mapping interface is missing.
Priority: HIGH — This blocks all document-based template automation via webhook workflows.
Happy to provide payload samples, screenshots, or a screen recording if helpful. Thanks for considering!
Thanks for your detailed suggestions. We are taking in our considerations. We will implement it as soon as possible.
Thanks