Using rich menus

The rich menu is a customizable menu that is displayed in the chat screen to help users interact with your bot. You can customize the menu items to correspond to various actions.

Rich menu

The rich menu is made up of a rich menu image and a chat bar.

  1. Rich menu image: Image map made up of one or more tappable areas which correspond to certain actions such as returning a postback event or opening a URL.
  2. Chat bar: Bar used to open and close the rich menu. You can customize the text of this bar.

Two ways of creating rich menus

You can create rich menus for your bot with the Messaging API or the LINE@ Manager (content management tool for LINE@ accounts). Both methods can be used at the same time.

Rich menus that are linked to a specific user via the Messaging API will override the rich menu set in the LINE@ Manager.

Messaging API

Note: Rich menus created using the Messaging API are only supported on LINE Android and iOS versions 7.14.0 and above.

By using the Messaging API, you can display different rich menus to different users. The Messaging API supports postback and datetime picker actions. It also allows for full customization of the tappable areas in a rich menu image.

For more information on how to create a rich menu with the Messaging API, see:

LINE@ Manager

The LINE@ Manager provides a graphical user interface where you can configure tappable areas for a rich menu image based on predefined image templates. With the LINE@ Manager, you can also use customized labels and our predefined icons to create a rich menu.

You can create multiple rich menus but only one rich menu can be active at a single time. The rich menu is then displayed to all users who interact with your bot.

For more information on how to create a rich menu with the LINE@ Manager, see Creating a rich menu with the LINE@ Manager.

Creating and linking rich menus using the Messaging API

To create a rich menu and link it to a specific user using the Messaging API, do the following:

  1. Prepare a rich menu image
  2. Create a rich menu
  3. Upload the rich menu image
  4. Link the rich menu to an individual user

For an example of how a rich menu is implemented in a sample bot using PHP, see the demo-rich-menu-bot GitHub repository.

Prepare a rich menu image

Prepare an image with up to 20 different tappable areas to use in the rich menu. You can use your own customized design or one of our predefined image templates on the LINE@ Manager.

Your rich menu image must meet the following requirements:

  • Image format: JPEG or PNG
  • Image size: 2500x1686 or 2500x843 pixels
  • Maximum file size: 1 MB

Create a rich menu

To create a rich menu, follow these steps:

  1. Create a rich menu object which contains information about the rich menu's size, name, chat bar text, tappable areas and whether the menu is displayed by default or not.
  2. Send an HTTP POST request to the /v2/bot/richmenu endpoint with your channel access token in the Authorization header and the rich menu object in the body. A rich menu ID is returned on success.

You can create up to 1000 rich menus for one bot.

The following are an example image, request and response for a rich menu with multiple tappable areas representing a game controller.

Example rich menu image
Rich menu sample

Example request

  curl -v -X POST https://api.line.me/v2/bot/richmenu \
  -H 'Authorization: Bearer {channel access token}' \
  -H 'Content-Type:application/json' \
  -d \
  '{
    "size":{
        "width":2500,
        "height":1686
    },
    "selected":false,
    "name":"Controller",
    "chatBarText":"Controller",
    "areas":[
        {
          "bounds":{
              "x":551,
              "y":325,
              "width":321,
              "height":321
          },
          "action":{
              "type":"message",
              "text":"up"
          }
        },
        {
          "bounds":{
              "x":876,
              "y":651,
              "width":321,
              "height":321
          },
          "action":{
              "type":"message",
              "text":"right"
          }
        },
        {
          "bounds":{
              "x":551,
              "y":972,
              "width":321,
              "height":321
          },
          "action":{
              "type":"message",
              "text":"down"
          }
        },
        {
          "bounds":{
              "x":225,
              "y":651,
              "width":321,
              "height":321
          },
          "action":{
              "type":"message",
              "text":"left"
          }
        },
        {
          "bounds":{
              "x":1433,
              "y":657,
              "width":367,
              "height":367
          },
          "action":{
              "type":"message",
              "text":"btn b"
          }
        },
        {
          "bounds":{
              "x":1907,
              "y":657,
              "width":367,
              "height":367
          },
          "action":{
              "type":"message",
              "text":"btn a"
          }
        }
    ]
  }'

Example response with a rich menu ID and a status code of 200.

{
    "richMenuId": "richmenu-88c05ef6921ae53f8b58a25f3a65faf7"
}

A 400 Bad Request status code is returned if you have reached the maximum of 1000 rich menus for your bot. In that case, you must first delete a rich menu before creating a new rich menu.

