OpenClaw LINE Channel
Connect OpenClaw to LINE using the official Messaging API. This plugin-based integration lets your AI assistant send and receive messages on LINE — one of the most popular messaging platforms in Japan, Taiwan, Thailand, and Southeast Asia. OpenClaw receives events via webhook and responds through the Messaging API, supporting rich message types including Flex Messages, template messages, quick replies, and media sharing.
LINE Supported Features
Text Messages
Supported
Media & Files
Supported
Reactions
Not Supported
Threads
Not Supported
Voice Messages
Not Supported
Group Chat
Supported
LINE Prerequisites
- A LINE Developers account (free at developers.line.biz)
- A Provider and Messaging API channel created in the LINE Developers Console
- Channel access token and channel secret from your Messaging API channel settings
- OpenClaw Gateway running and accessible via a public HTTPS URL (required for webhook)
- The LINE plugin installed: openclaw plugins install @openclaw/line
LINE Quick Setup
Create a LINE Messaging API channel
Log in to the LINE Developers Console, create a Provider (or select an existing one), then create a new Messaging API channel. Note your Channel ID, Channel secret, and issue a Channel access token from the channel settings page.
Install the LINE plugin and add config
Run 'openclaw plugins install @openclaw/line' to install the LINE plugin. Then add the LINE channel configuration to ~/.openclaw/openclaw.json with your channelAccessToken and channelSecret. You can also use environment variables LINE_CHANNEL_ACCESS_TOKEN and LINE_CHANNEL_SECRET.
Configure the webhook URL
In the LINE Developers Console, navigate to your channel's Messaging API tab. Set the webhook URL to 'https://<your-gateway-host>/line/webhook' and enable 'Use webhook'. Click Verify to confirm the endpoint is reachable. Disable auto-reply and greeting messages in the LINE Official Account Manager to prevent duplicate responses.
Send a test message
Add your LINE bot as a friend by scanning its QR code (found in the Console). Send a message to the bot. If using the default pairing policy, approve the sender via 'openclaw pairing approve line <code>' in your terminal.
LINE Configuration Example
{
"channels": {
"line": {
"enabled": true,
"channelAccessToken": "YOUR_CHANNEL_ACCESS_TOKEN",
"channelSecret": "YOUR_CHANNEL_SECRET",
"dmPolicy": "pairing"
}
}
}
LINE Deep Dive
Architecture Overview
LINE Developers Console Setup
{
"channels": {
"line": {
"channelAccessToken": "YOUR_TOKEN",
"channelSecret": "YOUR_SECRET"
}
}
}
Channel Access Tokens
DM Policies
{
"channels": {
"line": {
"dmPolicy": "allowlist",
"allowFrom": ["U1234567890abcdef1234567890abcdef"]
}
}
}
Group Chat Management
{
"channels": {
"line": {
"groupPolicy": "open",
"historyLimit": 50
}
}
}
Rich Messages: Flex & Templates
Media & Attachments
{
"channels": {
"line": {
"mediaMaxMb": 10
}
}
}
Webhook Security
Loading Indicators & Delivery
{
"channels": {
"line": {
"textChunkLimit": 5000,
"chunkMode": "newline"
}
}
}
Multi-Account Setup
{
"channels": {
"line": {
"accounts": {
"main": {
"channelAccessToken": "TOKEN_1",
"channelSecret": "SECRET_1",
"webhookPath": "/line/main/webhook"
},
"support": {
"channelAccessToken": "TOKEN_2",
"channelSecret": "SECRET_2",
"webhookPath": "/line/support/webhook"
}
}
}
}
}
LINE Configuration Reference
| Key | Type | Default | Description |
|---|---|---|---|
| enabled | boolean | true | Enable or disable the LINE channel |
| channelAccessToken | string | "" | LINE Messaging API channel access token. Can also use LINE_CHANNEL_ACCESS_TOKEN env var |
| channelSecret | string | "" | LINE channel secret for webhook signature verification. Can also use LINE_CHANNEL_SECRET env var |
| tokenFile | string | "" | Path to a file containing the channel access token (alternative to inline config) |
| secretFile | string | "" | Path to a file containing the channel secret (alternative to inline config) |
| dmPolicy | string | "pairing" | Controls who can DM the bot. Options: pairing, allowlist, open, disabled |
| allowFrom | string[] | [] | LINE user IDs (U + 32 hex) allowed to message the bot when dmPolicy is allowlist |
| dmHistoryLimit | number | 50 | Number of recent DM messages to include as AI context per conversation |
| groupPolicy | string | "disabled" | Group chat policy. Options: disabled, allowlist, open |
| groupAllowFrom | string[] | [] | LINE user IDs allowed to trigger the bot in groups (when groupPolicy is allowlist) |
| historyLimit | number | 50 | Maximum group messages included as AI context. Set 0 to disable |
| textChunkLimit | number | 5000 | Maximum characters per outbound message before chunking |
| chunkMode | string | "length" | Text chunking mode. Options: length (hard split), newline (paragraph-aware) |
| mediaMaxMb | number | 10 | Maximum inbound media file size in megabytes |
| webhookPath | string | "/line/webhook" | Custom webhook path for this account (useful in multi-account setups) |
| accounts.<id>.channelAccessToken | string | "" | Per-account channel access token for multi-account setups |
| accounts.<id>.channelSecret | string | "" | Per-account channel secret for multi-account setups |
| accounts.<id>.webhookPath | string | "/line/<id>/webhook" | Per-account webhook path for multi-account setups |
| configWrites | boolean | true | Allow /config commands to modify channel settings at runtime |
Enable or disable the LINE channel
LINE Messaging API channel access token. Can also use LINE_CHANNEL_ACCESS_TOKEN env var
LINE channel secret for webhook signature verification. Can also use LINE_CHANNEL_SECRET env var
Path to a file containing the channel access token (alternative to inline config)
Path to a file containing the channel secret (alternative to inline config)
Controls who can DM the bot. Options: pairing, allowlist, open, disabled
LINE user IDs (U + 32 hex) allowed to message the bot when dmPolicy is allowlist
Number of recent DM messages to include as AI context per conversation
Group chat policy. Options: disabled, allowlist, open
LINE user IDs allowed to trigger the bot in groups (when groupPolicy is allowlist)
Maximum group messages included as AI context. Set 0 to disable
Maximum characters per outbound message before chunking
Text chunking mode. Options: length (hard split), newline (paragraph-aware)
Maximum inbound media file size in megabytes
Custom webhook path for this account (useful in multi-account setups)
Per-account channel access token for multi-account setups
Per-account channel secret for multi-account setups
Per-account webhook path for multi-account setups
Allow /config commands to modify channel settings at runtime
LINE Frequently Asked Questions
LINE Troubleshooting
The Gateway is not accessible from the internet, the URL is incorrect, or SSL certificate issues.
Webhook is not enabled in the Console, auto-reply is interfering, or the sender hasn't been approved via pairing policy.
The channel access token is invalid, expired, or revoked.
LINE reply tokens expire 1 minute after the webhook event is sent. If AI processing takes longer, the token becomes invalid.
The channelSecret in your config doesn't match the channel secret in the LINE Developers Console, or a reverse proxy is modifying the request body.