Link / unlink a LINE rich menu to user(s)
line_link_rich_menuAssign specific rich menus to individual LINE users or remove per-user menus to revert to the account default.
Instructions
Attach (mode='link') or detach (mode='unlink') a rich menu for specific LINE users. A per-user menu overrides the account-wide default — this is how you show different menus to different segments (e.g. paying vs. free). Unlinking falls the user back to the account default. Pass user_id (single) or user_ids[] (bulk, auto-chunked at 500/batch). rich_menu_id required for link. To set the account-wide default instead, use line_set_default_rich_menu.
Returns { mode, linked_count?/unlinked_count?, rich_menu_id?, chunks? }.
Example: "ผูก rich menu R123 ให้สมาชิก 800 คน" → { mode:"link", rich_menu_id:"R123", user_ids:[...800 ids] }.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| oa | No | Optional OA id; defaults to active OA. | |
| mode | Yes | link: attach a rich menu to user(s); unlink: detach the per-user menu (falls back to default). | |
| user_id | No | Single LINE user ID. Provide this OR user_ids (not both needed). | |
| user_ids | No | List of LINE user IDs. Uses the bulk endpoint, auto-chunked into batches of 500. | |
| rich_menu_id | No | Rich menu ID. Required for mode='link'; ignored for unlink. |