OpenClawSkills
GitHub
Channels • TutorialHeader.readTime

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.

Tutorial.step

Plugin Installation Required

Install the LINE plugin:

Bash
openclaw plugins install @openclaw/line

Local installation (when running from a git repository):

Bash
openclaw plugins install ./extensions/line
Tutorial.step

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):

Terminal
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.''.webhookPath'' and update the URL accordingly.

Tutorial.step

Configuration

Minimal configuration:

Json5
{
  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:

Json5
{
  channels: {
    line: {
      tokenFile: "/path/to/line-token.txt",
      secretFile: "/path/to/line-secret.txt",
    },
  },
}

Multiple accounts:

Json5
{
  channels: {
    line: {
      accounts: {
        marketing: {
          channelAccessToken: "...",
          channelSecret: "...",
          webhookPath: "/line/marketing",
        },
      },
    },
  },
}
Tutorial.step

Access Control

LINE DMs use pairing by default. Unknown senders receive a pairing code, and their messages are not processed until approved.

Bash
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.''.allowFrom''

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

Tutorial.step

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).

Tutorial.step

Channel Data (Rich Messages)

Use channelData.line to send quick replies, location, Flex cards, or template messages.

Json5
{
  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:

Terminal
/card info "Welcome" "Thanks for joining!"
Tutorial.step

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.