# LINE notification messages API reference

Use of optional functions requires an application

Only corporate users who have submitted the required applications can use the functions described in this document. To use these functions with your LINE Official Account, contact your sales representative or contact our Sales partners (opens new window).

# Common specifications

# Status codes

For more information, see Status codes in the Messaging API reference.

# Response headers

The following HTTP headers are included in LINE notification messages API responses:

Response header Description
x-line-request-id Request ID. An ID is issued for each request.

# LINE notification messages (template)

# Send a LINE notification message (template)

API for sending a LINE notification message (template) by specifying the user's phone number.

For more information, see LINE notification messages (template) in the LINE notification messages documentation.

Restrictions on request source IP addresses

When sending LINE notification messages, don't register the IP address of the server that can call the API of the LINE Platform in the [Security Settings] tab of the Messaging API channel. Sending a LINE notification message with the requestor's IP address restricted may result in sending failure. For more information on how to set it up, see Restrict who can call the API when using a long-lived channel access token (optional).

Example request

# HTTP request

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

# Rate limit

2,000 requests per second

# Request headers

Unsupported features

The LINE notification messages API doesn't allow API request retries using retry keys (X-Line-Retry-Key).

Content-Type

Required

application/json

Authorization

Required

Bearer {channel access token}

X-Line-Delivery-Tag

Optional

String returned in the delivery.data property of the delivery completion event via webhook. For more information, see Get message delivery notifications.
Minimum character count: 16
Max character count: 100

Example X-Line-Delivery-Tag

# Request body

to

String

Required

Message destination. Specify a phone number that has been normalized to E.164 format and hashed with SHA256.

For more information about conditions for sending a message, see Conditions for sending LINE notification messages.

Note

templateKey

String

Required

Specify the Key of the template you want to send.

See Templates for available Key.

body

Object

Required

The body object of the template you want to send. Specify the content of the message with three objects. You can't specify the same item more than once in a single message.

  • emphasizedItem: The item to emphasize.
  • items: The array of items.
  • buttons: The array of buttons.

body.emphasizedItem

Object

Optional

Specify the item you want to emphasize in the message.
Max number of objects: 1

body.items

Array of objects

Optional

Specify the array of items you want to include in the message.
Min number of objects: 0
Max number of objects: 15

body.buttons

Array of objects

Optional

Specify the array of buttons you want to include in the message.
Min number of objects: 0
Max number of objects: 2

# Items

itemKey

String

Required

Specify the Key of the item you want to include.

See Items for available Key.

content

String

Required

Specify the string to be displayed as the value of the item.
Max number of characters: 15 for body.emphasizedItem, 300 for body.items

Example item

# Buttons

buttonKey

String

Required

Specify the Key of the button you want to include.

See Buttons for available Key.

url

String

Required

Specify the URL of the page to be opened when the user presses the button.
Max number of characters: 1000

Example button

# Response

Returns status code 202 and an empty JSON object.

Example response

# Error response

Returns the following HTTP status code and an error response:

Code Description
400 Problem with the request. Consider these reasons:
  • An invalid message destination is specified.
  • An invalid message object is specified.
  • Your LINE Official Account can't use the specified template.
403 Not authorized to use this endpoint.
422 Failed to send a LINE notification message using the LINE notification messages API. Consider these reasons:

For more information, see Status codes and Error responses in the Messaging API reference.

Example error response

# Get number of sent LINE notification messages (template)

Gets the number of LINE notification messages (template) sent using the Send a LINE notification message (template) endpoint.

For more information, see Get the number of sent LINE notification messages in the LINE notification messages documentation.

Example request

# HTTP request

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

# Rate limit

2,000 requests per second

# Request header

Authorization

Required

Bearer {channel access token}

# Query parameter

date

Required

Date the message was sent

  • Format: yyyyMMdd (Example:20240916)
  • Time zone: UTC+9

# Response

Returns status code 200 and a JSON object with this information.

status

String

