# Messaging API reference

# Common specifications

# Rate limits

The Messaging API applies the following rate limits for each endpoint. Rate limits depend on your plan and endpoint.

Note

If you continue to send requests exceeding the rate limit for an extended period of time, we may block incoming requests.

# For bots associated with LINE Official Accounts

Endpoint Rate limit
Send a multicast message 100,000 requests per minute
1,700 requests per second*
2,000,000 recipients per minute
Send a narrowcast message
Send a broadcast message
Get number of sent messages
Get number of friends
Get friend demographics
60 requests per hour
Other API endpoints 100,000 requests per minute
1,700 requests per second*

*The rate limit in seconds is a guideline for mass transmission.

# For bots associated with LINE@ accounts

Endpoint Rate limit
Send a multicast message 10,000 requests per minute
170 requests per second*
200,000 recipients per minute
Other API endpoints 10,000 requests per minute
170 requests per second*

*The rate limit in seconds is a guideline for mass transmission.

# Status codes

The following status codes are returned by the Messaging API.

Status code Description
200 OK Request successful
400 Bad Request Problem with the request
401 Unauthorized Valid channel access token is not specified
403 Forbidden Not authorized to access the resource. Confirm that your account or plan is authorized to access the resource.
429 Too Many Requests
  • Exceeded the rate limit for requests.
  • Exceeded your monthly message limit. You can check the limit for your account in the LINE Official Account Manager.
500 Internal Server Error Error on the internal server

# Response headers

The following HTTP headers are included in Messaging API responses.

Response headers Description
X-Line-Request-Id Request ID. A unique ID is generated for each request

# Error responses

The following JSON data is returned in the response body when an error occurs.

message

String

Message containing information about the error. For more details, see Error messages.

details[].message

String

Details of the error. Not returned in certain situations.

details[].property

String

Location of where the error occurred. Not returned in certain situations.

Example error response

# Error messages

The main error messages that are found in the message property of the JSON error responses are shown below.

Message Description
The request body has X error(s) An error was found in the JSON data of the request body. The number of errors is displayed for "X". Further details are shown in the details[].message and details[].property properties.
Invalid reply token An invalid reply token was used in the reply message
The property, XXX, in the request body is invalid (line: XXX, column: XXX) An invalid property was specified in the request body. The specific property is displayed for "XXX".
The request body could not be parsed as JSON (line: XXX, column: XXX) The JSON in the request body could not be parsed. The specific line and column are displayed.
The content type, XXX, is not supported A content type not supported by the API is requested.
Authentication failed due to the following reason: XXX Authentication failed when the API was called. The reason is displayed for "XXX".
Access to this API is not available for your account Appears when calling an API that you do not have permission to use.
Failed to send messages Appears when the message fails to be sent. One reason this may appear is if the user ID specified does not exist.
You have reached your monthly limit. You have exceeded the target limit for additional messages.

# Webhooks

# Introduction

When an event such as when a user adds your LINE Official Account as a friend or sends a message occurs, the LINE Platform sends an HTTPS POST request to the webhook URL (bot server).

The webhook URL is configured for each channel in the console.

We recommend processing events asynchronously

We recommend processing events asynchronously, so that processing an HTTP POST request doesn't cause delays in processing subsequent requests.

# Request headers

X-Line-Signature

# Request body

The request body contains a JSON object with the user ID of a bot that should receive webhook events and an array of webhook event objects.

destination

String

User ID of a bot that should receive webhook events. The user ID value is a string that matches the regular expression, U[0-9a-f]{32}.

events

List of webhook events. An empty list may be sent from the LINE Platform to confirm communication.

# Response

The bot server must return status code 200 after it receives the HTTP POST request sent from the LINE Platform.

Note
  • HTTP POST requests sent from the LINE Platform aren't resent if the request fails.

  • The LINE Platform may send an HTTP POST request that doesn't include a webhook event to confirm communication. In this case, please send a 200 status code.

    Example HTTP POST request without a webhook event:

    {
        "destination": "xxxxxxxxxx",
        "events": []
    }
    

# Signature validation

The signature in the X-Line-Signature request header must be verified to confirm that the request was sent from the LINE Platform.

Authentication is performed as follows:

  1. With the channel secret as the secret key, your application retrieves the digest value in the request body created using the HMAC-SHA256 algorithm.
  2. The server confirms that the X-Line-Signature in the request header matches the Base64-encoded digest value.

Click the language tabs for signature validation code samples in different programming languages.

Example of signature validation

# Webhook event objects

JSON objects which contain events generated on the LINE Platform.

Some properties of these event objects might not have any value. Generated event objects don't contain properties without any value.

The structure of these event objects might be changed when the Messaging API feature is updated. Such changes can include adding properties, changing the order of properties, adding or deleting spaces and newlines between data elements, and so on. Implement your server so as not to fail in receiving event objects whose structure has changed in the future.

Example webhook event object

# Common properties

The following properties are found in webhook event objects.

type

String

Identifier for the type of event

mode

String

Channel state.

  • active: The channel is active. You can send a reply message or push message from the bot server that received this webhook event.
  • standby (under development): The channel is waiting. The bot server that received this webhook event shouldn't send any messages.

timestamp

Number

Time of the event in milliseconds

source

Object

Source user, group, or room object with information about the source of the event.

What causes the mode property to change

The mode property's value can change to standby if the channel administrator starts using channel multiplexing (under development). The value of mode never automatically changes to standby.

There is currently no way to multiplex incoming channels.

# Source user

type

String

user

userId

String

ID of the source user

Source user example

# Source group

type

String

group

groupId

String

ID of the source group

userId

String

ID of the source user. Only included in message events. Users of LINE version 7.4.x or earlier are not included in userId. For more information, see User consent.

Source group example

# Source room

type

String

room

roomId

String

ID of the source room

userId

String

ID of the source user. Only included in message events. Users of LINE version 7.4.x or earlier are not included in userId. For more information, see User consent.

Source room example

# Message event

Webhook event object which contains the sent message. The message property contains a message object which corresponds with the message type. You can reply to message events.

type

String

message

replyToken

String

Token for replying to the event

message

Object

Object containing the contents of the message. Message types include:

# Text

Message object which contains the text sent from the source.

id

String

Message ID

type

String

text

text

String

Message text

Text message example

# Image

Message object which contains the image content sent from the source.

id

String

Message ID

type

String

image

contentProvider.type

String

Provider of the image file.

  • line: The image was sent by a LINE user. The binary image data can be retrieved from the content endpoint.
  • external: The image was sent using the LIFF liff.sendMessages() method. For more information, see liff.sendMessages() in the LIFF API reference.

contentProvider.originalContentUrl

String

URL of the image file. Only included when contentProvider.type is external.

contentProvider.previewImageUrl

String

URL of the preview image. Only included when contentProvider.type is external.

Image message example

# Video

Message object which contains the video content sent from the source. The preview image is displayed in the chat and the video is played when the image is tapped.

id

String

Message ID

type

String

video

duration

Number

Length of video file (milliseconds)

contentProvider.type

String

Provider of the video file.

  • line: The video was sent by a LINE user. The binary video data can be retrieved from the content endpoint.
  • external: The video was sent using the LIFF liff.sendMessages() method. For more information, see liff.sendMessages() in the LIFF API reference.

contentProvider.originalContentUrl

String

URL of the video file. Only included when contentProvider.type is external.

contentProvider.previewImageUrl

String

URL of the preview image. Only included when contentProvider.type is external.

Video message example

# Audio

Message object which contains the audio content sent from the source.

id

String

Message ID

type

String

audio

duration

Number

Length of audio file (milliseconds)

contentProvider.type

String

Provider of the audio file.

  • line: The audio file was sent by a LINE user. The binary audio data can be retrieved from the content endpoint.
  • external: The audio file was sent using the LIFF liff.sendMessages() method. For more information, see liff.sendMessages() in the LIFF API reference.

contentProvider.originalContentUrl

String

URL of the audio file. Only included when contentProvider.type is external.

Audio message example

# File

Message object which contains the file sent from the source. The binary data can be retrieved from the content endpoint.

id

String

Message ID

type

String

file

fileName

String

File name

fileSize

Number

File size in bytes

File message example

# Location

Message object which contains the location data sent from the source.

id

String

Message ID

type

String

location

title

String

Title

address

String

Address

latitude

Decimal

Latitude

longitude

Decimal

Longitude

Location message example

# Sticker

Message object which contains the sticker data sent from the source. For a list of basic LINE stickers and sticker IDs, see sticker list.

id

String

Message ID

type

String

sticker

packageId

String

Package ID

stickerId

String

Sticker ID

stickerResourceType

String

Sticker resource type. One of:

  • STATIC: Still image
  • ANIMATION: Animated sticker
  • SOUND: Sticker with sound
  • ANIMATION_SOUND: Animated sticker with sound
  • POPUP: Pop-up sticker
  • POPUP_SOUND: Pop-up sticker with sound
  • NAME_TEXT: Custom sticker. You can't retrieve the sticker's custom text with the Messaging API.
  • PER_STICKER_TEXT: Message sticker. You can't retrieve the sticker's custom text with the Messaging API.
About sticker resource types

In the future, we may add new types without notice. Make sure your implementation can handle both current and future sticker resource types.

Sticker message example

# Follow event

Event object for when your LINE Official Account is added as a friend (or unblocked). You can reply to follow events.

type

String

follow

replyToken

String

Token for replying to this event

Follow event example

# Unfollow event

Event object for when your LINE Official Account is blocked.

type

String

unfollow

Unfollow event example

# Join event

Event object for when your LINE Official Account joins a group or room. You can reply to join events.

A join event is triggered at different times for groups and rooms.

  • For groups: A join event is sent when a user invites your LINE Official Account.
  • For rooms: A join event is sent when the first event (for example when a user sends a message or is added to the room) occurs after your LINE Official Account is added.

