LINE

LINE Messaging API integration with DMs, groups, Flex messages, template messages, quick replies, and location sharing.

LINE is OpenClaw's integration for Japan and Southeast Asia's dominant messaging platform, connecting your AI agent via the LINE Messaging API. The plugin runs as a webhook receiver on the gateway, authenticating inbound events with HMAC signature verification against your Channel Secret. With over 200 million monthly active users primarily in Japan, Taiwan, Thailand, and Indonesia, LINE provides access to a massive user base unreachable through Western-centric platforms. The setup requires creating a LINE Developers account, setting up a Provider and Messaging API channel, and configuring a public HTTPS webhook URL. Authentication uses a Channel Access Token for outbound API calls and a Channel Secret for inbound webhook verification. LINE enforces strict signature verification over raw request bytes, and OpenClaw applies pre-auth body limits and timeout for security. LINE's standout features are Flex messages and template messages. Flex messages allow rich card layouts that look like native app UIs — custom fonts, colors, buttons, and layouts. Template messages provide confirm dialogs and carousels. Quick reply buttons offer fast response options that appear below messages. A loading animation displays while the agent generates a response, providing visual feedback during processing. Text formatting is limited — LINE doesn't support markdown. OpenClaw strips markdown and converts code blocks and tables into Flex cards when possible. Messages are chunked at 5000 characters. Media downloads are capped at 10MB by default. Reactions and threads are not supported. Multi-account support allows running multiple LINE Official Accounts from a single OpenClaw instance, each with its own webhook path and credentials.

Tags: messaging, asia, japan, rich-messages

Category: Messaging

Use Cases

  • AI assistant for Japanese users on their primary messaging platform
  • Customer service bot for businesses in Japan, Taiwan, Thailand, or Indonesia
  • LINE Official Account enhanced with AI-powered responses
  • Rich card-based AI interactions using Flex messages
  • Multilingual AI assistant for Southeast Asian markets via LINE
  • Product recommendation bot with carousel template messages

Tips

  • Use Flex messages for structured data output — they look native and professional on LINE
  • Quick reply buttons provide a great UX for common agent interactions
  • The loading animation (while agent generates) provides visual feedback — users know the bot is working
  • Use environment variables (LINE_CHANNEL_ACCESS_TOKEN, LINE_CHANNEL_SECRET) for credential management
  • For multiple LINE accounts, use the accounts config with separate webhook paths per account
  • Test webhook connectivity with LINE Console's 'Verify' button before troubleshooting OpenClaw
  • Set mediaMaxMb higher than default 10 if you expect large file exchanges
  • LINE is text-oriented — keep agent responses concise and use Flex cards for complex output

Known Issues & Gotchas

  • LINE requires a public HTTPS webhook URL — no long-polling or WebSocket alternative
  • Signature verification uses HMAC over the raw request body — middleware that transforms req.body will break verification
  • LINE user IDs look like 'U' + 32 hex chars (e.g., U1234567890abcdef1234567890abcdef) — these are case-sensitive
  • Group IDs start with 'C', Room IDs start with 'R' — don't mix them up in allowlists
  • The Channel Access Token must be a long-lived token (generate it in the Console, don't use the short-lived one)
  • tokenFile and secretFile must point to regular files — symlinks are rejected for security
  • Markdown formatting is stripped in LINE messages — don't expect code blocks to render
  • Free tier LINE Official Accounts have monthly message send limits — check your plan
  • If webhookPath is customized, update both OpenClaw config AND LINE Console URL to match

Alternatives

  • Telegram
  • WhatsApp
  • Discord
  • Zalo

Community Feedback

Log into the LINE Developers Console and pick or create a Provider, then add a Messaging API channel. You need two things: the access token and the channel secret. Setup is straightforward once you know where to find them.

— Medium

LINE messenger is a community-requested integration. The current supported channels now include LINE as a plugin alongside core channels like WhatsApp, Telegram, Discord, and Slack.

— Answer Overflow (Discord)

Flex messages let your agent send rich card layouts that look like native app UI — custom fonts, colors, buttons. It's LINE's killer feature for AI assistants.

— OpenClaw Docs

Frequently Asked Questions

Do I need a public URL for LINE?

Yes. LINE uses webhook-based delivery, so your gateway must be reachable at a public HTTPS URL. Use Tailscale Funnel, Cloudflare Tunnel, or a VPS. There's no long-polling alternative like Telegram.

What are Flex messages?

Flex messages are LINE's rich card format that allows custom layouts with fonts, colors, buttons, images, and structured data. They look like native app UI elements. OpenClaw can convert code blocks and tables into Flex cards automatically, and you can use channelData to send custom Flex JSON.

Does LINE support streaming responses?

No. LINE doesn't support message editing, so streaming via edit-in-place isn't possible. OpenClaw sends a loading animation while generating, then delivers the complete response. Responses are buffered and sent as full chunks.

How do I find LINE user IDs for allowlists?

LINE user IDs are opaque strings starting with 'U' followed by 32 hex characters. They're not visible in the LINE app. Check your OpenClaw gateway logs when a user messages the bot — the user ID appears in the log output.

Is the LINE plugin installed by default?

No. LINE is a plugin that must be installed separately: openclaw plugins install @openclaw/line. It's not bundled with core OpenClaw like Telegram, Discord, or WhatsApp.

Can I use LINE for free?

LINE Official Accounts have a free tier with limited monthly message sends (varies by region). For personal AI assistant use with low volume, the free tier is usually sufficient. Higher volumes require a paid plan.

Configuration Examples

Basic LINE setup

# Set env: LINE_CHANNEL_ACCESS_TOKEN, LINE_CHANNEL_SECRET
channels:
  line:
    enabled: true
    channelAccessToken: "your-long-lived-access-token"
    channelSecret: "your-channel-secret"
    dmPolicy: pairing

File-based credentials

channels:
  line:
    enabled: true
    tokenFile: "/path/to/line-token.txt"
    secretFile: "/path/to/line-secret.txt"
    dmPolicy: allowlist
    allowFrom:
      - "U1234567890abcdef1234567890abcdef"

Multi-account setup

channels:
  line:
    enabled: true
    channelAccessToken: "default-token"
    channelSecret: "default-secret"
    accounts:
      marketing:
        channelAccessToken: "marketing-token"
        channelSecret: "marketing-secret"
        webhookPath: "/line/marketing"
      support:
        channelAccessToken: "support-token"
        channelSecret: "support-secret"
        webhookPath: "/line/support"

Installation

openclaw plugins install @openclaw/line