Aggregation processing status. One of:

  • ready: You can get the number of messages.
  • unready: The total number of messages for the date specified in date isn't yet complete. Try the request again after a short time. The aggregation process is usually completed within the next day.
  • out_of_service: The date specified in date is before the aggregation system operation's start date (03/31/2018).

success

Number

Not always included

Number of messages sent using the LINE notification messages API on the date specified in date. Only included in the response if the value of status is ready.

Example response

# Error response

Returns the following HTTP status code and an error response:

Code Description
400 Problem with the request. Consider these reasons:
  • An invalid date is specified.
  • The date is not specified.

For more information, see Status codes and Error responses in the Messaging API reference.

Example error response

# LINE notification messages (flexible)

# Send a LINE notification message (flexible)

API for sending a LINE notification message (flexible) by specifying the user's phone number.

The name of the existing "LINE notification messages" has been changed to "LINE notification messages (flexible)"

A new feature called "LINE notification messages (template)" has been added, allowing you to easily create messages by combining premade templates, items, etc.

Consequently, the previous "LINE notification messages" that required UX review have been renamed "LINE notification messages (flexible)".

For more information, see the notice for corporate customers from June 2, 2025, LINE notification messages (template) now available.

Restrictions on request source IP addresses

When sending LINE notification messages, don't register the IP address of the server that can call the API of the LINE Platform in the [Security Settings] tab of the Messaging API channel. Sending a LINE notification message with the requestor's IP address restricted may result in sending failure. For more information on how to set it up, see Restrict who can call the API when using a long-lived channel access token (optional).

Example request

# HTTP request

POST https://api.line.me/bot/pnp/push

# Rate limit

2,000 requests per second

# Request header

Unsupported features

The LINE notification messages API doesn't allow API request retries using retry keys (X-Line-Retry-Key).

Content-Type

Required

application/json

Authorization

Required

Bearer {channel access token}

X-Line-Delivery-Tag

Optional

String returned in the delivery.data property of the delivery completion event via Webhook. For more information, see Get message delivery notifications.
Minimum character count: 16
Max character count: 100

Example X-Line-Delivery-Tag

# Request body

to

String

Required

Message destination. Specify a phone number that has been normalized to E.164 format and hashed with SHA256.

For more information about conditions for sending a message, see Conditions for sending LINE notification messages.

Note

messages

Required

Message to be sent. Max: 5

For more information, see Message types that can be sent in LINE notification messages.

# Response

Returns status code 200 and an empty JSON object.

Example response

# Error response

Returns the following HTTP status code and an error response:

Code Description
400 Problem with the request. Consider these reasons:
  • An invalid message destination is specified.
  • An invalid message object is specified.
422 Failed to send a LINE notification message using the LINE notification messages API. Consider these reasons:

For more information, see Status codes and Error responses in the Messaging API reference.

Example error response

# Get number of sent LINE notification messages (flexible)

Gets the number of LINE notification messages (flexible) sent using the Send a LINE notification message (flexible) endpoint.

For more information, see Get the number of sent LINE notification messages in the LINE notification messages documentation.

Example request

# HTTP request

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

# Rate limit

2,000 requests per second

# Request header

Authorization

Required

Bearer {channel access token}

# Query parameter

date

Required

Date the message was sent

  • Format: yyyyMMdd (Example:20211231)
  • Time zone: UTC+9

# Response

Returns status code 200 and a JSON object with this information.

status

String

Aggregation processing status. One of:

  • ready: You can get the number of messages.
  • unready: The total number of messages for the date specified in date isn't yet complete. Try the request again after a short time. The aggregation process is usually completed within the next day.
  • out_of_service: The date specified in date is before the aggregation system operation's start date (03/31/2018).

success

Number

Not always included

Number of messages sent using the LINE notification messages API on the date specified in date. Only included in the response if the value of status is ready.

Example response

# Error response

Returns the following HTTP status code and an error response:

Code Description
400 Problem with the request. Consider these reasons:
  • An invalid date is specified.
  • The date is not specified.

For more information, see Status codes and Error responses in the Messaging API reference.

Example error response