# LINE notification messages API reference
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)
- Get number of sent 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.
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).
# HTTP request
POST https://api.line.me/v2/bot/message/pnp/templated/push
# Rate limit
2,000 requests per second
# Request headers
The LINE notification messages API doesn't allow API request retries using retry keys (X-Line-Retry-Key
).
Content-Type
application/json
Authorization
Bearer {channel access token}
X-Line-Delivery-Tag
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
# Request body
to
String
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.
- You can't specify group chats or multi-person chats.
- You can't specify multiple phone numbers as the transmission target.
templateKey
String
Specify the Key
of the template you want to send.
See Templates for available Key
.
body
Object
body.emphasizedItem
Object
Specify the item you want to emphasize in the message.
Max number of objects: 1
body.items
Array of objects
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
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
Specify the Key
of the item you want to include.
See Items for available Key
.
content
String
Specify the string to be displayed as the value of the item.
Max number of characters: 15 for body.emphasizedItem
, 300 for body.items
# Buttons
buttonKey
String
Specify the Key
of the button you want to include.
See Buttons for available Key
.
url
String
Specify the URL of the page to be opened when the user presses the button.
Max number of characters: 1000
# Response
# Error response
Returns the following HTTP status code and an error response:
Code | Description |
---|---|
400 | Problem with the request. Consider these reasons:
|
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.
# 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.
# HTTP request
GET https://api.line.me/v2/bot/message/delivery/pnp/templated
# Rate limit
2,000 requests per second
# Request header
Authorization
Bearer {channel access token}
# Query parameter
date
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 indate
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 indate
is before the aggregation system operation's start date (03/31/2018).
success
Number
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
.
# Error response
Returns the following HTTP status code and an error response:
Code | Description |
---|---|
400 | Problem with the request. Consider these reasons:
|
For more information, see Status codes and Error responses in the Messaging API reference.
# LINE notification messages (flexible)
- Send a LINE notification message (flexible)
- Get number of sent 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.
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.
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).
# HTTP request
POST https://api.line.me/bot/pnp/push
# Rate limit
2,000 requests per second
# Request header
The LINE notification messages API doesn't allow API request retries using retry keys (X-Line-Retry-Key
).
Content-Type
application/json
Authorization
Bearer {channel access token}
X-Line-Delivery-Tag
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
# Request body
to
String
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.
- You can't specify group chats and chats with multiple users.
- You can't specify multiple phone numbers as the transmission target.
messages
Array of message objects
Message to be sent. Max: 5
For more information, see Message types that can be sent in LINE notification messages.
# Response
# Error response
Returns the following HTTP status code and an error response:
Code | Description |
---|---|
400 | Problem with the request. Consider these reasons:
|
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.
# 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.
# HTTP request
GET https://api.line.me/v2/bot/message/delivery/pnp
# Rate limit
2,000 requests per second
# Request header
Authorization
Bearer {channel access token}
# Query parameter
date
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 indate
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 indate
is before the aggregation system operation's start date (03/31/2018).
success
Number
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
.
# Error response
Returns the following HTTP status code and an error response:
Code | Description |
---|---|
400 | Problem with the request. Consider these reasons:
|
For more information, see Status codes and Error responses in the Messaging API reference.