type

String

join

replyToken

String

Token for replying to this event

Join event example

# Leave event

Event object for when a user removes your LINE Official Account from a group or when your LINE Official Account leaves a group or room.

type

String

leave

Leave event example

# Member join event

Event object for when a user joins a group or room that the LINE Official Account is in.

type

String

memberJoined

joined.members

Array of source user objects

User ID of users who joined

replyToken

String

Token for replying to this event

Member join event example

# Member leave event

Event object for when a user leaves a group or room that the LINE Official Account is in.

type

String

memberLeft

left.members

Array of source user objects

User ID of users who left

Member leave event example

# Postback event

Event object for when a user performs a postback action which initiates a postback. You can reply to postback events.

type

String

postback

replyToken

String

Token for replying to this event

postback.data

String

Postback data

JSON object with the date and time selected by a user through a datetime picker action.
Only returned for postback actions via a datetime picker action.

Postback event example

# postback.params object

Object with the date and time selected by a user through a datetime picker action. The full-date, time-hour, and time-minute formats follow the RFC3339 protocol.

Property Format Description
date full-date Date selected by user. Only included in the date mode.
time time-hour ":" time-minute Time selected by the user. Only included in the time mode.
datetime full-date "T" time-hour ":" time-minute Date and time selected by the user. Only included in the datetime mode.

postback.params object example

# Beacon event

Event object for when a user enters the range of a LINE Beacon. You can reply to beacon events.

type

String

beacon

replyToken

String

Token for replying to this event

beacon.hwid

String

Hardware ID of the beacon that was detected

beacon.type

String

Type of beacon event. See Beacon event types.

beacon.dm

String

Device message of beacon that was detected. This message consists of data generated by the beacon to send notifications to bot servers. Only included in webhook events from devices that support the "device message" property.
For more information, see the LINE Simple Beacon specification.

Beacon event example

# Beacon event types

beacon.type Description
enter Entered beacon's reception range
leave [Deprecated] Left beacon's reception range.
banner Tapped beacon banner
stay A user is in the beacon's reception range.
This event is sent repeatedly at a minimum of 10 seconds.

If you are interested in using the banner and stay event, make an inquiry through the LINE for Business website.

Event object for when a user has linked his/her LINE account with a provider's service account. You can reply to account link events.

If the link token has expired or has already been used, no webhook event will be sent and the user will be shown an error.

type

String

accountLink

replyToken

String

Token for replying to this event. This value will not be included if the link has failed.

link

Object

link object. This will include whether the account link was successful or not and a nonce generated from the user ID on the provider's service.

Account link event example

result

String

One of the following values to indicate whether the link was successful or not.

  • ok: Indicates the link was successful.
  • failed: Indicates the link failed for any reason, such as due to a user impersonation.

nonce

String

Example link object

Indicates that a user linked a device with LINE.

type

String

things

replyToken

String

Token for replying to this event

things.deviceId

String

Device ID of the device that has been linked with LINE.

things.type

String

link

If you use the LINE Things API, you can identify the device that has been linked or unlinked by the user from the device ID acquired by the Webhook event. For more information about the API, see Getting the product ID and PSDI by specifying the device ID in the LINE Things API reference.

Device link event example

Indicates that the user unlinked a device from LINE.

type

String

things

replyToken

String

Token for replying to this event

things.deviceId

String

Device ID of the device that was unlinked from LINE.

things.type

String

unlink

If you use the LINE Things API, you can identify the device that has been linked or unlinked by the user from the device ID acquired by the Webhook event. For more information about the API, see Getting the product ID and PSDI by specifying the device ID in the LINE Things API reference.

Device unlink event example

# LINE Things scenario execution event

This event indicates that an automatic communication scenario has been executed.

Rather than returning an aggregated result for a scenario set, an execution result is returned for each individual scenario.

The order in which execution results are returned is independent of the order of the scenarios.

type

String

things

replyToken

String

Token for replying to this event

things.deviceId

String

Device ID of the device that executed the scenario

things.type

String

scenarioResult

things.result.scenarioId

String

Scenario ID executed

things.result.revision

Number

Revision number of the scenario set containing the executed scenario

things.result.startTime

Number

Timestamp for when execution of scenario action started (milliseconds, LINE app time)

things.result.endTime

Number

Timestamp for when execution of scenario was completed (milliseconds, LINE app time)

things.result.resultCode

String

Scenario execution completion status
See also things.result.resultCode definitions.

things.result.actionResults

Array

Execution result of individual operations specified in action
Note that an array of actions specified in a scenario has the following characteristics

  • The actions defined in a scenario are performed sequentially, from top to bottom.
  • Each action produces some result when executed.
    Even actions that do not generate data, such as SLEEP, return an execution result of type void.
  • The number of items in an action array may be 0.

Therefore, things.result.actionResults has the following properties:

  • The number of items in the array matches the number of actions defined in the scenario.
  • The order of execution results matches the order in which actions are performed. That is, in a scenario set with multiple GATT_READ actions, the results are returned in the order in which each individual GATT_READ action was performed.
  • If 0 actions are defined in the scenario, the number of items in things.result.actionResults will be 0.

things.result.actionResults[].type

String

void, binary

  • Depends on type of the executed action.
  • This property is always included if things.result.actionResults is not empty.

things.result.actionResults[].data

String

Base64-encoded binary data
This property is always included when things.result.actionResults[].type is binary.

things.result.bleNotificationPayload

String

Data contained in notification
The value is Base64-encoded binary data. Only included for scenarios where trigger.type = BLE_NOTIFICATION.

things.result.errorReason

String

Error reason

Example of LINE Things scenario execution event

# things.result.resultCode definition

resultCode Description
success Indicates that the execution has completed successfully
gatt_error Indicates that the execution of the GATT operation failed
  • GATT Service UUID is incorrect.
  • GATT Characteristic UUID is incorrect.
  • Attempted to write to a characteristic that cannot be written to.
runtime_error Indicates that an unexpected error has occurred
  • When an unexpected error has occurred

# OAuth

# Issue channel access token

Note

This method issues a short-lived channel access token that is valid for 30 days. To issue a long-lived channel access token, use the "Issue" button found on the console.

Issues a short-lived channel access token.

Up to 30 tokens can be issued. If the maximum is exceeded, existing channel access tokens are revoked in the order of when they were first issued.

Example request

# HTTP request

# Request headers

Content-Type

application/x-www-form-urlencoded

# Request body

grant_type

String

client_credentials

client_id

String

Channel ID. Found on the console.

client_secret

String

Channel secret. Found on the console.

# Response

Returns a 200 HTTP status code and a JSON object with the following information.

access_token

String

Short-lived channel access token. Valid for 30 days.
Note: Channel access tokens cannot be refreshed.

expires_in

Number

Time until channel access token expires in seconds from time the token is issued

token_type

String

Bearer

Example response

# Error response

Returns a 400 HTTP status code and a JSON object with the following information.

error

String

Error summary

error_description

String

Details of the error. Not returned in certain situations.

Example error response

# Revoke channel access token

Revokes a channel access token.

Example request

# HTTP request

# Request headers

Content-Type

application/x-www-form-urlencoded

# Request body

access_token

String

Channel access token

# Response

Returns status code 200 and an empty response body. No error occurs if an invalid channel access token is specified.

# Error response

Returns a 400 HTTP status code and a JSON object with the following information.

error

String

Error summary

error_description

String

Details of the error. Not returned in certain situations.

Example error response

# Message

# Send reply message

Sends a reply message in response to an event from a user, group, or room.

To send reply messages, you must have a reply token which is included in a webhook event object.

Webhooks are used to notify you when an event occurs. For events that you can respond to, a reply token is issued for replying to messages.

Because the reply token becomes invalid after a certain period of time, responses should be sent as soon as a message is received. Reply tokens can only be used once.

Example request

# HTTP request

POST https://api.line.me/v2/bot/message/reply

# Request headers

Content-Type

application/json

Authorization

Bearer {channel access token}

# Request body

replyToken

String

Required

Reply token received via webhook

messages

Array of message objects

Required

Messages to send
Max: 5

notificationDisabled

Boolean

Optional
  • true: The user doesn't receive a push notification when the message is sent.
  • false: The user receives a push notification when the message is sent (unless they have disabled push notifications in LINE and/or their device).

Default: false

# Response

Returns status code 200 and an empty JSON object.

Example response

# Send push message

Sends a push message to a user, group, or room at any time.

Note: LINE@ accounts under the free or basic plan cannot call this API endpoint.

Example request

# HTTP request

POST https://api.line.me/v2/bot/message/push

# Request headers

Content-Type

application/json

Authorization

Bearer {channel access token}

# Request body

to

String

Required

ID of the target recipient. Use a userId, groupId, or roomId value returned in a webhook event object. Do not use the LINE ID found on LINE.

messages

Array of message objects

Required

Messages to send
Max: 5

notificationDisabled

Boolean

Optional
  • true: The user doesn't receive a push notification when the message is sent.
  • false: The user receives a push notification when the message is sent (unless they have disabled push notifications in LINE and/or their device).

Default: false

# Response

Returns status code 200 and an empty JSON object.

Example response

# Send multicast message

Sends push messages to multiple users at any time. Messages cannot be sent to groups or rooms.

Note: LINE@ accounts under the free or basic plan cannot call this API endpoint.

Example request

# HTTP request

POST https://api.line.me/v2/bot/message/multicast

# Request headers

Content-Type

application/json

Authorization

Bearer {channel access token}

# Request body

to

Array of strings

Required

Array of user IDs. Use userId values which are returned in webhook event objects. Do not use LINE IDs found on LINE.
Max: 150 user IDs

messages

Array of message objects

Required

Messages to send
Max: 5

