Back to Blog

Connecting AI Agents to LINE with OpenClaw - Setup and Practical Tips

March 28, 20268 min readMichael Ridland

Deploy OpenClaw for Your Business

Secure deployment in 48 hours. Choose personal setup or fully managed.

LINE isn't the first messaging platform most Australian businesses think about. But if you're working with Japanese, Thai, or Taiwanese partners, customers, or operations, LINE is the messaging app. Over 200 million active users, deeply embedded in daily life across parts of Asia. And if you're building AI agents that need to meet people where they are, LINE support matters.

OpenClaw's LINE plugin is how you connect your AI agent to LINE's Messaging API. I've been working with OpenClaw across several deployments now, and the LINE channel is one of the more straightforward integrations to set up - though there are a few details worth knowing before you start.

Why LINE for AI Agents

Most of the AI agent work we do for Australian businesses focuses on Slack, Teams, and web chat. Those are the obvious channels. But the projects where LINE comes up tend to be interesting ones.

A logistics company with warehousing operations in Thailand needed their ops team to query inventory and dispatch information through LINE - because that's the app their warehouse staff already had open all day. Building a separate web portal would have meant training, adoption friction, and probably another app nobody used. Connecting the AI agent to LINE meant the team could ask questions in the tool they were already using.

Tourism businesses with Asian market customers are another common case. When your booking enquiries come through LINE, having an AI agent that can handle initial triage, answer FAQs, and escalate complex queries to a human - all within the LINE conversation - is genuinely useful.

The point is: the channel your agent lives on isn't a technical decision. It's a user behaviour decision.

Setting Up the LINE Plugin

OpenClaw handles LINE through a plugin rather than having it built in to the core. This is a design choice I appreciate - it keeps the base install lean and means you only pull in the messaging platforms you actually need.

Install is one command:

openclaw plugins install @openclaw/line

Then you need three things from LINE's side:

  1. A LINE Developers account - sign up at developers.line.biz
  2. A Messaging API channel - create this under a Provider in the LINE Developers Console
  3. Your channel access token and channel secret - both available in the channel settings

The webhook URL needs to point at your OpenClaw gateway:

https://your-gateway-host/line/webhook

Two things catch people here. First, HTTPS is mandatory - LINE won't send events to an HTTP endpoint. If you're running locally for development, you'll need a tunnel (ngrok or similar). Second, make sure "Use webhook" is enabled in your LINE Messaging API settings. It's off by default, and the error you get when it's off is just... silence. No events arrive and nothing tells you why.

Configuration

The minimal config is refreshingly simple:

{
  channels: {
    line: {
      enabled: true,
      channelAccessToken: "your-token-here",
      channelSecret: "your-secret-here",
      dmPolicy: "pairing",
    },
  },
}

You can also use environment variables (LINE_CHANNEL_ACCESS_TOKEN and LINE_CHANNEL_SECRET) or file-based token storage. For production, I'd recommend file-based tokens or environment variables rather than putting credentials directly in the config file. It's a small thing but it keeps your config files safe to commit to version control.

Multiple accounts are supported if you need them. Each account gets its own token, secret, and webhook path. We've set this up for a client who had separate LINE accounts for customer support and marketing, with different AI agent behaviours on each.

Access Control - Take This Seriously

OpenClaw's access control for LINE is well thought out, and you should actually configure it rather than leaving everything open.

The default DM policy is pairing, which means unknown senders get a pairing code and their messages are ignored until someone approves them. This is a good default. You probably don't want random LINE users talking to your AI agent before you've verified who they are.

Your options for DM policy:

  • pairing - users must be approved via a pairing code (recommended default)
  • allowlist - only pre-approved LINE user IDs can interact
  • open - anyone can message the agent (use with caution)
  • disabled - DMs are turned off entirely

For group chats, you have groupPolicy with similar options. If you're adding your agent to LINE group chats - which is a common pattern for team-based interactions - use allowlist and specify which groups are permitted.

openclaw pairing list line
openclaw pairing approve line <CODE>

One thing to watch: LINE user IDs are case-sensitive and follow specific formats (U + 32 hex characters for users, C + 32 hex for groups). If you're manually adding IDs to an allowlist, double-check the formatting.

