LINE Messaging API · error code

LINE error 400: The image size is not allowed for richmenu

Permanent - do not retryHTTP 400Rich menu errors

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

What LINE returns
The image size is not allowed for richmenu

What error 400 means

Uploading a rich menu image (POST https://api-data.line.me/v2/bot/richmenu/{richMenuId}/content) failed because the image doesn't meet LINE's requirements. The error table says "The image doesn't meet the requirements," and despite the message mentioning size, the requirements cover more than dimensions:

Image format JPEG or PNG; image width 800 to 2500 pixels; image height 250 pixels or more; aspect ratio (width / height) 1.45 or more; maximum file size 1 MB. Any one of these failing produces the same message. A phone screenshot fails the aspect ratio, a high-quality PNG export often fails the 1 MB cap, and a 3000-pixel design file fails the width limit.

One more rule interacts with this. The image should match the size you declared in the rich menu object, because the tap areas (bounds) are laid out in that coordinate space. Separately, if the Content-Type header isn't image/jpeg or image/png, you get a 415 rather than this 400 (see 415 Unsupported Media Type).

What it looks like

// If you specify an image that doesn't meet the requirements (400 Bad Request)
{
  "message": "The image size is not allowed for richmenu"
}

Why it happens

  • The image is wider than 2500 or narrower than 800 pixels.
  • The image is shorter than 250 pixels or the width/height ratio is below 1.45 (for example a portrait or square image).
  • The file is larger than 1 MB, common with uncompressed PNG exports.
  • The file isn't actually JPEG or PNG even though the extension says so.

How to fix LINE error 400

  1. 1Check the file with an image tool: dimensions, ratio, format, and byte size against the documented limits.
  2. 2Export at a size inside the limits - the reference's own examples use 2500x1686 and 2500x843 - and compress to under 1 MB.
  3. 3Make sure the rich menu object's size matches the image dimensions so the tap areas line up.
  4. 4Upload again to the same rich menu ID; a failed upload doesn't attach an image.

How to stop it recurring

Validate the image in your build or admin tool before calling the API: format, width 800-2500, height at least 250, ratio at least 1.45, and file size under 1 MB. Store a known-good template at the exact rich menu size your designers use. The full set of rich menu numbers is collected in rich menu limits.

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

Related codes

Error 400 - quick answers

What does LINE error 400 mean?

Uploading a rich menu image ( POST https://api-data.line.me/v2/bot/richmenu/{richMenuId}/content ) failed because the image doesn't meet LINE's requirements.

How do I fix LINE error 400?

1. Check the file with an image tool: dimensions, ratio, format, and byte size against the documented limits. 2. Export at a size inside the limits - the reference's own examples use 2500x1686 and 2500x843 - and compress to under 1 MB. 3. Make sure the rich menu object's size matches the image dimensions so the tap areas line up. 4. Upload again to the same rich menu ID; a failed upload doesn't attach an image.

Should I retry after error 400?

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.