Sending messages
Last updated
Was this helpful?
Last updated
Was this helpful?
The Channels API supports many of the features of Line; however, due to the omni-channel nature of the API, there may be some differences between the Channels API message and the native Line API.To send a Line message, you must have an active Line channel and perform an HTTP request to the following endpoint with a valid access key
When sending outbound messages as well as setting the receiver information you must set message body field in all cases
Body
{
"receiver": {
"contacts": [
{
"identifierValue": "U82767028f6ac7935be3c631e2993212b"
}
]
},
"body": {...}
}
You can send messages to users who have added your LINE Official Account as a friend or in group chats and multi-person chats that your LINE Official Account has joined. Additionally, you can send messages to users who have sent a message to your LINE Official Account within the past seven days.
The Channels API supports many of the features of Line; however, due to the omni-channel nature of the API, there may be some differences between the Channels API message and the native Line API. Here is an overview of the Line message types and Channels API message types:
text
image
audio / video
location
sticker
-
imagemap
-
template - buttons
template - confirm
-
template - carousel
template - image carousel
-
flex message
To include an emoji in a text message, specify the product ID and emoji ID within the text message object. Set the index
, productId
, and emojiId
properties, as shown in the example below. These properties can be found in text.metadata.line.emoji.items
. Refer to the official documentation for detailed LINE emoji definitions.
Text message with location request
You can send any outbound message as a reply to a previous message by setting the replyTo object as shown below. The replyTo.id should be set to the id of a received message and the replyTo.type should be set to "message".
{
"body": { ... },
"replyTo": {
"id": "<recievedmessageid>",
"type": "message"
}
}
/
{
"type": "text",
"text": {
"text": "Single text message"
}
}
{
"type": "text",
"text": {
"text": "$ line emoji",
"metadata": {
"line": {
"emoji": {
"items": [
{
"index": 0,
"productId": "5ac2213e040ab15980c9b447",
"emojiId": "001"
}
]
}
}
}
}
}
{
"type": "text",
"text": {
"text": "Single text message with reply actions",
"actions": [
{
"type": "reply",
"reply": {
"text": "Reply action 1"
}
},
{
"type": "reply",
"reply": {
"text": "Reply action 2"
}
}
]
}
}
{
"type": "text",
"text": {
"text": "Single text message with postback actions",
"actions": [
{
"type": "postback",
"postback": {
"text": "Postback action 1",
"payload": "postback-payload-1"
}
},
{
"type": "postback",
"postback": {
"text": "Postback action 2",
"payload": "postback-payload-2"
}
}
]
}
}
{
"type": "text",
"text": {
"text": "Single text message with reply and postback actions",
"actions": [
{
"type": "postback",
"postback": {
"text": "Postback action 1",
"payload": "postback-payload-1"
}
},
{
"type": "reply",
"reply": {
"text": "Reply action 1"
}
}
]
}
}
{
"type": "text",
"text": {
"text": "Single text message with location request",
"actions": [
{
"type": "locationRequest",
"locationRequest": {
"text": "Share location"
}
}
]
}
}
{
"type": "image",
"image": {
"images": [
{
"altText": "Label of first image",
"mediaUrl": "https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdnJZeZvhOMhDQA8SpjQM%2Fuploads%2FrEM9zztd8SEiJS6RQuR3%2Fimage.png?alt=media"
}
]
}
}
{
"type": "image",
"image": {
"images": [
{
"altText": "Label of first image",
"mediaUrl": "https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdnJZeZvhOMhDQA8SpjQM%2Fuploads%2FrEM9zztd8SEiJS6RQuR3%2Fimage.png?alt=media"
}
],
"text": "Single image message"
}
}
{
"type": "image",
"image": {
"images": [
{
"altText": "Label of first image",
"mediaUrl": "https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdnJZeZvhOMhDQA8SpjQM%2Fuploads%2FrEM9zztd8SEiJS6RQuR3%2Fimage.png?alt=media"
},
{
"altText": "Label of second image",
"mediaUrl": "https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdnJZeZvhOMhDQA8SpjQM%2Fuploads%2FRPPgQAGyZE7rvIh3WM2Z%2Fimage2.avif?alt=media"
}
],
"text": "Multiple images message"
}
}
{
"type": "image",
"image": {
"images": [
{
"altText": "Image label",
"mediaUrl": "https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdnJZeZvhOMhDQA8SpjQM%2Fuploads%2FrEM9zztd8SEiJS6RQuR3%2Fimage.png?alt=media"
}
],
"text": "Single image message with postback actions",
"actions": [
{
"type": "postback",
"postback": {
"payload": "postback-payload-1",
"text": "Postback option 1"
}
},
{
"postback": {
"payload": "postback-payload-2",
"text": "Postback option 2"
},
"type": "postback"
}
]
}
}
{
"type": "image",
"image": {
"images": [
{
"altText": "Image label",
"mediaUrl": "https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdnJZeZvhOMhDQA8SpjQM%2Fuploads%2FrEM9zztd8SEiJS6RQuR3%2Fimage.png?alt=media"
}
],
"text": "Single image message with reply actions",
"actions": [
{
"type": "reply",
"reply": {
"text": "Reply action 1"
}
},
{
"type": "reply",
"reply": {
"text": "Reply action 2"
}
}
]
}
}
{
"type": "image",
"image": {
"text": "Single image message with postback and reply actions",
"images": [
{
"mediaUrl": "https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdnJZeZvhOMhDQA8SpjQM%2Fuploads%2FrEM9zztd8SEiJS6RQuR3%2Fimage.png?alt=media",
"altText": "Image label"
}
],
"actions": [
{
"type": "postback",
"postback": {
"text": "Postback action",
"payload": "postback-payload"
}
},
{
"type": "reply",
"reply": {
"text": "Reply action"
}
}
]
}
}
{
"type": "image",
"image": {
"images": [
{
"altText": "First image label",
"mediaUrl": "https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdnJZeZvhOMhDQA8SpjQM%2Fuploads%2FrEM9zztd8SEiJS6RQuR3%2Fimage.png?alt=media"
},
{
"altText": "Second image label",
"mediaUrl": "https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdnJZeZvhOMhDQA8SpjQM%2Fuploads%2FRPPgQAGyZE7rvIh3WM2Z%2Fimage2.avif?alt=media"
}
],
"text": "Multiple images message with postback actions",
"actions": [
{
"type": "postback",
"postback": {
"payload": "postback-payload-1",
"text": "Postback action 1"
}
},
{
"postback": {
"payload": "postback-payload-2",
"text": "Postback action 2"
},
"type": "postback"
}
]
}
}
{
"type": "image",
"image": {
"images": [
{
"altText": "First image label",
"mediaUrl": "https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdnJZeZvhOMhDQA8SpjQM%2Fuploads%2FrEM9zztd8SEiJS6RQuR3%2Fimage.png?alt=media"
},
{
"altText": "Second image label",
"mediaUrl": "https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdnJZeZvhOMhDQA8SpjQM%2Fuploads%2FRPPgQAGyZE7rvIh3WM2Z%2Fimage2.avif?alt=media"
}
],
"text": "Multiple images message with reply actions",
"actions": [
{
"type": "reply",
"reply": {
"text": "Reply action 1"
}
},
{
"reply": {
"text": "Reply action 2"
},
"type": "reply"
}
]
}
}
{
"type": "image",
"image": {
"images": [
{
"altText": "First image label",
"mediaUrl": "https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdnJZeZvhOMhDQA8SpjQM%2Fuploads%2FrEM9zztd8SEiJS6RQuR3%2Fimage.png?alt=media"
},
{
"altText": "Second image label",
"mediaUrl": "https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdnJZeZvhOMhDQA8SpjQM%2Fuploads%2FRPPgQAGyZE7rvIh3WM2Z%2Fimage2.avif?alt=media"
}
],
"text": "Multiple images message with postback and reply actions",
"actions": [
{
"type": "postback",
"postback": {
"payload": "postback-payload",
"text": "Postback action"
}
},
{
"reply": {
"text": "Reply action"
},
"type": "reply"
}
]
}
}
{
"type": "file",
"file": {
"text": "Single file message",
"files": [
{
"contentType": "video/mp4",
"mediaUrl": "https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdnJZeZvhOMhDQA8SpjQM%2Fuploads%2FtXMQ4lIinia9ehf4EpC4%2Fvideo.mp4?alt=media"
}
]
}
}
{
"type": "file",
"file": {
"text": "Multiple files message",
"files": [
{
"contentType": "video/mp4",
"mediaUrl": "https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdnJZeZvhOMhDQA8SpjQM%2Fuploads%2FtXMQ4lIinia9ehf4EpC4%2Fvideo.mp4?alt=media"
},
{
"contentType": "application/pdf",
"mediaUrl": "https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdnJZeZvhOMhDQA8SpjQM%2Fuploads%2FbgnxOoaF4aHSHUzMFCna%2Faudio.mp3?alt=media"
}
]
}
}
{
"type": "location",
"location": {
"coordinates": {
"latitude": 52.37164323041201,
"longitude": 4.884335169232767
},
"location": {
"address": "Keizersgracht 268, 1016 EV, Amsterdam",
"label": "MessageBird Amsterdam office"
}
}
}
{
"type": "carousel",
"carousel": {
"items": [
{
"title": "Card 1",
"description": "First card",
"actions": [
{
"type": "reply",
"reply": {
"text": "reply"
}
},
{
"type": "postback",
"postback": {
"text": "postback",
"payload": "postback"
}
},
{
"type": "link",
"link": {
"url": "https://www.messagebird.com",
"text": "Visit MessageBird"
}
}
]
}
]
}
}
{
"type": "carousel",
"carousel": {
"items": [
{
"title": "Card 1",
"description": "First card",
"mediaUrl": "https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdnJZeZvhOMhDQA8SpjQM%2Fuploads%2FRPPgQAGyZE7rvIh3WM2Z%2Fimage2.avif?alt=media",
"actions": [
{
"type": "reply",
"reply": {
"text": "reply"
}
},
{
"type": "postback",
"postback": {
"text": "postback",
"payload": "postback"
}
},
{
"type": "link",
"link": {
"url": "https://www.bird.com",
"text": "Visit Bird"
}
}
]
}
]
}
}
{
"type": "carousel",
"carousel": {
"items": [
{
"title": "Card 1",
"description": "First card",
"actions": [
{
"type": "reply",
"reply": {
"text": "reply"
}
},
{
"type": "postback",
"postback": {
"text": "postback",
"payload": "postback"
}
},
{
"type": "link",
"link": {
"url": "https://www.bird.com",
"text": "Visit Bird"
}
}
]
},
{
"title": "Card 2",
"description": "Second card",
"actions": [
{
"type": "reply",
"reply": {
"text": "reply"
}
},
{
"type": "postback",
"postback": {
"text": "postback",
"payload": "postback"
}
},
{
"type": "link",
"link": {
"url": "https://www.bird.com",
"text": "Visit Bird"
}
}
]
},
{
"title": "Card 3",
"description": "Third card",
"actions": [
{
"type": "reply",
"reply": {
"text": "reply"
}
},
{
"type": "postback",
"postback": {
"text": "postback",
"payload": "postback"
}
},
{
"type": "link",
"link": {
"url": "https://www.bird.com",
"text": "Visit Bird"
}
}
]
}
]
}
}
{
"type": "carousel",
"carousel": {
"items": [
{
"title": "Card 1",
"description": "First card",
"mediaUrl": "https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdnJZeZvhOMhDQA8SpjQM%2Fuploads%2FRPPgQAGyZE7rvIh3WM2Z%2Fimage2.avif?alt=media",
"actions": [
{
"type": "reply",
"reply": {
"text": "reply"
}
},
{
"type": "postback",
"postback": {
"text": "postback",
"payload": "postback"
}
},
{
"type": "link",
"link": {
"url": "https://www.bird.com",
"text": "Visit Bird"
}
}
]
},
{
"title": "Card 2",
"description": "Second card",
"mediaUrl": "https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdnJZeZvhOMhDQA8SpjQM%2Fuploads%2FRPPgQAGyZE7rvIh3WM2Z%2Fimage2.avif?alt=media",
"actions": [
{
"type": "reply",
"reply": {
"text": "reply"
}
},
{
"type": "postback",
"postback": {
"text": "postback",
"payload": "postback"
}
},
{
"type": "link",
"link": {
"url": "https://www.bird.com",
"text": "Visit Bird"
}
}
]
}
]
}
}
{
"type": "list",
"list": {
"items": [
{
"actions": [
{
"type": "postback",
"postback": {
"payload": "postback-action-payload-1",
"text": "Postback action 1"
}
},
{
"type": "postback",
"postback": {
"payload": "postback-action-payload-2",
"text": "Postback action 2"
}
}
]
}
],
"title": "List title",
"altText": "List alt text",
"text": "List text"
}
}
{
"body": {
"type": "text",
"text": {
"text": "Single text message"
}
},
"replyTo": {
"id": "a7ff5a02-101e-437c-bfbe-b1a5f7e35dfb",
"type": "message"
}
}
Send a message to a channel
The ID of the workspace
The ID for a channel
curl -L \
--request POST \
--url '/workspaces/{workspaceId}/channels/{channelId}/messages' \
--header 'Authorization: Bearer jwt' \
--header 'Content-Type: application/json' \
--data '{
"sender": {
"connector": {
"identifierValue": "channels@bird.com",
"annotations": {
"name": "text"
}
}
},
"receiver": {
"contacts": [
{
"id": "a1405560-c8d3-4b1a-877d-3f449ad95352",
"identifierKey": "emailaddress",
"identifierValue": "channels@bird.com",
"type": "cc",
"identifiers": [
{
"identifierKey": "emailaddress",
"identifierValue": "channels@bird.com"
}
],
"platformAddress": "text",
"platformAddressSelector": "text"
}
]
},
"reference": "my-own-identifier",
"template": {
"name": "text",
"projectId": "a1405560-c8d3-4b1a-877d-3f449ad95352",
"version": "a1405560-c8d3-4b1a-877d-3f449ad95352",
"locale": "text",
"attachments": [
{
"mediaUrl": "https://example.com",
"filename": "text",
"inline": true
}
],
"shortLinks": {
"enabled": true,
"domain": "text"
},
"variables": {
"default": "text",
"ANY_ADDITIONAL_PROPERTY": "text"
},
"utmParameters": [
{
"key": "text",
"value": "text"
}
],
"parameters": [
{
"type": "string",
"key": "text",
"value": "text"
}
]
},
"meta": {
"extraInformation": {
"ANY_ADDITIONAL_PROPERTY": "anything"
},
"referral": {
"source": "text",
"title": "text",
"text": "text",
"group": "text",
"metadata": {
"source_id": "text",
"source_url": "text",
"media_url": "text",
"tracking_id": "text"
}
},
"order": {
"products": [
{
"externalCatalogId": "text",
"externalProductId": "text",
"quantity": 1,
"price": {
"amount": 1,
"exponent": 1,
"currencyCode": "text"
}
}
]
},
"referredProduct": {
"externalCatalogId": "text",
"externalProductId": "text"
},
"email": {
"subject": "text",
"headers": {
"ANY_ADDITIONAL_PROPERTY": "text"
},
"from": {
"username": "text",
"displayName": "text"
}
},
"pushNotifications": {
"gatewayTypeOverride": "apns"
},
"navigatorId": "123e4567-e89b-12d3-a456-426614174000",
"navigatorMessageId": "123e4567-e89b-12d3-a456-426614174000",
"flow": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "text",
"stepId": "text",
"runId": "123e4567-e89b-12d3-a456-426614174000"
},
"journey": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "text",
"stepId": "text",
"runId": "123e4567-e89b-12d3-a456-426614174000"
},
"campaign": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "text"
}
},
"replyTo": {
"id": "text",
"order": 1,
"type": "message"
},
"body": {
"type": "text",
"text": {
"text": "text",
"attachments": [
{
"mediaUrl": "https://example.com",
"filename": "text",
"inline": true
}
],
"actions": [
{
"type": "link",
"link": {
"text": "text",
"url": "text"
}
}
],
"metadata": {
"subject": "text",
"headers": {
"ANY_ADDITIONAL_PROPERTY": "text"
},
"whatsapp": {
"previewUrl": true
},
"line": {
"emoji": {
"items": [
{
"index": 1,
"productId": "text",
"emojiId": "text"
}
]
}
},
"telegram": {
"parseMode": "Markdown"
}
}
}
},
"notification": {
"url": "text"
},
"capFrequency": true,
"enableLinkTracking": true,
"ignoreQuietHours": true,
"ignoreGlobalHoldout": true,
"tags": [
"text"
],
"shortLinks": {
"domain": "text"
},
"scheduledFor": "2025-03-28T19:11:43.225Z",
"validity": 1
}'
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"channelId": "123e4567-e89b-12d3-a456-426614174000",
"sender": {
"connector": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"identifierValue": "text",
"annotations": {
"name": "text"
},
"types": [
"text"
]
}
},
"receiver": {
"connector": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"identifierValue": "text",
"annotations": {
"name": "text"
},
"types": [
"text"
]
}
},
"meta": {
"extraInformation": {
"ANY_ADDITIONAL_PROPERTY": "anything"
},
"referral": {
"source": "text",
"title": "text",
"text": "text",
"group": "text",
"metadata": {
"source_id": "text",
"source_url": "text",
"media_url": "text",
"tracking_id": "text"
}
},
"order": {
"products": [
{
"externalCatalogId": "text",
"externalProductId": "text",
"quantity": 1,
"price": {
"amount": 1,
"exponent": 1,
"currencyCode": "text"
}
}
]
},
"referredProduct": {
"externalCatalogId": "text",
"externalProductId": "text"
},
"email": {
"subject": "text",
"headers": {
"ANY_ADDITIONAL_PROPERTY": "text"
},
"from": {
"username": "text",
"displayName": "text"
}
},
"pushNotifications": {
"gatewayTypeOverride": "apns"
},
"navigatorId": "123e4567-e89b-12d3-a456-426614174000",
"navigatorMessageId": "123e4567-e89b-12d3-a456-426614174000",
"flow": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "text",
"stepId": "text",
"runId": "123e4567-e89b-12d3-a456-426614174000"
},
"journey": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "text",
"stepId": "text",
"runId": "123e4567-e89b-12d3-a456-426614174000"
},
"campaign": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "text"
}
},
"reference": "my-own-identifier",
"parts": [
{
"platformReference": "text"
}
],
"status": "accepted",
"reason": "text",
"direction": "incoming",
"origin": {
"type": "text",
"id": "text"
},
"replyTo": {
"id": "text",
"order": 1,
"type": "message"
},
"lastStatusAt": "2025-03-28T19:11:43.225Z",
"createdAt": "2025-03-28T19:11:43.225Z",
"updatedAt": "2025-03-28T19:11:43.225Z",
"details": "text",
"failure": {
"code": 1,
"description": "Unsupported media type",
"source": {
"code": "text",
"name": "text"
}
},
"tags": [
"text"
],
"shortLinks": {
"domain": "text"
},
"scheduledFor": "2025-03-28T19:11:43.225Z",
"body": {
"type": "text",
"text": {
"text": "text",
"attachments": [
{
"mediaUrl": "https://example.com",
"filename": "text",
"inline": true
}
],
"actions": [
{
"type": "link",
"link": {
"text": "text",
"url": "text"
}
}
],
"metadata": {
"subject": "text",
"headers": {
"ANY_ADDITIONAL_PROPERTY": "text"
},
"whatsapp": {
"previewUrl": true
},
"line": {
"emoji": {
"items": [
{
"index": 1,
"productId": "text",
"emojiId": "text"
}
]
}
},
"telegram": {
"parseMode": "Markdown"
}
}
}
}
}
Message was accepted for processing