Build LINE Rich Menu (single panel)
line_build_rich_menuCreate a LINE Rich Menu with a single call: validate, create, upload image, and set as default. Combines multiple API steps into one action.
Instructions
Create a LINE Rich Menu in one call: validate → create → upload image → set as default. Collapses what is normally 4 LINE API calls into one tool, including the api-data.line.me domain switch for image upload (the #1 cause of failed implementations).
This V1 supports single-panel rich menus. The "tab-pair" (Tab A ↔ Tab B switching design) shipped widely by Thai agencies will be added in V1.1 alongside richmenu alias support.
Args:
name: Internal admin name (≤300 chars).
chat_bar_text: Label on the chat-bar button (≤14 chars). Show in user's LINE UI.
size: 'compact' (2500x843) or 'large' (2500x1686, default).
image_url: Public HTTPS URL of the rich menu image. JPEG/PNG, aspect ≥1.45, ≤1MB.
areas: Tappable regions with action objects (postback / message / uri / richmenuswitch).
set_as_default: Set as account-wide default after creation. Default true.
selected: Whether the menu auto-opens. Default true.
oa: Optional OA id.
Returns: { rich_menu_id: string, name: string, set_as_default: boolean, warnings: string[] }
Image requirements (validated client-side before upload):
Width: 800-2500px
Aspect ratio: ≥1.45
File size: ≤1MB
Format: JPEG or PNG
Examples:
"Rich Menu โปรวันแม่ 2 ปุ่ม" → params with 2 areas, large size, set_as_default: true
Errors:
INVALID_AREA → Coordinates exceed image bounds
IMAGE_TOO_LARGE → ≥1MB; resize and retry
QUOTA_EXCEEDED → 1,000 rich menus max per OA
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Internal name (admin-only). | |
| chat_bar_text | Yes | The button label shown in chat bar. | |
| size | No | compact (2500x843) for a single row, large (2500x1686) for a full panel. Default 'large'. | large |
| image_url | Yes | Public HTTPS URL of the rich menu image. Must be JPEG or PNG, aspect ratio ≥ 1.45, ≤1MB. | |
| areas | Yes | Tappable areas. Coordinates are in image pixels. | |
| set_as_default | No | Set this rich menu as the account-wide default. Default true. | |
| selected | No | Whether the rich menu opens by default when chat is opened. | |
| oa | No |