Upload an image, video, or document to Meta and receive a temporary media handle for a WhatsApp template header.
Use this endpoint only when you are creating a WhatsApp template with a media HEADER:
media_type=imagemedia_type=videomedia_type=documentDo not use this endpoint for normal message attachments or campaign media uploads. If you want to send a WhatsApp campaign without managing template media handles, use the list/campaign workflow instead: create or import contacts into a list, attach the list to a WhatsApp campaign, upload or select the campaign media there, and send through the campaign.
How to use the returned handle:
POST /api/v1/whatsapp/templates/upload-media with multipart form data: waba_id, media_type, and file.data.handle from the response.POST /api/v1/whatsapp/templates and place that handle at components[i].example.header_handle[0] on the media HEADER component.Example media HEADER component for the template-create request: set type to HEADER, set format to IMAGE, VIDEO, or DOCUMENT, and set example.header_handle to an array containing the returned handle.
Why this endpoint exists: Meta requires media used in template headers to be uploaded first through a resumable upload session. The template-create request accepts the returned handle, not the binary file.
Handle lifetime: the handle is short-lived. Create the template within about 24 hours after upload. If the handle expires, upload the file again and use the new handle.
Validation before upload:
media_type must match the file MIME type. For example, uploading a PDF with media_type=image returns 422.Documentation Index
Fetch the complete documentation index at: https://developers.mindhunters.ai/llms.txt
Use this file to discover all available pages before exploring further.
Use a Bearer token to access these API endpoints. Example: "Bearer {your-token}"
WABA the template will be created under. Must be linked to this tenant (GET /api/v1/whatsapp/wabas to list yours).
"123456789012345"
Determines which header.format the resulting handle is valid for. image→HEADER.format=IMAGE, video→VIDEO, document→DOCUMENT.
image, video, document The actual binary file. Image: jpg/png ≤5MB. Video: mp4/3gp ≤16MB. Document: pdf/txt/doc(x)/xls(x)/ppt(x) ≤100MB.