notificationDisabled

Boolean

Optional
  • true: The user doesn't receive a push notification when the message is sent.
  • false: The user receives a push notification when the message is sent (unless they have disabled push notifications in LINE and/or their device).

Default: false

# Response

Returns status code 200 and an empty JSON object.

Example response

# Send broadcast message

Sends push messages to multiple users at any time.

LINE Official Account migration

You can't call this API with a LINE@ account or LINE Official Account that hasn't been migrated to the account plans implemented on April 18, 2019. Please migrate your account first. For more information, see Migration of LINE@ accounts.

Example request

# HTTP request

POST https://api.line.me/v2/bot/message/broadcast

# Request headers

Content-Type

application/json

Authorization

Bearer {channel access token}

# Request body

messages

Array of message objects

Required

Messages to send
Max: 5

notificationDisabled

Boolean

Optional
  • true: The user doesn't receive a push notification when the message is sent.
  • false: The user receives a push notification when the message is sent (unless they have disabled push notifications in LINE and/or their device).

Default: false

# Response

Returns status code 200 and an empty JSON object.

Example response

# Get content

Gets images, videos, audio, and files sent by users.

No API for retrieving text

You can't use the Messaging API to retrieve text sent by users.

Example request

# HTTP request

GET https://api-data.line.me/v2/bot/message/{messageId}/content

# Request headers

Authorization

Bearer {channel access token}

# Path parameters

messageId

Message ID

# Response

Returns status code 200 and the content in binary.

Content is automatically deleted after a certain period from when the message was sent. There is no guarantee for how long content is stored.

# Get the target limit for additional messages

Gets the target limit for additional messages in the current month.

The number of messages retrieved by this operation includes the number of messages sent from LINE Official Account Manager.

Set a target limit with LINE Official Account Manager. For the procedures, refer to the LINE Official Account Manager manual.

Note: LINE@ accounts cannot call this API endpoint.

Example request

# HTTP request

# Request headers

Authorization

Bearer {channel access token}

# Response

Returns status code 200 and a JSON object with the following information.

type

String

One of the following values to indicate whether a target limit is set or not.

  • none. This indicates that a target limit is not set.
  • limited. This indicates that a target limit is set.

value

Number

The target limit for additional messages in the current month. This property is returned when the type property has a value of limited.

Example response

# Get number of messages sent this month

Gets the number of messages sent in the current month.

The number of messages retrieved by this operation includes the number of messages sent from LINE Official Account Manager.

The number of messages retrieved by this operation is approximate. To get the correct number of sent messages, use LINE Official Account Manager or execute API operations for getting the number of sent messages.

Note: LINE@ accounts cannot call this API endpoint.

Example request

# HTTP request

# Request headers

Authorization

Bearer {channel access token}

# Response

Returns status code 200 and a JSON object with the following information.

totalUsage

Number

The number of sent messages in the current month

Example response

# Get number of sent reply messages

Gets the number of messages sent with the /bot/message/reply endpoint.

The number of messages retrieved by this operation does not include the number of messages sent from LINE Official Account Manager.

Example request

# HTTP request

# Request headers

Authorization

Bearer {channel access token}

# Query parameters

date

Required

Date the messages were sent

  • Format: yyyyMMdd (Example: 20191231)
  • Timezone: UTC+9

# Response

Returns status code 200 and a JSON object with the following information.

status

String

Status of the counting process. One of the following values is returned:

  • ready: You can get the number of messages.
  • unready: The message counting process for the date specified in date has not been completed yet. Retry your request later. Normally, the counting process is completed within the next day.
  • out_of_service: The date specified in date is earlier than March 31, 2018, when the operation of the counting system started.

success

Number

The number of messages sent with the Messaging API on the date specified in date. The response has this property only when the value of status is ready.

Example response

# Get number of sent push messages

Gets the number of messages sent with the /bot/message/push endpoint.

The number of messages retrieved by this operation does not include the number of messages sent from LINE Official Account Manager.

Note: LINE@ accounts under the free or basic plan cannot call this API endpoint.

Example request

# HTTP request

# Request headers

Authorization

Bearer {channel access token}

# Query parameters

date

Required

Date the messages were sent

  • Format: yyyyMMdd (Example: 20191231)
  • Timezone: UTC+9

# Response

Returns status code 200 and a JSON object with the following information.

status

String

Status of the counting process. One of the following values is returned:

  • ready: You can get the number of messages.
  • unready: The message counting process for the date specified in date has not been completed yet. Retry your request later. Normally, the counting process is completed within the next day.
  • out_of_service: The date specified in date is earlier than March 31, 2018, when the operation of the counting system started.

success

Number

The number of messages sent with the Messaging API on the date specified in date. The response has this property only when the value of status is ready.

Example response

# Get number of sent multicast messages

Gets the number of messages sent with the /bot/message/multicast endpoint.

The number of messages retrieved by this operation does not include the number of messages sent from LINE Official Account Manager.

Note: LINE@ accounts under the free or basic plan cannot call this API endpoint.

Example request

# HTTP request

# Request headers

Authorization

Bearer {channel access token}

# Query parameters

date

Required

Date the messages were sent

  • Format: yyyyMMdd (Example: 20191231)
  • Timezone: UTC+9

# Response

Returns status code 200 and a JSON object with the following information.

status

String

Status of the counting process. One of the following values is returned:

  • ready: You can get the number of messages.
  • unready: The message counting process for the date specified in date has not been completed yet. Retry your request later. Normally, the counting process is completed within the next day.
  • out_of_service: The date specified in date is earlier than March 31, 2018, when the operation of the counting system started.

success

Number

The number of messages sent with the Messaging API on the date specified in date. The response has this property only when the value of status is ready.

Example response

# Get number of sent broadcast messages

Gets the number of messages sent with the /bot/message/broadcast endpoint.

The number of messages retrieved by this operation does not include the number of messages sent from LINE Official Account Manager.

LINE Official Account migration

You can't call this API with a LINE@ account or LINE Official Account that hasn't been migrated to the account plans implemented on April 18, 2019. Please migrate your account first. For more information, see Migration of LINE@ accounts.

Example request

# HTTP request

GET https://api.line.me/v2/bot/message/delivery/broadcast

# Request headers

Authorization

Bearer {channel access token}

# Query parameters

date

Required

Date the messages were sent

  • Format: yyyyMMdd (Example: 20191231)
  • Timezone: UTC+9

# Response

Returns status code 200 and a JSON object with the following information.

status

String

Status of the counting process. One of the following values is returned:

  • ready: You can get the number of messages.
  • unready: The message counting process for the date specified in date has not been completed yet. Retry your request later. Normally, the counting process is completed within the next day.
  • out_of_service: The date specified in date is earlier than March 31, 2018, when the operation of the counting system started.

success

Number

The number of messages sent with the Messaging API on the date specified in date. The response has this property only when the value of status is ready.

Example response

# Profile

# Get profile

Gets user profile information.

Example request

# HTTP request

# Request headers

Authorization

Bearer {channel access token}

# Path parameters

userId

User ID that is returned in a webhook event object. Do not use the LINE ID found on LINE.

# Response

Returns status code 200 and a JSON object with the following information.

displayName

String

User's display name

userId

String

User ID

pictureUrl

String

Profile image URL. "https" image URL. Not included in the response if the user doesn't have a profile image.

statusMessage

String

User's status message. Not included in the response if the user doesn't have a status message.

Example response

# Group

# Get group member user IDs

Note

This feature is available only to verified or premium accounts. For more information about account types, see the LINE Account Connect page on the LINE for Business website.

Gets the user IDs of the members of a group that the bot is in. This includes the user IDs of users who have not added the LINE Official Account as a friend or has blocked the LINE Official Account.

Example request

# HTTP request

GET https://api.line.me/v2/bot/group/{groupId}/members/ids

# Request headers

Authorization

Bearer {channel access token}

# Path parameters

groupId

Required

Group ID. Found in the source object of webhook event objects.

# Query parameters

start

Optional

Value of the continuation token found in the next property of the JSON object returned in the response. Include this parameter to get the next array of user IDs for the members of the group.

# Response

Returns status code 200 and a JSON object with the following properties.

memberIds

Array of strings

List of user IDs of members in the group. Users of LINE version 7.4.x or earlier are not included in memberIds. For more information, see User consent.
Max: 100 user IDs

next

String

A continuation token to get the next array of user IDs of the members in the group. Returned only when there are remaining user IDs that were not returned in memberIds in the original request.

Example response

# Get group member profile

Gets the user profile of a member of a group that the LINE Official Account is in if the user ID of the group member is known. You can get user profiles of users who have not added the LINE Official Account as a friend or have blocked the LINE Official Account.

Example request

# HTTP request

GET https://api.line.me/v2/bot/group/{groupId}/member/{userId}

# Request headers

Authorization

Bearer {channel access token}

# Path parameters

groupId

Group ID. Found in the source object of webhook event objects.

userId

User ID. Found in the source object of webhook event objects. Do not use the LINE ID used in LINE.

# Response

Returns status code 200 and a JSON object with the following information.

displayName

String

Display name

userId

String

User ID

pictureUrl

String

Profile image URL

Example response

# Leave group

Leaves a group.

Example request

# HTTP request

POST https://api.line.me/v2/bot/group/{groupId}/leave

# Request headers

Authorization

Bearer {channel access token}

# Path parameters

groupId

Group ID. Found in the source object of webhook event objects.

# Response

Returns status code 200 and an empty JSON object.

Example response

# Room

# Get room member user IDs

Note

This feature is available only to verified or premium accounts. For more information about account types, see the LINE Account Connect page on the LINE for Business website.

Gets the user IDs of the members of a room that the LINE Official Account is in. This includes the user IDs of users who have not added the LINE Official Account as a friend or have blocked the LINE Official Account.

