Error 131053: media upload failure on WhatsApp

Error 131053 appears when Meta cannot process the media. See the most common cause, a MIME that differs from the file, and the formats and limits table.

Media is the part of the API where the error misleads the most. The image opens normally on your computer, the upload seems to have worked, and the message fails with 131053. The root cause, in most cases, is a difference between what your send declares and what the file really is. This article shows how to check that and which formats Meta accepts.

What 131053 means

Short answer: 131053 means Meta could not process the media used in the message. The error codes table says to check error.error_data.details in the messages webhook and confirm the file type is supported.

The practical point is the details field: it usually carries the specific reason, and that is where the difference between "unsupported type", "size above the limit" and "declared type differs from the content" appears. So when handling this error, log the whole error object, not just the code.

The most common cause: MIME differs from the file

Short answer: Meta's media page explains that 131053 indicates the declared MIME type does not match the file. The usual cause is the file extension not reflecting the real type.

That happens when someone renames photo.heic to photo.jpg, when a system saves everything as .png or when an upload is made with a generic Content-Type. The file looks like an image, but its content does not match what was declared. Meta's suggested fix is to confirm the file's real type and correct the extension and the type value in the upload so they match. On UNIX systems, the command below shows the detected type.

$ file -I photo.jpg photo.jpg: image/heic; charset=binary # The file is named .jpg but it is HEIC. Declaring image/jpeg produces 131053. # Convert to a real JPEG before sending.

Meta documents that the upload request carries the MIME type with the file, for example -F "file=@file.mp4;type=video/mp4". If the form type and the content disagree, the error appears.

Accepted formats and limits

Short answer: the table below gathers the types Meta documents, with each maximum size. Outside it, the file is refused.

CategoryFormats and MIMELimit
ImageJPEG (image/jpeg), PNG (image/png), 8-bit RGB or RGBA5 MB
VideoMP4 (video/mp4), 3GPP (video/3gpp), with H.264 and AAC16 MB
AudioAAC, AMR, MP3, M4A, OGG with OPUS codec and mono16 MB
DocumentPDF, Word, Excel, PowerPoint and plain text100 MB
Static stickerWebP (image/webp)100 KB
Animated stickerWebP (image/webp)500 KB

Some details tend to go unnoticed. WebP is valid only for stickers. A video needs H.264 and AAC, with at most one audio stream. Android devices may not play H.264 High profile with B-frames, so Meta recommends Baseline or Main profile without B-frames and the moov atom before mdat, which you get with ffmpeg's -movflags faststart option. And OGG audio is valid only with the OPUS codec and mono input.

Short answer: sending by ID is the more robust path, because Meta already validated the file at upload. Sending by link lets Meta fetch the file from your server at send time.

# 1) Upload through the Hub: returns a media_id curl -X POST https://crprohub.com/api/v1/channels/CHANNEL_UUID/media \ -H "Authorization: Bearer hub_pk_EXAMPLE_NOT_REAL" \ -F "file=@photo.jpg" # { "data": { "media_id": "1234567890123456", "mime_type": "image/jpeg", "size": 82190 } } # 2) Send using the ID curl -X POST https://crprohub.com/api/v1/channels/CHANNEL_UUID/messages \ -H "Authorization: Bearer hub_pk_EXAMPLE_NOT_REAL" \ -H "Idempotency-Key: 7c1f0b2e-9a44-4f61-b0d3-8e5c2a1d4f90" \ -H "Content-Type: application/json" \ -d '{"to":"5521999999999","type":"image","image":{"id":"1234567890123456"}}'

The upload is where the type error usually shows up first: the Hub returns the mime_type it identified. If it is not what you expected, stop there. The quickstart covers the send call used in step 2.

Media ID validity

Short answer: the ID returned by an upload expires in 30 days; the ID of media received on a webhook expires in 7 days. Keeping an ID forever is a source of late failure.

According to Meta, uploaded files are kept encrypted for 30 days unless deleted earlier. The temporary URL to download a media item is valid for 5 minutes, and downloading requires the access token in the header. In the Hub, whoever tries to download media that Meta already deleted gets MEDIA_EXPIRED. If your system reuses the same ID for a catalog image for months, renew the upload periodically instead of storing the ID indefinitely.

Hub errors before reaching Meta

Short answer: the Hub validates media before forwarding. A missing file, an unsupported type or an oversized file come back as Hub errors, and only what passes that check can reach 131053.

  • INVALID_MEDIA: the file is missing, has an unsupported type or exceeds the maximum size for the type.
  • MEDIA_TOO_LARGE: the file passes the limit Meta accepts for that type. Compress or shrink it before resending.
  • MEDIA_EXPIRED: the media existed on the channel, but Meta already deleted the file, which happens after 30 days.

If a file passes the Hub and still fails with 131053, the most likely problem is the MIME or the codec. The webhooks page shows where the asynchronous status carrying the details arrives.

Diagnostic routine

Short answer: read the details, confirm the real type, check the codec and the size, and only then redo the upload. In that order, the cause shows up without trial and error.

  • Read error.error_data.details on the status event and store the whole object.
  • Run file -I on the file and compare with the type used in the upload.
  • For video, check H.264, AAC and a single audio stream; for OGG audio, check OPUS and mono.
  • Check the size against the table, and convert or compress if needed.
  • Redo the upload, use the new ID and send with a new Idempotency-Key.

Media in a template header

Short answer: in a template with an image, video or document header there are two different media items: the sample used at creation for approval, and the one you send with each message.

Meta's components page explains that, at creation, the header media is uploaded through the Resumable Upload API and referenced by header_handle. At send time, the header carries a media parameter with the ID you got from the regular upload, as in { "type": "image", "image": { "id": "1234567890123456" } }. Both uploads go through validation, and the send-time 131053 comes from the second. So the image approved in the template does not guarantee that the image of each message is in the right format.

When the problem is downloading, not sending

Short answer: the media error you get from a contact is a different subject, and Meta describes its own path: get the URL by ID and download with the token.

The temporary URL is valid for 5 minutes, and the download request requires the access token in the header; without it the call fails. If the response is 404, the URL probably went stale: ask for a new one by ID and try again. If it keeps failing, Meta says to renew the token. Through the Hub, the download goes through GET /api/v1/channels/{id}/media/{mediaId}, and an ID received on a webhook is valid for 7 days, so download and store the file as soon as it arrives.

Resending the same file with the same type fails the same way. Swap the file or fix the declaration before trying again.

Frequently asked questions

What is the size limit of an image?

Five megabytes, as JPEG or PNG in 8-bit RGB or RGBA. Video and audio go up to 16 MB, documents up to 100 MB, static stickers up to 100 KB and animated ones up to 500 KB.

Why does 131053 appear if the image opens on my computer?

Because the type declared at upload may not match the file's real content, for example a HEIC with a .jpg extension. Confirm with file -I and fix the extension and type.

Is a media ID valid forever?

No. An upload ID expires in 30 days and the ID of media received on a webhook in 7 days. Renew the upload when you need to reuse the file.

Does WebP work for a regular image?

No. According to Meta, WebP is valid only in sticker messages.

Fontes

Documentação oficial da Meta, conferida em 31 de outubro de 2026.