Message Handling - What Works and What Doesn't

Deploy OpenClaw for Your Business

Secure deployment in 48 hours. Choose personal setup or fully managed.

LINE has its own message format, and it's different from what you'd expect coming from Slack or Teams.

Text messages get chunked at 5,000 characters. OpenClaw handles this automatically, splitting long responses across multiple messages. Your users won't notice anything weird, though very long responses will arrive as several bubbles in sequence.

Markdown doesn't work on LINE. If your agent produces markdown-formatted responses (which most LLM-powered agents do), OpenClaw strips the formatting and converts code blocks and tables into Flex cards where possible. The result is readable but won't look identical to what you'd see in Slack or a web interface. Keep this in mind when designing your agent's response templates.

Streaming responses get buffered. While the agent is generating a response, LINE shows a loading animation. The user sees the typing indicator, then gets the complete response. This is a reasonable approach - LINE's API doesn't support true message streaming the way web interfaces do.

Media works in both directions. Users can send images, videos, and audio, and the agent can respond with the same. Media downloads are capped at 10MB by default, which you can adjust via channels.line.mediaMaxMb.

Rich Messages and Flex Cards

LINE has a powerful rich message system called Flex Messages. Think of them as structured cards with layouts, buttons, and styling. OpenClaw exposes this through the channelData.line object in agent responses.

Quick replies let you present button options:

{
  text: "How can I help?",
  channelData: {
    line: {
      quickReplies: ["Check order status", "Talk to support", "Opening hours"],
    },
  },
}

You can also send location data, confirmation templates, and full Flex message payloads. The /card command ships with presets for common patterns:

/card info "Welcome" "Thanks for joining!"

My honest take on Flex Messages: they look great and LINE users are used to them, but building custom Flex layouts is tedious. The JSON payloads are verbose. If your agent needs consistent rich formatting, invest time building reusable templates rather than constructing Flex JSON for every response. LINE also has a Flex Message Simulator tool that makes the design process less painful.

ACP Support - Connecting to Other Agents

OpenClaw supports ACP (Agent Communication Protocol) bindings on LINE channels. This means you can spawn sub-agents or connect to external agent services from within a LINE conversation.

/acp spawn <agent> --bind here

This binds the ACP session to the current LINE chat. For organisations running multi-agent architectures - say, a front-desk agent that routes to specialist agents for different departments - this is how you wire it together on LINE without creating separate LINE accounts for each agent.

Deployment Considerations

A few things to think about for production LINE deployments.

Webhook reliability. Your gateway needs to be up and responsive for LINE events to arrive. LINE retries failed webhook deliveries, but with backoff, so extended downtime means delayed messages. Run your gateway behind a load balancer if uptime matters, which it does if this is customer-facing.

Signature verification. OpenClaw verifies the HMAC signature on every incoming webhook event. This is non-negotiable security - it proves the event came from LINE, not from someone who guessed your webhook URL. Don't disable this. Don't put middleware in front of OpenClaw that modifies the request body, because that will break signature verification.

Rate limits. LINE has API rate limits that vary by plan. Free plans are quite restricted. If your agent will handle significant message volume, you'll need a paid LINE Official Account plan.

Getting Started

If your business has a use case for LINE-based AI agents - whether that's customer service for Asian markets, internal tooling for distributed teams, or something else entirely - the OpenClaw LINE plugin is a solid foundation.

We help Australian businesses design and deploy AI agents across multiple channels, including LINE. If you're thinking about where AI agents fit in your customer communication strategy, talk to our AI agent team. We can help you figure out which channels matter for your specific audience and build agents that work properly across all of them.

For organisations already running OpenClaw and looking to add LINE or other channels, our managed OpenClaw service handles the infrastructure, configuration, and ongoing management so your team can focus on the agent behaviour rather than the plumbing.

And if you're earlier in the journey - still working out whether AI agents make sense for your business at all - our AI strategy consulting can help you identify the highest-value opportunities before you commit to building anything.

The full LINE plugin documentation is available at OpenClaw's docs site if you want the complete technical reference.

Deploy OpenClaw for Your Business

Secure deployment in 48 hours. Choose personal setup or fully managed.