Example request

# HTTP request

GET https://api.line.me/v2/bot/room/{roomId}/members/ids

# Request headers

Authorization

Bearer {channel access token}

# Path parameters

roomId

Required

Room ID. Found in the source object of webhook event objects.

# Query parameters

start

Optional

Value of the continuation token found in the next property of the JSON object returned in the response. Include this parameter to get the next array of user IDs for the members of the group.

# Response

Returns status code 200 and a JSON object with the following properties.

memberIds

Array of strings

List of user IDs of the members in the room. Users of LINE version 7.4.x or earlier are not included in memberIds. For more information, see User consent.
Max: 100 user IDs

next

String

A continuation token to get the next array of user IDs of the members in the room. Returned only when there are remaining user IDs that were not returned in memberIds in the original request.

Example response

# Get room member profile

Gets the user profile of a member of a room that the LINE Official Account is in if the user ID of the room member is known. You can get user profiles of users who have not added the LINE Official Account as a friend or have blocked the LINE Official Account.

Example request

# HTTP request

GET https://api.line.me/v2/bot/room/{roomId}/member/{userId}

# Request headers

Authorization

Bearer {channel access token}

# Path parameters

roomId

Room ID. Found in the source object of webhook event objects.

userId

User ID. Found in the source object of webhook event objects. Do not use the LINE ID used in LINE.

# Response

Returns status code 200 and a JSON object with the following information.

displayName

String

Display name

userId

String

User ID

pictureUrl

String

Profile image URL

Example response

# Leave room

Leaves a room.

Example request

# HTTP request

POST https://api.line.me/v2/bot/room/{roomId}/leave

# Request headers

Authorization

Bearer {channel access token}

# Path parameters

roomId

Room ID. Found in the source object of webhook event objects.

# Response

Returns status code 200 and an empty JSON object.

Example response

# Rich menu

Note

Rich menus created using the Messaging API are only supported on LINE 7.14.0 and later for Android and iOS.

Customizable menu that is displayed on your LINE Official Account's chat screen. For more information, see Using rich menus.

# Get rich menu

Gets a rich menu via a rich menu ID.

Example request

# HTTP request

GET https://api.line.me/v2/bot/richmenu/{richMenuId}

# Request headers

Authorization

Bearer {channel access token}

# Path parameters

richMenuId

Required

ID of a rich menu

# Response

Returns status code 200 and a rich menu response object.

Example response

# Create rich menu

Creates a rich menu.

You must upload a rich menu image, and set the rich menu as the default rich menu or link the rich menu to a user for the rich menu to be displayed. You can create up to 1000 rich menus for one LINE Official Account with the Messaging API.

Example request

# HTTP request

POST https://api.line.me/v2/bot/richmenu

# Request headers

Authorization

Bearer {channel access token}

Content-Type

application/json

# Request body

The rich menu represented as a rich menu object.

# Response

Returns status code 200 and a JSON object with the rich menu ID.

Example response

# Delete rich menu

Deletes a rich menu.

Rich menu limits

If you have reached the maximum of 1,000 rich menus with the Messaging API for your LINE Official Account, you must delete a rich menu before you can create a new one.

Example request

# HTTP request

DELETE https://api.line.me/v2/bot/richmenu/{richMenuId}

# Request headers

Authorization

Bearer {channel access token}

# Path parameters

richMenuId

Required

ID of a rich menu

# Response

Returns status code 200 and an empty JSON object.

Example response

# Set default rich menu

Sets the default rich menu. The default rich menu is displayed to all users who have added your LINE Official Account as a friend and are not linked to any per-user rich menu. If a default rich menu has already been set, calling this endpoint replaces the current default rich menu with the one specified in your request.

The rich menu is displayed in the following order of priority (highest to lowest):

  1. The per-user rich menu set with the Messaging API
  2. The default rich menu set with the Messaging API
  3. The default rich menu set with LINE Official Account Manager

Example request

# HTTP request

POST https://api.line.me/v2/bot/user/all/richmenu/{richMenuId}

# Request headers

Authorization

Bearer {channel access token}

# Path parameters

richMenuId

Required

ID of a rich menu

# Response

Returns status code 200 and an empty JSON object.

Example response

Links a rich menu to a user. Only one rich menu can be linked to a user at one time. If a user already has a rich menu linked, calling this endpoint replaces the existing rich menu with the one specified in your request.

The rich menu is displayed in the following order of priority (highest to lowest):

  1. The per-user rich menu set with the Messaging API
  2. The default rich menu set with the Messaging API
  3. The default rich menu set with LINE Official Account Manager

Example request

# HTTP request

POST https://api.line.me/v2/bot/user/{userId}/richmenu/{richMenuId}

# Request headers

Authorization

Bearer {channel access token}

# Path parameters

richMenuId

Required

ID of a rich menu

userId

Required

User ID. Found in the source object of webhook event objects. Do not use the LINE ID used in LINE.

# Response

Returns status code 200 and an empty JSON object.

Example response

Links a rich menu to multiple users.

The rich menu is displayed in the following order of priority (highest to lowest):

  1. The per-user rich menu set with the Messaging API
  2. The default rich menu set with the Messaging API
  3. The default rich menu set with LINE Official Account Manager

Example request

# HTTP request

POST https://api.line.me/v2/bot/richmenu/bulk/link

# Request headers

Content-Type

application/json

Authorization

Bearer {channel access token}

# Request body

richMenuId

String

Required

ID of a rich menu

userIds

Array of strings

Required

Array of user IDs. Found in the source object of webhook event objects. Do not use the LINE ID used in LINE.
Max: 150 user IDs

# Response

Returns status code 202 and an empty JSON object.

Unlike linking a rich menu to a user, this request is processed asynchronously in the background. Normally, the process is completed within a few seconds.

To verify whether the request was processed successfully, get the rich menu ID linked to the users and check if the rich menu is actually linked to the users.

Example response

# Get rich menu ID of user

Gets the ID of the rich menu linked to a user.

Example request

# HTTP request

GET https://api.line.me/v2/bot/user/{userId}/richmenu

# Request headers

Authorization

Bearer {channel access token}

# Path parameters

userId

Required

User ID. Found in the source object of webhook event objects. Do not use the LINE ID used in LINE.

# Response

Returns status code 200 and a JSON object with the rich menu ID.

Example response

Unlinks a rich menu from a user.

Example request

# HTTP request

DELETE https://api.line.me/v2/bot/user/{userId}/richmenu

# Request headers

Authorization

Bearer {channel access token}

# Path parameters

userId

Required

User ID. Found in the source object of webhook event objects. Do not use the LINE ID used in LINE.

# Response

Returns status code 200 and an empty JSON object.

Example response

Unlinks rich menus from multiple users.

Example request

# HTTP request

POST https://api.line.me/v2/bot/richmenu/bulk/unlink

# Request headers

Content-Type

application/json

Authorization

Bearer {channel access token}

# Request body

userIds

Array of strings

Required

Array of user IDs. Found in the source object of webhook event objects. Do not use the LINE ID used in LINE.
Max: 150 user IDs

# Response

Returns status code 202 and an empty JSON object.

Unlike unlinking a rich menu from a user, this request is processed asynchronously in the background. Normally, the process is completed within a few seconds.

To verify whether the request was processed successfully, get the rich menu ID linked to the users and check if the unlinked rich menus are actually not linked to the users.

Example response

# Download rich menu image

Downloads an image associated with a rich menu.

Example request

# HTTP request

GET https://api-data.line.me/v2/bot/richmenu/{richMenuId}/content

# Request headers

Authorization

Bearer {channel access token}

# Path parameters

richMenuId

Required

ID of the rich menu with the image to be downloaded

# Response

Returns status code 200 and the binary data of the rich menu image. The image can be downloaded as shown in the example request.

# Upload rich menu image

Uploads and attaches an image to a rich menu.

You can use rich menu images with the following specifications:

  • Image format: JPEG or PNG
  • Image size (pixels): 2500x1686, 2500x843, 1200x810, 1200x405, 800x540, 800x270
  • Max file size: 1 MB

Note: You cannot replace an image attached to a rich menu. To update your rich menu image, create a new rich menu object and upload another image.

Example request

# HTTP request

POST https://api-data.line.me/v2/bot/richmenu/{richMenuId}/content

# Request headers

Authorization

Bearer {channel access token}

Content-Type

image/jpeg or image/png

Content-Length

The length of the request body in octets (8-bit bytes). Must be a non-negative value.

# Path parameters

richMenuId

Required

The ID of the rich menu to attach the image to

# Response

Returns status code 200 and an empty JSON object.

Example response

# Get rich menu list

Gets a list of the rich menu response object of all rich menus created by Create a rich menu.

Note

You can't retrieve rich menus created with LINE Official Account Manager.

Example request

# HTTP request

GET https://api.line.me/v2/bot/richmenu/list

# Request headers

Authorization

Bearer {channel access token}

# Response

Returns status code 200 and a list of rich menu response objects.

richmenus

Array

Example response

# Followers

# Get follower IDs

Note

This feature is available only to verified or premium accounts. For more information about account types, see the LINE Account Connect page on the LINE for Business website.

Gets the user IDs of users who have added the LINE Official Account as a friend (followers).

Example request

# HTTP request

GET https://api.line.me/v2/bot/followers/ids

# Request headers

Content-Type

application/json

Authorization

Bearer {channel access token}

# Query parameters

start

Optional

Value of the continuation token found in the next property of the JSON object returned in the response. Include this parameter to get the next array of user IDs.

# Response

Returns status code 200 and a JSON object with the following properties.

userIds

Array of string

List of user IDs of users that have added the LINE Official Account as a friend. Users of LINE version 7.4.x or earlier are not included in userIds. For more information, see User consent.
Max: 300 user IDs

next

String

