docs/channels/line.md
LINE connects to OpenClaw via the LINE Messaging API. The plugin runs as a webhook receiver on the Gateway and uses your channel access token + channel secret for authentication.
Status: official plugin, installed separately. Direct messages, group chats, media, locations, Flex messages, template messages, and quick replies are supported. Reactions and threads are not supported.
Install LINE before configuring the channel:
openclaw plugins install @openclaw/line
Local checkout (when running from a git repo):
openclaw plugins install ./path/to/local/line-plugin
https://gateway-host/line/webhook
The Gateway answers LINE's webhook verification (GET) and acknowledges signed
inbound events (POST) immediately after signature and payload validation; agent
processing continues asynchronously.
If you need a custom path, set channels.line.webhookPath or
channels.line.accounts.<id>.webhookPath and update the URL accordingly.
Security notes:
req.body values are ignored for signature-integrity safety.Minimal config:
{
channels: {
line: {
enabled: true,
channelAccessToken: "LINE_CHANNEL_ACCESS_TOKEN",
channelSecret: "LINE_CHANNEL_SECRET",
dmPolicy: "pairing",
},
},
}
Public DM config:
{
channels: {
line: {
enabled: true,
channelAccessToken: "LINE_CHANNEL_ACCESS_TOKEN",
channelSecret: "LINE_CHANNEL_SECRET",
dmPolicy: "open",
allowFrom: ["*"],
},
},
}
Env vars (default account only):
LINE_CHANNEL_ACCESS_TOKENLINE_CHANNEL_SECRETToken/secret files:
{
channels: {
line: {
tokenFile: "/path/to/line-token.txt",
secretFile: "/path/to/line-secret.txt",
},
},
}
tokenFile and secretFile must point to regular files. Symlinks are rejected.
Inline config values win over files; env vars are the last fallback for the default account.
Multiple accounts:
{
channels: {
line: {
accounts: {
marketing: {
channelAccessToken: "...",
channelSecret: "...",
webhookPath: "/line/marketing",
},
},
},
},
}
Direct messages default to pairing. Unknown senders get a pairing code and their messages are ignored until approved:
openclaw pairing list line
openclaw pairing approve line <CODE>
Allowlists and policies:
channels.line.dmPolicy: pairing | allowlist | open | disabled (default pairing)channels.line.allowFrom: allowlisted LINE user IDs for DMs; dmPolicy: "open" requires ["*"]channels.line.groupPolicy: allowlist | open | disabled (default allowlist)channels.line.groupAllowFrom: allowlisted LINE user IDs for groupschannels.line.groups.<groupId>.allowFrom (plus enabled, requireMention, systemPrompt, skills)allowFrom, groupAllowFrom, and per-group allowFrom with accessGroup:<name>; see Access groups.channels.line is completely missing, runtime falls back to groupPolicy="allowlist" for group checks (even if channels.defaults.groupPolicy is set).LINE IDs are case-sensitive. Valid IDs look like:
U + 32 hex charsC + 32 hex charsR + 32 hex charschannels.line.mediaMaxMb (default 10).~/.openclaw/media/inbound/ before it is passed
to the agent, matching the shared media store used by other channel plugins.Use channelData.line to send quick replies, locations, 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 ships a /card command for Flex message presets:
/card info "Welcome" "Thanks for joining!"
LINE supports ACP (Agent Communication Protocol) conversation bindings:
/acp spawn <agent> --bind here binds the current LINE chat to an ACP session without creating a child thread.See ACP agents for details.
The LINE plugin sends images, videos, and audio through the agent message tool:
channelData.line.previewImageUrl to an image URL.channelData.line.durationMs is set.The media kind is taken from channelData.line.mediaKind when set, otherwise inferred
from the other LINE options or the URL file suffix, with image as the fallback.
Outbound media URLs must be public HTTPS URLs of at most 2000 characters. OpenClaw validates the target hostname before handing the URL to LINE and rejects loopback, link-local, and private-network targets.
Generic media sends without LINE-specific options use the image route.
channelSecret matches the LINE console.channels.line.webhookPath
and that the gateway is reachable from LINE.channels.line.mediaMaxMb if media exceeds the
default limit.