LINE API
createLineMessage
Anchor link toUsed to send LINE messages to users
POST
https://api.pushwoosh.com/json/1.3/createLineMessage
Send a textual message
Anchor link toSimple LINE messages that consist only of plain text, without images or buttons. Learn more
Tip: For advanced formatting and rich media, use message templates like Flex, image, or carousel.
Request body
Anchor link toParameter | Type | Required | Description |
---|---|---|---|
application | string | Yes | Pushwoosh application code |
auth | string | Yes | API access token for authenticating the request. |
notifications | array of objects | Yes | List of LINE message objects to be sent. |
content | string | Yes | Text of the LINE message to be sent. Max character limit: 5000. Note: If both preset and content are included, the value from the request overrides the preset . |
preset | string | No | Code of the LINE preset you created in the Pushwoosh Control Panel. Note: If both preset and content are included, the value from the request overrides the preset . |
send_date | string | Yes | Date and time to send the message. Use format YYYY-MM-DD HH:mm or now to send immediately. |
devices | array of strings | Yes | List of device codes (user IDs) to send the LINE message to. |
{ "request": { "application": "XXXXXX-XXXXXX", "auth": "**************************************",, "notifications": [ { "content": "test", "preset": "preset_code", "send_date":"now", "devices": ["XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"] } ] }}
Send an image message
Anchor link toYou can send an image message to LINE users by specifying an image object within the template field of your request.
Each image message requires two image URLs: one for the full-size image (image_url) and another for the preview (preview_image_url). When users tap the preview, the full-size image opens. Make sure both URLs use HTTPS (TLS 1.2 or later) and link to publicly accessible image files.
For details, see the Image Message section in the LINE Messaging API documentation.
Request body
Anchor link toParameter | Type | Required | Description |
---|---|---|---|
application | string | Yes | Pushwoosh application code |
auth | string | Yes | API access token used to authenticate the request. |
notifications | array of objects | Yes | List of messages to send. |
content | string | Yes | Used as fallback or preview text for the message. Code of the LINE preset you created in the Pushwoosh Control Panel. Note: If both preset and template are included, the template from the request is used.If both preset and content are included, the content from the request overrides the preset. |
send_date | string | Yes | Date and time to send the message. Use format YYYY-MM-DD HH:mm or now to send immediately. |
devices | array of strings | Yes | List of device codes (user IDs) to send the LINE message to. |
preset | string | No | Code of the LINE preset you created in the Pushwoosh Control Panel. Note: If both preset and template parameters are included in the request, the values from the template will override those defined in the preset.If both preset and content are included in the same request, the content provided directly in the request will override the content from the preset . |
template | object | Yes | Message layout template. Supports multiple message types. See details below. |
Template parameters
Anchor link toType: image
Parameter | Type | Required | Description |
---|---|---|---|
image_url | string | Yes | URL to the full-size image (must use HTTPS). Max length: 2000 characters. Format: JPEG, PNG. Max size: 10 MB. |
preview_image_url | string | Yes | URL to the preview image shown in chat (must use HTTPS). Max length: 2000 characters. Format: JPEG, PNG. Max size: 1 MB. |
Example request
Anchor link to{ "request": { "application": "XXXXXX-XXXXXX", "auth": "**************************************", "notifications": [ { "content": "test", "send_date": "now", "devices": [ "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" ], "preset": "preset_code", "template": { "en": { "image": { "alt_text": "some text", "image_url": "https://images.com/1.jpg", "preview_image_url": "https://images.com/1.png" } } } } ] }}
Send an image carousel message
Anchor link toImage carousel messages let you display multiple images in a horizontally scrollable format. Each image appears as a separate, non-clickable column that users can swipe through in the LINE chat interface.
This format is ideal for showcasing items, promotions, or visual selections in an engaging way.
For details, refer to the Image Carousel Template section in the LINE Messaging API documentation.
Request body
Anchor link toParameter | Type | Required | Description |
---|---|---|---|
application | string | Yes | Pushwoosh application code |
auth | string | Yes | API access token used to authenticate the request. |
notifications | array of objects | Yes | List of messages to send. |
content | string | Yes | Used as fallback or preview text for the message. Note: If both content and template are set, the template is used.If both a preset and content are included in the same request, the content provided directly in the request will override the content from the preset . |
send_date | string | Yes | Date and time to send the message. Use the format YYYY-MM-DD HH:mm or "now" . |
devices | array of strings | Yes | List of device codes (user IDs) to send the LINE message to. |
preset | string | No | Code of the LINE preset you created in the Pushwoosh Control Panel. Note: If both preset and template parameters are included in the request, the values from the template will override those defined in the preset .If both a preset and content are included in the same request, the content provided directly in the request will override the content from the preset . |
template | object | Yes | Message layout template. Supports multiple message types. See details below. |
Template parameters
Anchor link toType: image_carousel
Parameter | Type | Required | Description |
---|---|---|---|
alt_text | string | Yes | Fallback text displayed in push previews and on unsupported devices. Max 400 characters. |
columns | array of objects | Yes | Array of image columns (1–10 supported). Each column includes an image. |
image_url | string | Yes | URL to the image shown in each carousel column pointing to a publicly accessible JPEG or PNG file. Must use HTTPS. |
Example request
Anchor link to{ "request": { "application": "XXXXXX-XXXXXX", "auth": "**************************************", "notifications": [ { "content": "test", "send_date": "now", "devices": [ "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" ], "preset": "preset_code", "template": { "en": { "image_carousel": { "alt_text": "some text", "columns": [ { "image_url": "https://images.com/1.jpg" }, { "image_url": "https://images.com/2.jpg" }, { "image_url": "https://images.com/3.jpg" } ] } } } } ] }}
Send a Flex message
Anchor link toFlex Messages are powerful, customizable message types that allow you to create structured layouts using text, images, buttons, and other components. They are ideal for use cases such as receipts, product cards, menus, or any content that benefits from visual structuring.
To send a Flex Message, include a template
object with a raw
payload inside your request. The message layout must follow the LINE Flex Message specification.
Tip: You can design and preview Flex Messages using the LINE Flex Message Simulator.
Request body
Anchor link toParameter | Type | Required | Description |
---|---|---|---|
application | string | Yes | Pushwoosh application code |
auth | string | Yes | API access token used to authenticate the request. |
notifications | array of objects | Yes | List of messages to send. |
content | string | Yes | Used as fallback or preview text for the message. Note: If both content and template are set, the template is used.If both preset and content are included, the content from the request overrides the preset. |
send_date | string | Yes | When to send the message. Use "now" or YYYY-MM-DD HH:mm format. |
devices | array of strings | Yes | List of LINE device tokens (user IDs) to receive the message. |
preset | string | No | Code of the LINE preset you created in the Pushwoosh Control Panel. Note: If both preset and template are included, the template overrides the preset.If both preset and content are included, the content from the request overrides the preset. |
template | object | Yes | Message layout template. Supports multiple message types. See details below. |
Template parameters
Anchor link toFor a Flex Message, use the raw structure.
Type: raw (Flex)
Parameter | Type | Required | Description |
---|---|---|---|
alt_text | string | Yes | Fallback text shown in notifications, chat previews, and quotes. Max 400 characters. |
content | object | Yes | Flex Message layout, structured using bubble , box , text , and other components as per LINE’s Flex specification. |
Example request
Anchor link to{ "request": { "application": "XXXXXX-XXXXXX", "auth": "**************************************", "notifications": [ { "content": "test", "send_date": "now", "devices": ["XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"], "preset": "preset_code", "template": { "en": { "raw": { "alt_text": "My raw template", "content": { "type": "bubble", "body": { "type": "box", "layout": "vertical", "contents": [ { "type": "text", "text": "RECEIPT", "weight": "bold", "color": "#1DB446", "size": "sm" } // Additional components... ] } } } } } } ] }}