A continuation token to get the next array of user IDs. Returned only when there are remaining user IDs that were not returned in userIds in the original request. The number of user IDs in the userIds element does not have to reach 300 for the next property to be included in the response.

Example response

# Mission stickers

Note

The endpoint to send a mission sticker set is only available to corporate customers. For more information, contact your LINE representative or make an inquiry through the LINE for Business website.

Mission stickers are provided to user upon completion of certain objectives.

# Send mission sticker set (v3)

Example request

# HTTP request

POST https://api.line.me/shop/v3/mission

# Request headers

Content-Type

application/json

Authorization

Bearer {channel access token}

# Request body

to

String

Required

ID of the target user

productType

String

Required

STICKER

productId

String

Required

Package ID of the sticker set

sendPresentMessage

Boolean

Required

false

Note

Unlike the /v2/missionSticker/send endpoint, it is unnecessary to register the IP or network address of the server that connects this endpoint.

# Response

Returns status code 200 and an empty response body.

# Error response

The following JSON data is returned in the response body when an error occurs.

message

String

Message containing information about the error. For more details, see Error messages below.

# Error messages

The main error messages that are found in the message property of the JSON error responses are shown below.

Message Description
invalid request This message is returned when the request to send a sticker set failed because of the user status. For example:
  • The to property value is a user ID that doesn't exist or not a user ID.
  • The to property value is the ID of a user who doesn't belong to the target country of the sticker set specified in the productId property.
not found The productId property value is invalid ("internal error" might be returned for an invalid package ID).
not allowed to use the API The channel is not granted the required permission for the mission sticker feature.
not_sales_period The API call time is not within the valid period of the sticker set.

# Send mission sticker set (v2)

Example request

# HTTP request

POST https://api.line.me/v2/missionSticker/send

# Request headers

Content-Type

application/json

X-Line-ChannelId

Channel ID. Found on the console.

X-Line-ChannelSecret

Channel secret. Found on the console.

X-Line-Trusted-User-With-ACL

Value assigned when the permission to use this feature was granted

# Request body

to

String

Required

ID of the target user

messages

Array

Required

An array that has an object that includes the packageId and isPresent properties. Only one object can be specified.

messages[].packageId

String

Required

Package ID of the sticker set

messages[].isPresent

Boolean

Required

false

Note

It is necessary to register the IP or network address of the server that connects this endpoint in the LINE Developers console. Add the server to the "Security" tab for the target channel.

# Response

Returns a 200 HTTP status code and a JSON object with the following information.

ticketId

String

Value used internally by LINE.
Returns ticketId if the API call is successful.

Example response

# Error response

The main error messages that are found in the message property of the JSON error responses are shown below.

message

String

Message containing information about the error. For more details, see Error messages below.

# Error messages

The main error messages that are found in the message property of the JSON error responses are shown below.

Message Description
authentication failed This message is returned in either or both cases below:
  • Any of the X-Line-ChannelId, X-Line-ChannelSecret, or X-Line-Trusted-User-With-ACL headers are incorrect.
  • The server that connects this endpoint is not registered on the "Security" tab in the console.
CHANNEL_MISSION_STICKER_NOT_USABLE The channel is not granted the required permission for the mission sticker feature.

# Troubleshooting

If a user can't download a mission sticker set even though the API call is successful, check whether:

  • The sticker set information including the release date, channel ID, and country is accurate.
  • The country of the user is the same as that of the sticker set.
  • The user hasn't downloaded the sticker set.

For more information, contact your LINE representative.

# Message objects

JSON object which contains the contents of the message you send.

# Common properties for messages

The following properties can be specified in all the message objects.

# Quick reply

These properties are used for the quick reply feature. Supported on LINE 8.11.0 and later for iOS and Android. For more information, see Using quick replies.

quickReply

Object

Optional

If the user receives multiple message objects, the quickReply property of the last message object is displayed.

# items object

This is a container that contains quick reply buttons.

items

Array of objects

Required

Example items object

# Quick reply button object

This is a quick reply option that is displayed as a button.

type

String

Required

action

imageUrl

String

Optional

URL of the icon that is displayed at the beginning of the button

  • Max character limit: 1000
  • URL scheme: https
  • Image format: PNG
  • Aspect ratio: 1:1
  • Data size: Up to 1 MB

There is no limit on the image size.
If the action property has a camera action, camera roll action, or location action, and the imageUrl property is not set, the default icon is displayed.

action

Object

Required

Action performed when this button is tapped. Specify an action object. The following is a list of the available actions:

If a version of LINE that doesn't support the quick reply feature receives a message that contains quick reply buttons, only the message is displayed.

# Change icon and display name

When sending a message from the LINE Official Account, you can specify the sender.name and the sender.iconUrl properties in Message objects.

sender.name

String

Optional

Display name. Certain words such as LINE may not be used.
Max character limit: 20

sender.iconUrl

String

Optional

URL of the image to display as an icon when sending a message

  • Max character limit: 1000
  • URL scheme: https

Text message example of changed icon and display name

# Text message

type

String

Required

text

text

String

Required

Message text. You can include the following emoji:

Max character limit: 2000

Text message example

Text message example with emoji

{
    "type": "text",
    "text": "\uDBC0\uDC84 LINE emoji"
}

# Sticker message

type

String

Required

sticker

packageId

String

Required

Package ID for a set of stickers. For information on package IDs, see the Sticker list.

stickerId

String

Required

Sticker ID. For a list of sticker IDs for stickers that can be sent with the Messaging API, see the Sticker list.

Sticker message example

# Image message

type

String

Required

image

originalContentUrl

String

Required

Image URL (Max character limit: 1000)
HTTPS over TLS 1.2 or later
JPEG
Max: 4096 x 4096
Max: 1 MB

previewImageUrl

String

Required

Preview image URL (Max character limit: 1000)
HTTPS over TLS 1.2 or later
JPEG
Max: 240 x 240
Max: 1 MB

Image message example

# Video message

type

String

Required

video

originalContentUrl

String

Required

URL of video file (Max character limit: 1000)
HTTPS over TLS 1.2 or later
mp4
Max: 1 minute
Max: 10 MB

A very wide or tall video may be cropped when played in some environments.

previewImageUrl

String

Required

URL of preview image (Max character limit: 1000)
HTTPS over TLS 1.2 or later
JPEG
Max: 240 x 240
Max: 1 MB

Video message example

# Audio message

type

String

Required

audio

originalContentUrl

String

Required

URL of audio file (Max character limit: 1000)
HTTPS over TLS 1.2 or later
m4a
Max: 1 minute
Max: 10 MB

duration

Number

Required

Length of audio file (milliseconds)

Audio message example

# Location message

type

String

Required

location

title

String

Required

Title
Max character limit: 100

address

String

Required

Address
Max character limit: 100

latitude

Decimal

Required

Latitude

longitude

Decimal

Required

Longitude

Location message example

# Imagemap message

Imagemap messages are messages configured with an image that has multiple tappable areas. You can assign one tappable area for the entire image or different tappable areas on divided areas of the image.

You can also play a video on the image and display a label with a hyperlink after the video is finished.

type

String

Required

imagemap

baseUrl

String

Required

Base URL of the image
Max character limit: 1000
HTTPS over TLS 1.2 or later
For more information about supported images in imagemap messages, see How to configure an image.

altText

String

Required

Alternative text
Max character limit: 400

baseSize.width

Number

Required

Width of base image in pixels. Set to 1040.

baseSize.height

Number

Required

Height of base image. Set to the height that corresponds to a width of 1040 pixels.

video.originalContentUrl

String

URL of the video file (Max character limit: 1000)
HTTPS over TLS 1.2 or later
mp4
Max: 1 minute
Max: 10 MB

Note: A very wide or tall video may be cropped when played in some environments.

video.previewImageUrl

String

URL of the preview image (Max character limit: 1000)
HTTPS over TLS 1.2 or later
JPEG
Max: 240 x 240 pixels
Max: 1 MB

video.area.x

Number

Horizontal position of the video area relative to the left edge of the imagemap area. Value must be 0 or higher.

video.area.y

Number

Vertical position of the video area relative to the top of the imagemap area. Value must be 0 or higher.

video.area.width

Number

Width of the video area

video.area.height

Number

Height of the video area

video.externalLink.linkUri

String

Webpage URL. Called when the label displayed after the video is tapped.
Max character limit: 1000
The available schemes are http, https, line, and tel. For more information about the LINE URL scheme, see Using LINE features with the LINE URL scheme.

video.externalLink.label

String

Label. Displayed after the video is finished.
Max character limit: 30

actions

Array of imagemap action objects

Required

Action when tapped
Max: 50

*1 This property is required if you set a video to play on the imagemap.
*2 This property is required if you set a video to play and a label to display after the video on the imagemap.

Imagemap message example with two tappable areas

# How to configure an image

Images used in imagemap messages must meet the following requirements.

  • Image format: JPEG or PNG
  • Image width: 240px, 300px, 460px, 700px, 1040px
  • Max file size: Up to 1 MB

Make it possible to access images of 5 different sizes using the baseUrl/{image width} URL format. LINE will then download an image at the appropriate resolution based on the device.

For example, if we had a base URL of https://example.com/images/cats, the URL for the image with a width of 700px would be https://example.com/images/cats/700. To confirm all images display properly, access the image URLs.

Image width Example URL
240px https://example.com/bot/images/rm001/240
300px https://example.com/bot/images/rm001/300
460px https://example.com/bot/images/rm001/460
700px https://example.com/bot/images/rm001/700
1040px https://example.com/bot/images/rm001/1040
Exclude image extension from URL

Don't include the extension in the image filename. The image will not display in the imagemap message if the URL contains the image file extension (e.g. https://example.com/bot/images/rm001/700.png).

# Imagemap action objects

Object which specifies the actions and tappable areas of an imagemap.

