LINE Messaging API · error code

LINE error 415: Unsupported Media Type

Permanent - do not retryHTTP 415400 / 409 / 413: request body, tokens and payload

Last verified against LINE Developers - Messaging API reference (error responses)

What LINE returns
<detail varies>

What error 415 means

The status codes table defines 415 as: "Media type of the uploaded file is unsupported." Unlike the JSON-endpoint error The content type, XXX, is not supported, this status belongs to upload endpoints - most prominently rich menu image upload (POST https://api-data.line.me/v2/bot/richmenu/{richMenuId}/content) - and it means the file bytes you posted aren't in an accepted format.

The accepted formats are narrow and documented per feature. Rich menu images must be JPEG or PNG, 800 to 2500 pixels wide, at least 250 pixels tall, aspect ratio (width / height) of 1.45 or more, and at most 1 MB. Message media referenced by URL has its own format matrix - JPEG/PNG for images, MP4 for video, MP3/M4A for audio - but those are fetched by LINE from your URLs and fail differently; the 415 is specifically about files you push to LINE's data endpoints.

Typical trip-ups: a WebP, GIF, or SVG exported by a design tool and renamed to .png (the extension doesn't matter, the bytes do); a Content-Type header that doesn't match the actual encoding; or an image pipeline that emits progressive/CMYK variants some validators reject. The fix is always to transcode to plain baseline JPEG or PNG and re-upload.

What it looks like

HTTP/1.1 415 Unsupported Media Type

// The uploaded file's media type is not accepted by this endpoint.
// Convert to JPEG or PNG and upload again.

Why it happens

  • The uploaded file is WebP, GIF, SVG, or HEIC - only JPEG and PNG are accepted for rich menu images.
  • The file extension says .png but the bytes are another format (renamed, not converted).
  • The Content-Type header on the upload doesn't match a supported image type.
  • An exotic encoder variant (CMYK JPEG, 16-bit PNG) that isn't accepted.

How to fix LINE error 415

  1. 1Inspect the real format with file/exiftool or by magic bytes - trust the bytes, not the extension.
  2. 2Convert to standard PNG or JPEG (sRGB, 8-bit) with your image library and re-upload.
  3. 3Set the upload Content-Type to image/png or image/jpeg to match the converted file.
  4. 4While you're at it, validate the rich menu dimension rules (800-2500px wide, >=250px tall, aspect >= 1.45, <= 1MB) so the corrected upload doesn't fail on the next rule.

How to stop it recurring

Normalize every image through a converter step (to baseline sRGB JPEG/PNG) before any LINE upload, and validate dimensions and file size against the rich menu specs in the same step. Reject unsupported inputs at your admin UI rather than at LINE's API, and cover the pipeline with a test fixture per accepted and rejected format.

Official reference: LINE Developers - Messaging API reference (error responses). See all LINE error codes or the LINE limits and quotas.

Related codes

Error 415 - quick answers

What does LINE error 415 mean?

The status codes table defines 415 as: "Media type of the uploaded file is unsupported." Unlike the JSON-endpoint error The content type, XXX, is not supported , this status belongs to upload endpoints - most prominently rich menu image upload ( POST https://api-data.line.me/v2/bot/richmenu/{richMenuId}/content ) - and it means the file bytes you posted aren't in an accepted format.

How do I fix LINE error 415?

1. Inspect the real format with file/exiftool or by magic bytes - trust the bytes, not the extension. 2. Convert to standard PNG or JPEG (sRGB, 8-bit) with your image library and re-upload. 3. Set the upload Content-Type to image/png or image/jpeg to match the converted file. 4. While you're at it, validate the rich menu dimension rules (800-2500px wide, >=250px tall, aspect >= 1.45, <= 1MB) so the corrected upload doesn't fail on the next rule.

Should I retry after error 415?

No. Retrying the same request produces the same error; the condition has to be fixed first. Treat it as a permanent failure for that message and surface it, rather than looping.

Stop debugging LINE by hand

Connect the channel through Conferbot: tokens, webhooks and retries are handled, failures show as readable status.