For more information, see the Create rich menu reference documentation.

Upload the rich menu image

To upload a rich menu image, send an HTTP POST request to the /bot/richmenu/{richMenuId}/content endpoint with the rich menu ID in the richMenuId path parameter.

curl -v -X POST https://api.line.me/v2/bot/richmenu/{richMenuId}/content \
-H "Authorization: Bearer {channel access token}" \
-H "Content-Type: image/jpeg" \
-T image.jpg

For more information, see the Upload rich menu image reference documentation.

To link the rich menu to an individual user, send an HTTP POST request to the /bot/user/{userId}/richmenu/{richMenuId} endpoint with the rich menu ID and a user ID as path parameters. The rich menu is displayed to the user immediately if the API call is successful.

If a rich menu is already linked to the user, it will be replaced by the new rich menu.

Note: Rich menus are displayed to users only after they have been linked to a specific user.

curl -v -X POST https://api.line.me/v2/bot/user/{userId}/richmenu/{richMenuId} \
-H "Authorization: Bearer {channel access token}"

For more information, see the Link rich menu to user reference documentation.

Other rich menu features

Once you have created and linked a rich menu to individual users, you can also do the following with the Messaging API.

Get rich menu ID of a user

To get the rich menu ID of a rich menu linked to a user, send an HTTP GET request to the /bot/user/{userId}/richmenu endpoint with a user ID as a path parameter. If successful, the rich menu ID linked to the user is returned in the response.

If no rich menu is linked to the specified user, the LINE Platform returns an HTTP 404 Not Found error.

curl -v -X GET https://api.line.me/v2/bot/user/{userId}/richmenu \
-H 'Authorization: Bearer {channel access token}'

For more information, see the Get rich menu ID of user reference documentation.

Delete rich menu

If you have reached the maximum of 1000 rich menus for your bot, you must delete a rich menu before you can create a new one. To delete a rich menu, send an HTTP DELETE request to the /bot/richmenu/{richMenuId} endpoint with a rich menu ID as a path parameter.

curl -v -X DELETE https://api.line.me/v2/bot/richmenu/{richMenuId} \
-H 'Authorization: Bearer {channel access token}'

For more information, see the Delete rich menu reference documentation.

To unlink a rich menu for a user, send an HTTP DELETE request to the /bot/user/{userId}/richmenu with the user ID as a path parameter. Once the rich menu has been unlinked, the rich menu set in the LINE@ Manager is used if available or no rich menu is displayed.

curl -v -X DELETE https://api.line.me/v2/bot/user/{userId}/richmenu \
-H 'Authorization: Bearer {channel access token}'

For more information, see the Unlink rich menu from user reference documentation.

Get rich menu list

To get a list of all the rich menu IDs and rich menu objects created for your bot, send an HTTP GET request to the /bot/richmenu/list endpoint.

curl -v -X GET https://api.line.me/v2/bot/richmenu/list \
-H 'Authorization: Bearer {channel access token}'

For more information, see the Get rich menu list reference documentation.

Download a rich menu image

To download an image associated with a rich menu, send an HTTP GET request to the /bot/richmenu/{richMenuId}/content endpoint with the rich menu ID as a path parameter. To download the image as a file, you can specify a file name using -o [filename] in a cURL command.

curl \
-H 'Authorization: Bearer {channel access token}' \
"https://api.line.me/v2/bot/richmenu/{richMenuId}/content" \
-o picture.jpg

For more information, see the Download rich menu image reference documentation.

Creating a rich menu with the LINE@ Manager

To create a rich menu in the LINE@ Manager, do the following:

  1. Go to "Create Rich Content" > "Rich Menu" in the LINE@ Manager
  2. Click Create New Rich menu content settings
  3. Configure the rich menu
  4. Select a predefined rich menu image template
    • Image templates
      Rich menu content settings
    • Text + icon templates
      Rich menu content settings
  5. Upload an image
  6. Select an action for each area (keyword, URL, text) Rich menu content settings
  7. Click Save

Users interacting with your bot will now see the rich menu in the chat screen.

For more detailed information on using rich menus, see the Rich menu reference. To see a demo of how to implement rich menus with the Messaging API, see our demo-rich-menu-bot GitHub repository.


Questions or suggestions?

If you have any questions about our LINE Platform products, first check our FAQ page and Community site. To share suggestions or feature requests regarding the documentation or the LINE Platform, click the buttom below or create an issue on the LINE Platform feedback GitHub repository.