When an area is tapped, the user is redirected to the URI specified in uri and the message specified in message is sent.

# Imagemap URI action object

type

String

Required

uri

label

String

Optional

Label for the action. Spoken when the accessibility feature is enabled on the client device.
Max character limit: 50
Supported on LINE 8.2.0 and later for iOS.

linkUri

String

Required

Webpage URL
Max character limit: 1000
The available schemes are http, https, line, and tel. For more information about the LINE URL scheme, see Using LINE features with the LINE URL scheme.

area

Defined tappable area

Example imagemap URI action object

# Imagemap message action object

type

String

Required

message

label

String

Optional

Label for the action. Spoken when the accessibility feature is enabled on the client device.
Max character limit: 50
Supported on LINE 8.2.0 and later for iOS.

text

String

Required

Message to send
Max character limit: 400
Supported on LINE for iOS and Android only.

area

Defined tappable area

Example imagemap message action object

# Imagemap area object

Defines the size of a tappable area. The top left is used as the origin of the area. Set these properties based on the baseSize.width property and the baseSize.height property.

x

Number

Required

Horizontal position relative to the left edge of the area. Value must be 0 or higher.

y

Number

Required

Vertical position relative to the top of the area. Value must be 0 or higher.

width

Number

Required

Width of the tappable area

height

Number

Required

Height of the tappable area

Example imagemap area object

# Template messages

Note

Template messages are only supported on LINE 6.7.0 and later for iOS and Android.

Template messages are messages with predefined layouts which you can customize. For more information, see Template messages.

The following template types are available:

# Common properties of template message objects

The following properties are common to all template message objects.

type

String

Required

template

altText

String

Required

Alternative text
Max character limit: 400

template

Object

Required

# Buttons template

Template with an image, title, text, and multiple action buttons.

type

String

Required

buttons

thumbnailImageUrl

String

Optional

Image URL (Max character limit: 1,000)
HTTPS over TLS 1.2 or later
JPEG or PNG
Max width: 1024px
Max file size: 1 MB

imageAspectRatio

String

Optional

Aspect ratio of the image. One of:

  • rectangle: 1.51:1
  • square: 1:1

Default: rectangle

imageSize

String

Optional

Size of the image. One of:

  • cover: The image fills the entire image area. Parts of the image that do not fit in the area are not displayed.
  • contain: The entire image is displayed in the image area. A background is displayed in the unused areas to the left and right of vertical images and in the areas above and below horizontal images.

Default: cover

imageBackgroundColor

String

Optional

Background color of the image. Specify a RGB color value. Default: #FFFFFF (white)

title

String

Optional

Title
Max character limit: 40

text

String

Required

Message text
Max character limit: 160 (no image or title)
Max character limit: 60 (message with an image or title)

defaultAction

Action object

Optional

Action when image, title or text area is tapped.

actions

Array of action objects

Required

Action when tapped
Max objects: 4

Buttons template message example

# Confirm template

Template with two action buttons.

type

String

Required

confirm

text

String

Required

Message text
Max character limit: 240

actions

Array of action objects

Required

Action when tapped
Set 2 actions for the 2 buttons

Confirm template message example

Template with multiple columns which can be cycled like a carousel. The columns are shown in order when scrolling horizontally.

type

String

Required

carousel

columns

Array of column objects

Required

Array of columns
Max columns: 10

imageAspectRatio

String

Optional

Aspect ratio of the image. One of:

  • rectangle: 1.51:1
  • square: 1:1

Applies to all columns. Default: rectangle

imageSize

String

Optional

Size of the image. One of:

  • cover: The image fills the entire image area. Parts of the image that do not fit in the area are not displayed.
  • contain: The entire image is displayed in the image area. A background is displayed in the unused areas to the left and right of vertical images and in the areas above and below horizontal images.

Applies to all columns. Default: cover.

Carousel template message example

thumbnailImageUrl

String

Optional

Image URL (Max character limit: 1,000)
HTTPS over TLS 1.2 or later
JPEG or PNG
Aspect ratio: 1:1.51
Max width: 1024px
Max file size: 1 MB

imageBackgroundColor

String

Optional

Background color of the image. Specify a RGB color value. The default value is #FFFFFF (white).

title

String

Optional

Title
Max character limit: 40

text

String

Required

Message text
Max character limit: 120 (no image or title)
Max character limit: 60 (message with an image or title)

defaultAction

Action object

Optional

Action when image, title or text area is tapped.

actions

Array of action objects

Required

Action when tapped
Max objects: 3

Template with multiple images which can be cycled like a carousel. The images are shown in order when scrolling horizontally.

type

String

Required

image_carousel

columns

Array of column objects

Required

Array of columns
Max columns: 10

Image carousel template message example

imageUrl

String

Required

Image URL (Max character limit: 1,000)
HTTPS over TLS 1.2 or later
JPEG or PNG
Aspect ratio: 1:1
Max width: 1024px
Max file size: 1 MB

action

Action object

Required

Action when image is tapped

# Flex Message

Flex Messages are messages with a customizable layout. You can customize the layout freely based on the specification for CSS Flexible Box (CSS Flexbox). For more information, see Sending Flex Messages in the API documentation.

type

String

Required

flex

altText

String

Required

Alternative text
Max character limit: 400

contents

Object

Required

Flex Message container

Flex Message example

# Container

A container is the top-level structure of a Flex Message. Here are the types of containers available:

For JSON samples and usage of containers, see Flex Message elements in the API documentation.

# Bubble

This is a container that contains one message bubble. It can contain four blocks: header, hero, body, and footer. For more information about using each block, see Block in the API documentation.

The maximum size of JSON data that defines a bubble is 10 KB.

type

String

Required

bubble

size

String

Optional

The size of the bubble. You can specify one of the following values: nano, micro, kilo, mega, or giga. The default value is mega.

direction

String

Optional

Text directionality and the direction of placement of components in horizontal boxes. Specify one of the following values:

  • ltr: The text is left-to-right horizontal writing, and the components are placed from left to right
  • rtl: The text is right-to-left horizontal writing, and the components are placed from right to left

The default value is ltr.

header

Object

Optional

Header block. Specify a Box.

hero

Object

Optional

Hero block. Specify a box or an image.

body

Object

Optional

Body block. Specify a Box.

footer

Object

Optional

Footer block. Specify a Box.

styles

Object

Optional

Style of each block. Specify a bubble style.

action

Object

Optional

Action performed when this image is tapped. Specify an action object. This property is supported on the following versions of LINE.

  • LINE for iOS and Android: 8.11.0 and later

Bubble example

# Objects for the block style

Use the following two objects to define the style of blocks in a bubble.

Example of a bubble style and block style

# Bubble style

header

Object

Optional

Header block. Specify a block style.

hero

Object

Optional

Hero block. Specify a block style.

body

Object

Optional

Body block. Specify a block style.

footer

Object

Optional

Footer block. Specify a block style.

# Block style

backgroundColor

String

Optional

Background color of the block. Use a hexadecimal color code.

separator

Boolean

Optional

true to place a separator above the block. The default value is false.

separatorColor

String

Optional

Color of the separator. Use a hexadecimal color code.

Note

You cannot place a separator above the first block.

A carousel is a container that contains multiple bubbles as child elements. Users can scroll horizontally through the bubbles.

The maximum size of JSON data that defines a carousel is 50 KB.

type

String

Required

carousel

contents

Array of objects

Required

Bubbles in the carousel. Max: 10 bubbles

Bubble width

A carousel cannot contain bubbles of different widths (size property). Each bubble in a carousel should have the same width.

Bubble height

The body of each bubble will stretch to match the bubble with the greatest height in the carousel. However, bubbles with no body will not change height.

Carousel example

# Component

Components are elements that make up a block. Here are the types of components available:

For JSON samples and usage of each component, see Flex Message elements and Flex Message layout in the API documentation.

# Box

This is a component that defines the layout of child components. You can also include a box in a box.

type

String

Required

box

layout

String

Required

The layout style of components in this box. For more information, see Direction of placing components in the API documentation.

contents

Array of objects

Required

Components in this box. Here are the types of components available:

Components are rendered in the order specified in the array.

backgroundColor

String

Optional

