LINE
LINE Messaging API plugin: install, configuration, and usage.
LINE integrates with OpenClaw via the LINE Messaging API. The plugin runs as a webhook receiver on the gateway and authenticates using your channel access token and channel secret.
Status: Supported via plugin. Supports DMs, groups, media, location, Flex messages, template messages, and quick replies. Does not support reactions and threads.
Plugin Installation Required
Install the LINE plugin:
openclaw plugins install @openclaw/line
Local installation (when running from a git repository):
openclaw plugins install ./extensions/line
Setup
1. Register for LINE Developers and open the Console:
https://developers.line.biz/console/
2. Create (or select) a Provider and add a Messaging API channel.
3. Copy the Channel access token and Channel secret from the channel settings.
4. Enable Use webhook in the Messaging API settings.
5. Set the webhook URL to your gateway address (must be HTTPS):
https://gateway-host/line/webhook
The gateway will respond to LINE webhook verification (GET) and inbound events (POST).
If you need a custom path, set ''channels.line.webhookPath'' or ''channels.line.accounts.'' and update the URL accordingly.
Configuration
Minimal configuration:
{
channels: {
line: {
enabled: true,
channelAccessToken: "LINE_CHANNEL_ACCESS_TOKEN",
channelSecret: "LINE_CHANNEL_SECRET",
dmPolicy: "pairing",
},
},
}Environment variables (default account only):
- LINE_CHANNEL_ACCESS_TOKEN
- LINE_CHANNEL_SECRET
Read token/secret from files:
{
channels: {
line: {
tokenFile: "/path/to/line-token.txt",
secretFile: "/path/to/line-secret.txt",
},
},
}Multiple accounts:
{
channels: {
line: {
accounts: {
marketing: {
channelAccessToken: "...",
channelSecret: "...",
webhookPath: "/line/marketing",
},
},
},
},
}Access Control
LINE DMs use pairing by default. Unknown senders receive a pairing code, and their messages are not processed until approved.
openclaw pairing list line openclaw pairing approve line '<CODE>'
Allowlist and policies:
- channels.line.dmPolicy: pairing | allowlist | open | disabled
- channels.line.allowFrom: LINE user IDs allowed for DMs
- channels.line.groupPolicy: allowlist | open | disabled
- channels.line.groupAllowFrom: LINE user IDs allowed to trigger groups
- Per-group override: ''channels.line.groups.''
LINE IDs are case-sensitive. Valid ID formats are typically:
- User: U + 32 hex digits
- Group: C + 32 hex digits
- Room: R + 32 hex digits
Message Behavior
- Text is split at 5000 characters.
- Markdown formatting is removed; code blocks and tables are converted to Flex cards when possible.
- Streaming replies are buffered; LINE receives complete segmented text with a loading animation while the agent works.
- Media download limit is controlled by channels.line.mediaMaxMb (default 10MB).
Channel Data (Rich Messages)
Use channelData.line to send quick replies, location, Flex cards, or template messages.
{
text: "Here you go",
channelData: {
line: {
quickReplies: ["Status", "Help"],
location: {
title: "Office",
address: "123 Main St",
latitude: 35.681236,
longitude: 139.767125,
},
flexMessage: {
altText: "Status card",
contents: {
/* Flex payload */
},
},
templateMessage: {
type: "confirm",
text: "Proceed?",
confirmLabel: "Yes",
confirmData: "yes",
cancelLabel: "No",
cancelData: "no",
},
},
},
}The LINE plugin also provides the /card command for Flex preset cards:
/card info "Welcome" "Thanks for joining!"
Troubleshooting
- Webhook verification failed: Ensure the webhook URL is HTTPS and the channelSecret matches the LINE Console.
- No inbound events: Ensure the webhook path matches channels.line.webhookPath and the gateway is reachable from LINE.
- Media download errors: If media exceeds the default limit, increase channels.line.mediaMaxMb.