Docs / channels / line

LINE

LINE (plugin)

Plugin required

text
openclaw plugins install @openclaw/line
text
openclaw plugins install ./extensions/line

Setup

  1. Create a LINE Developers account and open the Console: https://developers.line.biz/console/
  2. Create (or pick) 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 endpoint (HTTPS required):
text
https://gateway-host/line/webhook

Configure

text
{
  channels: {
    line: {
      enabled: true,
      channelAccessToken: "LINE_CHANNEL_ACCESS_TOKEN",
      channelSecret: "LINE_CHANNEL_SECRET",
      dmPolicy: "pairing",
    },
  },
}
  • LINE_CHANNEL_ACCESS_TOKEN
  • LINE_CHANNEL_SECRET
text
{
  channels: {
    line: {
      tokenFile: "/path/to/line-token.txt",
      secretFile: "/path/to/line-secret.txt",
    },
  },
}
text
{
  channels: {
    line: {
      accounts: {
        marketing: {
          channelAccessToken: "...",
          channelSecret: "...",
          webhookPath: "/line/marketing",
        },
      },
    },
  },
}

Access control

text
openclaw pairing list line
openclaw pairing approve line <CODE>
  • channels.line.dmPolicy: pairing | allowlist | open | disabled
  • channels.line.allowFrom: allowlisted LINE user IDs for DMs
  • channels.line.groupPolicy: allowlist | open | disabled
  • channels.line.groupAllowFrom: allowlisted LINE user IDs for groups
  • Per-group overrides: channels.line.groups.<groupId>.allowFrom
  • User: U + 32 hex chars
  • Group: C + 32 hex chars
  • Room: R + 32 hex chars

Message behavior

  • Text is chunked at 5000 characters.
  • Markdown formatting is stripped; code blocks and tables are converted into Flex cards when possible.
  • Streaming responses are buffered; LINE receives full chunks with a loading animation while the agent works.
  • Media downloads are capped by channels.line.mediaMaxMb (default 10).

Channel data (rich messages)

text
{
  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",
      },
    },
  },
}
text
/card info "Welcome" "Thanks for joining!"

Troubleshooting

  • Webhook verification fails: ensure the webhook URL is HTTPS and the channelSecret matches the LINE console.
  • No inbound events: confirm the webhook path matches channels.line.webhookPath and that the gateway is reachable from LINE.
  • Media download errors: raise channels.line.mediaMaxMb if media exceeds the default limit.