Background color of the block. In addition to the RGB color, an alpha channel (transparency) can also be set. Use a hexadecimal color code. (Example:#RRGGBBAA) The default value is #00000000.

borderColor

String

Optional

Color of box border. Use a hexadecimal color code.

borderWidth

String

Optional

Width of box border. You can specify a value in pixels or any one of none, light, normal, medium, semi-bold, or bold. none does not render a border while the others become wider in the order of listing.

cornerRadius

String

Optional

Radius at the time of rounding the corners of the border. You can specify a value in pixels or any one of none, xs, sm, md, lg, xl, or xxl. none does not round the corner while the others increase in radius in the order of listing. The default value is none.

width

String

Optional

Width of the box. For more information, see Width of a box in the API documentation.

height

String

Optional

Height of the box. For more information, see Height of a box in the API documentation.

flex

Number

Optional

The ratio of the width or height of this component within the parent box. For more information, see Width and height of components.

spacing

String

Optional

Minimum space between components in this box. The default value is none. For more information, see spacing property of the box in the API documentation.

margin

String

Optional

Minimum space between this component and the previous component in the parent element. For more information, see margin property of the component in the API documentation.

paddingAll

String

Optional

Free space between the borders of this box and the child element. For more information, see Box padding in the API documentation.

paddingTop

String

Optional

Free space between the border at the upper end of this box and the upper end of the child element. For more information, see Box padding in the API documentation.

paddingBottom

String

Optional

Free space between the border at the lower end of this box and the lower end of the child element. For more information, see Box padding in the API documentation.

paddingStart

String

Optional

Free space between the border at the left end of this box and the left end of the child element. For more information, see Box padding in the API documentation.

paddingEnd

String

Optional

Free space between the border at the right end of this box and the right end of the child element. For more information, see Box padding in the API documentation.

position

String

Optional

Reference position for placing this box. Specify one of the following values:

  • relative: Use the previous box as reference.
  • absolute: Use the top left of parent element as reference.

The default value is relative. For more information, see Offset in the API documentation.

offsetTop

String

Optional

The top offset. For more information, see Offset in the API documentation.

offsetBottom

String

Optional

The bottom offset. For more information, see Offset in the API documentation.

offsetStart

String

Optional

The left offset. For more information, see Offset in the API documentation.

offsetEnd

String

Optional

The right offset. For more information, see Offset in the API documentation.

action

Object

Optional

Action performed when this image is tapped. Specify an action object. This property is supported on the following versions of LINE.

  • LINE for iOS and Android: 8.11.0 and later

Box example

# Button

This component renders a button. When the user taps a button, a specified action is performed.

type

String

Required

button

action

Object

Required

Action performed when this button is tapped. Specify an action object.

flex

Number

Optional

The ratio of the width or height of this component within the parent box. For more information, see Width and height of components.

margin

String

Optional

Minimum space between this component and the previous component in the parent element. For more information, see margin property of the component in the API documentation.

position

String

Optional

Reference for offsetTop, offsetBottom, offsetStart, and offsetEnd. Specify one of the following values:

  • relative: Use the previous box as reference.
  • absolute: Use the top left of parent element as reference.

The default value is relative. For more information, see Offset in the API documentation.

offsetTop

String

Optional

The top offset. For more information, see Offset in the API documentation.

offsetBottom

String

Optional

The bottom offset. For more information, see Offset in the API documentation.

offsetStart

String

Optional

The left offset. For more information, see Offset in the API documentation.

offsetEnd

String

Optional

The right offset. For more information, see Offset in the API documentation.

height

String

Optional

Height of the button. You can specify sm or md. The default value is md.

style

String

Optional

Style of the button. Specify one of the following values:

  • primary: Style for dark color buttons
  • secondary: Style for light color buttons
  • link: HTML link style

The default value is link.

color

String

Optional

Character color when the style property is link. Background color when the style property is primary or secondary. Use a hexadecimal color code.

gravity

String

Optional

Alignment style in vertical direction. For more information, see Alignment in vertical direction in the API documentation.

Button example

# Image

This component renders an image.

type

String

Required

image

url

String

Required

Image URL
Protocol: HTTPS over TLS 1.2 or later
Image format: JPEG or PNG
Maximum image size: 1024×1024 pixels
Maximum data size: 1 MB

flex

Number

Optional

The ratio of the width or height of this component within the parent box. For more information, see Width and height of components.

margin

String

Optional

Minimum space between this component and the previous component in the parent element. For more information, see margin property of the component in the API documentation.

position

String

Optional

Reference for offsetTop, offsetBottom, offsetStart, and offsetEnd. Specify one of the following values:

  • relative: Use the previous box as reference.
  • absolute: Use the top left of parent element as reference.

The default value is relative. For more information, see Offset in the API documentation.

offsetTop

String

Optional

The top offset. For more information, see Offset in the API documentation.

offsetBottom

String

Optional

The bottom offset. For more information, see Offset in the API documentation.

offsetStart

String

Optional

The left offset. For more information, see Offset in the API documentation.

offsetEnd

String

Optional

The right offset. For more information, see Offset in the API documentation.

align

String

Optional

Alignment style in horizontal direction. For more information, see Alignment in horizontal direction in the API documentation.

gravity

String

Optional

Alignment style in vertical direction. For more information, see Alignment in vertical direction in the API documentation.

size

String

Optional

Maximum size of the image width. You can specify one of the following values: xxs, xs, sm, md, lg, xl, xxl, 3xl, 4xl, 5xl, or full. The size increases in the order of listing. The default value is md.

aspectRatio

String

Optional

Aspect ratio of the image. {width}:{height} format. Specify the value of {width} and {height} in the range from 1 to 100000. However, you cannot set {height} to a value that is more than three times the value of {width}. The default value is 1:1.

aspectMode

String

Optional

The display style of the image if the aspect ratio of the image and that specified by the aspectRatio property do not match. For more information, see About the drawing area.

backgroundColor

String

Optional

Background color of the image. Use a hexadecimal color code.

action

Object

Optional

Action performed when this image is tapped. Specify an action object.

Image example

# About the drawing area

Specify the max width of the image with the size property and the aspect ratio (horizontal-to-vertical ratio) of the image with the aspectRatio property. The rectangular area determined by the size and aspectRatio properties is called the drawing area. The image is rendered in this drawing area.

  • If the image width specified by the flex property is larger than that calculated from the size property, the width of the drawing area is scaled down to the width of the component.
  • If the aspect ratio of the image and that specified by the aspectRatio property do not match, the image is displayed according to the aspectMode property. The default value is fit.
    • If the value of aspectMode is cover: The image fills the entire drawing area. Parts of the image that do not fit in the drawing area are not displayed.
    • If the value of aspectMode is fit: The entire image is displayed in the drawing area. A background is displayed in the unused areas to the left and right of vertical images and in the areas above and below horizontal images.
# Icon

This component renders an icon for decorating the adjacent text.

This component can be used only in a baseline box.

type

String

Required

icon

url

String

Required

Image URL
Protocol: HTTPS over TLS 1.2 or later
Image format: JPEG or PNG
Maximum image size: 1024×1024 pixels
Maximum data size: 1 MB

margin

String

Optional

Minimum space between this component and the previous component in the parent element. For more information, see margin property of the component in the API documentation.

position

String

Optional

Reference for offsetTop, offsetBottom, offsetStart, and offsetEnd. Specify one of the following values:

  • relative: Use the previous box as reference.
  • absolute: Use the top left of parent element as reference.

The default value is relative. For more information, see Offset in the API documentation.

offsetTop

String

Optional

The top offset. For more information, see Offset in the API documentation.

offsetBottom

String

Optional

The bottom offset. For more information, see Offset in the API documentation.

offsetStart

String

Optional

The left offset. For more information, see Offset in the API documentation.

offsetEnd

String

Optional

The right offset. For more information, see Offset in the API documentation.

size

String

Optional

Maximum size of the icon width. You can specify one of the following values: xxs, xs, sm, md, lg, xl, xxl, 3xl, 4xl, or 5xl. The size increases in the order of listing. The default value is md.

aspectRatio

String

Optional

Aspect ratio of the icon. {width}:{height} format. The values of {width} and {height} must be in the range 1–100000. {height} can't be more than three times the value of {width}. The default value is 1:1.

The icon's flex property is fixed to 0.

Icon example

# Text

This component renders a text string in one row. You can specify font color, size, and weight.

type

String

Required

text

text

String

Required

Text Be sure to set either one of the text property or contents property. If you set the contents property, text is ignored.

contents

Array of objects

Optional

Array of spans. Be sure to set either one of the text property or contents property. If you set the contents property, text is ignored.

flex

Number

Optional

The ratio of the width or height of this component within the parent box. For more information, see Width and height of components.

margin

String

Optional

Minimum space between this component and the previous component in the parent element. For more information, see margin property of the component in the API documentation.

position

String

Optional

Reference for offsetTop, offsetBottom, offsetStart, and offsetEnd. Specify one of the following values:

  • relative: Use the previous box as reference.
  • absolute: Use the top left of parent element as reference.

The default value is relative. For more information, see Offset in the API documentation.

offsetTop

String

Optional

The top offset. For more information, see Offset in the API documentation.

offsetBottom

String

Optional

The bottom offset. For more information, see Offset in the API documentation.

offsetStart

String

Optional

The left offset. For more information, see Offset in the API documentation.

offsetEnd

String

Optional

The right offset. For more information, see Offset in the API documentation.

size

String

Optional

Font size. You can specify one of the following values: xxs, xs, sm, md, lg, xl, xxl, 3xl, 4xl, or 5xl. The size increases in the order of listing. The default value is md.

align

String

Optional

Alignment style in horizontal direction. For more information, see Alignment in horizontal direction in the API documentation.

gravity

String

Optional

Alignment style in vertical direction. The default value is top. For more information, see Alignment in vertical direction in the API documentation.

wrap

Boolean

Optional

true to wrap text. The default value is false. If set to true, you can use a new line character (\n) to begin on a new line. For more information, see Wrapping text in the API documentation.

maxLines

Number

Optional

Max number of lines. If the text does not fit in the specified number of lines, an ellipsis (…) is displayed at the end of the last line. If set to 0, all the text is displayed. The default value is 0. This property is supported on the following versions of LINE.

  • LINE for iOS and Android: 8.11.0 and later

weight

String

Optional

Font weight. You can specify one of the following values: regular or bold. Specifying bold makes the font bold. The default value is regular.

color

String

Optional

Font color. Use a hexadecimal color code.

action

Object

Optional

Action performed when this image is tapped. Specify an action object.

style

String

Optional

Style of the text. Specify one of the following values:

  • normal: Normal
  • italic: Italic

The default value is normal.

decoration

String

Optional

Decoration of the text. Specify one of the following values:

  • none: No decoration
  • underline: Underline
  • line-through: Strikethrough

The default value is none.

Text example

# Span

This component renders multiple text strings with different designs in one row. You can specify the color, size, weight, and decoration for the font. Span is set to contents property in Text.

type

String

Required

span

text

String

Required

Text. If the wrap property of the parent text is set to true, you can use a new line character (\n) to begin on a new line.

color

String

Optional

Font color. Use a hexadecimal color code.

size

String

Optional

Font size. You can specify one of the following values: xxs, xs, sm, md, lg, xl, xxl, 3xl, 4xl, or 5xl. The size increases in the order of listing. The default value is md.

weight

String

Optional

Font weight. You can specify one of the following values: regular or bold. Specifying bold makes the font bold. The default value is regular.

style

String

Optional

Style of the text. Specify one of the following values:

  • normal: Normal
  • italic: Italic

The default value is normal.

decoration

String

Optional

Decoration of the text. Specify one of the following values:

  • none: No decoration
  • underline: Underline
  • line-through: Strikethrough

The default value is none.
Note: The decoration set in the decoration property of the text cannot be overwritten by the decoration property of the span.

Span example

# Separator

This component renders a separating line within a box. A vertical line will be rendered in a horizontal box and a horizontal line will be rendered in a vertical box.

type

String

Required

separator

margin

String

Optional

Minimum space between this component and the previous component in the parent element. For more information, see margin property of the component in the API documentation.

color

String

Optional

Color of the separator. Use a hexadecimal color code.

Separator example

# Filler

This component is used to create a space. You can put a space between, before, or after components by inserting a filler anywhere within a box.

type

String

Required

filler

flex

Number

Optional

The ratio of the width or height of this component within the parent box. For more information, see Width and height of components.

The spacing property of the parent element will be ignored for fillers.

Filler example

# Spacer (not recommended)
Note

The spacer will be removed in a future release. We recommend setting the padding of the box without using a spacer. For more information, see Box padding in the API documentation.

This is an invisible component that places a fixed-size space at the beginning or end of the box.

type

String

Required

spacer

size

String

Required

Size of the space. You can specify one of the following values: xs, sm, md, lg, xl, or xxl. The size increases in the order of listing. The default value is md.

The spacing property of the parent element will be ignored for spacers.

Spacer example

Issues a link token used for the account link feature.

Example request

# HTTP request

POST https://api.line.me/v2/bot/user/{userId}/linkToken

# Request headers

Authorization

Bearer {channel access token}

# Path parameters

userId

Required

User ID for the LINE account to be linked. Found in the source object of account link event objects. Do not use the LINE ID used in LINE.

# Response

Returns status code 200 and a link token. Link tokens are valid for 10 minutes and can only be used once.

Note: The validity period may change without notice.

Example response

# Action objects

These are types of actions for your bot to take when a user taps a button or an image in a message.

# Postback action

When a control associated with this action is tapped, a postback event is returned via webhook with the specified string in the data property.

type

String

Required

postback

label

String

Label for the action

  • Required for templates other than image carousel. Max character limit: 20
  • Optional for image carousel templates. Max character limit: 12
  • Optional for rich menus. Spoken when the accessibility feature is enabled on the client device. Max character limit: 20. Supported on LINE 8.2.0 and later for iOS.
  • Required for quick reply buttons. Max character limit: 20. Supported on LINE 8.11.0 and later for iOS and Android.
  • Required for the button of Flex Message. This property can be specified for the box, image, and text but its value is not displayed. Max character limit: 20

data

String

Required

String returned via webhook in the postback.data property of the postback event
Max character limit: 300

displayText

String

Text displayed in the chat as a message sent by the user when the action is performed. Required for quick reply buttons. Optional for the other message types.
Max character limit: 300
The displayText and text properties cannot both be used at the same time.

text

String

Optional

【Deprecated】 Text displayed in the chat as a message sent by the user when the action is performed. Returned from the server through a webhook. This property shouldn't be used with quick reply buttons.
Max character limit: 300
The displayText and text properties cannot both be used at the same time.

Example postback action object

# Message action

When a control associated with this action is tapped, the string in the text property is sent as a message from the user.

type

String

Required

message

label

String

Label for the action

  • Required for templates other than image carousel. Max character limit: 20
  • Optional for image carousel templates. Max character limit: 12
  • Optional for rich menus. Spoken when the accessibility feature is enabled on the client device. Max character limit: 20. Supported on LINE 8.2.0 and later for iOS.
  • Required for quick reply buttons. Max character limit: 20. Supported on LINE 8.11.0 and later for iOS and Android.
  • Required for the button of Flex Message. This property can be specified for the box, image, and text but its value is not displayed. Max charater limit: 20

text

String

Required

Text sent when the action is performed
Max character limit: 300

Example message action object

# URI action

When a control associated with this action is tapped, the URI specified in the uri property is opened.

type

String

Required

uri

label

String

Label for the action

  • Required for templates other than image carousel. Max character limit: 20
  • Optional for image carousel templates. Max character limit: 12
  • Optional for rich menus. Spoken when the accessibility feature is enabled on the client device. Max character limit: 20. Supported on LINE 8.2.0 and later for iOS.
  • Required for the button of Flex Message. This property can be specified for the box, image, and text but its value is not displayed. Max character limit: 20

uri

String

Required

URI opened when the action is performed (Max character limit: 1000)
The available schemes are http, https, line, and tel. For more information about the LINE URL scheme, see Using LINE features with the LINE URL scheme.

altUri.desktop

String

Optional

URI opened on LINE for macOS and Windows when the action is performed (Max character limit: 1000)
If the altUri.desktop property is set, the uri property is ignored on LINE for macOS and Windows.
The available schemes are http, https, line, and tel. For more information about the LINE URL scheme, see Using LINE features with the LINE URL scheme. This property is supported on the following version of LINE.

  • LINE 5.12.0 or later for macOS and Windows

Note: The altUri.desktop property is supported only when you set URI actions in Flex Messages.

Example URI action object

# Datetime picker action

When a control associated with this action is tapped, a postback event is returned via webhook with the date and time selected by the user from the date and time selection dialog. The datetime picker action does not support time zones.

type

String

Required

datetimepicker

label

String

Label for the action

  • Required for templates other than image carousel. Max character limit: 20
  • Optional for image carousel templates. Max character limit: 12
  • Optional for rich menus. Spoken when the accessibility feature is enabled on the client device. Max character limit: 20. Supported on LINE 8.2.0 and later for iOS.
  • Required for quick reply buttons. Max character limit: 20. Supported on LINE 8.11.0 and later for iOS and Android.
  • Required for the button of Flex Message. This property can be specified for the box, image, and text but its value is not displayed. Max character limit: 20

data

String

Required

String returned via webhook in the postback.data property of the postback event
Max character limit: 300

mode

String

Required

Action mode
date: Pick date
time: Pick time
datetime: Pick date and time

initial

String

Optional

Initial value of date or time

max

String

Optional

Largest date or time value that can be selected. Must be greater than the min value.

min

String

Optional

Smallest date or time value that can be selected. Must be less than the max value.

Example datetime picker action object

# Date and time format

The date and time formats for the initial, max, and min values are shown below. The full-date, time-hour, and time-minute formats follow the RFC3339 protocol.

Mode Format Example
date full-date
Max: 2100-12-31
Min: 1900-01-01
2017-06-18
time time-hour:time-minute
Max: 23:59
Min: 00:00
00:00
06:15
23:59
datetime full-dateTtime-hour:time-minute or full-datettime-hour:time-minute
Max: 2100-12-31T23:59
Min: 1900-01-01T00:00
2017-06-18T06:15
2017-06-18t06:15

# Camera action

This action can be configured only with quick reply buttons. When a button associated with this action is tapped, the camera screen in LINE is opened.

type

String

Required

camera

label

String

Required

Label for the action
Max character limit: 20

Example camera action object

# Camera roll action

This action can be configured only with quick reply buttons. When a button associated with this action is tapped, the camera roll screen in LINE is opened.

type

String

Required

cameraRoll

label

String

Required

Label for the action
Max character limit: 20

Example camera roll action object

# Location action

This action can be configured only with quick reply buttons. When a button associated with this action is tapped, the location screen in LINE is opened.

type

String

Required

location

label

String

Required

Label for the action
Max character limit: 20

Example location action object

# Rich menu structure

Rich menus consist of either of these objects.

Area objects and action objects are included in these objects.

# Rich menu object

size

Object

Required

size object which contains the width and height of the rich menu displayed in the chat. Rich menu images must be one of the following sizes (pixels): 2500x1686, 2500x843, 1200x810, 1200x405, 800x540, 800x270

selected

Boolean

Required

true to display the rich menu by default. Otherwise, false.

name

String

Required

Name of the rich menu. This value can be used to help manage your rich menus and is not displayed to users.
Max character limit: 300

chatBarText

String

Required

Text displayed in the chat bar
Max character limit: 14

areas

Array

Required

Array of area objects which define the coordinates and size of tappable areas
Max: 20 area objects

Example rich menu object

# Rich menu response object

richMenuId

String

ID of a rich menu

size

Object

size object which contains the width and height of the rich menu displayed in the chat. Rich menu images must be one of the following sizes (pixels): 2500x1686, 2500x843, 1200x810, 1200x405, 800x540, 800x270

selected

Boolean

true to display the rich menu by default. Otherwise, false.

name

String

Name of the rich menu. This value can be used to help manage your rich menus and is not displayed to users.
Max character limit: 300

chatBarText

String

Text displayed in the chat bar
Max character limit: 14

areas

Array

Array of area objects which define the coordinates and size of tappable areas
Max: 20 area objects

Example rich menu response object

# size object

width

Number

Required

Width of the rich menu. Must be 2500.

height

Number

Required

Height of the rich menu. Possible values: 1686, 843.

Example size object

# Area object

bounds

Object

Required

Object describing the boundaries of the area in pixels. See bounds object.

action

Object

Required

Action performed when the area is tapped. See action objects.

Example area object

# bounds object

x

Number

Required

Horizontal position of the top-left corner of the tappable area relative to the left edge of the image. Value must be 0 or higher.

y

Number

Required

Vertical position of the top-left corner of the tappable area relative to the left edge of the image. Value must be 0 or higher.

width

Number

Required

Width of the tappable area.

height

Number

Required

Height of the tappable area.

Example bounds object