LINE error 400: must upload richmenu image before applying it to user
Last verified against LINE Developers - Messaging API reference (error responses)
must upload richmenu image before applying it to userWhat error 400 means
You tried to put a rich menu in front of users before it had an image. The set default rich menu endpoint (POST /v2/bot/user/all/richmenu/{richMenuId}) documents the 400 as "There is no image set to the rich menu," with this exact message, and the link rich menu to user endpoints list the same condition as a 400 reason.
Creating a rich menu is a two-step process and both steps are separate API calls on different domains: POST https://api.line.me/v2/bot/richmenu returns a richMenuId, then POST https://api-data.line.me/v2/bot/richmenu/{richMenuId}/content attaches the image. Only after the second call succeeds is the menu usable. A script that creates and links in quick succession, without checking that the upload succeeded, reaches this error whenever the upload fails or is skipped.
The error is a guard, not a bug: LINE won't show users a menu without artwork. Find out why the image isn't there - most often a failed upload that the script ignored, such as The image size is not allowed for richmenu or a 415 from a wrong Content-Type.
What it looks like
// If there is no image set to the rich menu (400 Bad Request)
{
"message": "must upload richmenu image before applying it to user",
"details": []
}Why it happens
- The upload step failed (image requirements, Content-Type, wrong domain) and the script went on to set or link the menu anyway.
- The upload step was never called for this rich menu ID.
- The richMenuId used for linking differs from the one the image was uploaded to.
- Rich menu creation and linking are split across services and run out of order.
How to fix LINE error 400
- 1Check the upload response for this richMenuId; only a 200 means the image is attached.
- 2Upload the image to https://api-data.line.me/v2/bot/richmenu/{richMenuId}/content with Content-Type image/jpeg or image/png.
- 3Confirm with GET https://api-data.line.me/v2/bot/richmenu/{richMenuId}/content that the image downloads.
- 4Then set the default rich menu or link it to users again.
How to stop it recurring
Wrap rich menu publishing in one function that creates, uploads, verifies, and only then sets or links, stopping at the first non-200 response. Log the richMenuId at every step so mismatches are obvious. Validating the image locally before upload removes the most common reason the upload fails in the first place.
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?
You tried to put a rich menu in front of users before it had an image. The set default rich menu endpoint ( POST /v2/bot/user/all/richmenu/{richMenuId} ) documents the 400 as "There is no image set to the rich menu," with this exact message, and the link rich menu to user endpoints list the same condition as a 400 reason.
How do I fix LINE error 400?
1. Check the upload response for this richMenuId; only a 200 means the image is attached. 2. Upload the image to https://api-data.line.me/v2/bot/richmenu/{richMenuId}/content with Content-Type image/jpeg or image/png. 3. Confirm with GET https://api-data.line.me/v2/bot/richmenu/{richMenuId}/content that the image downloads. 4. Then set the default rich menu or link it to users again.
Stop debugging LINE by hand
Connect the channel through Conferbot: tokens, webhooks and retries are handled, failures show as readable status.