Channels

How to Connect OpenClaw to Feishu (Lark)

4 min read

Browse more in Channels.

All channels guides →

This guide walks you through connecting OpenClaw to Feishu (Lark) so your agents can chat with users in DMs and group channels. You will use the built-in Feishu channel, configure DM and group access control, and wire up multi-agent routing where needed.

By the end, your OpenClaw gateway will be talking to real Feishu users over a production-ready WebSocket connection.

Setup flow

Prerequisites

  • OpenClaw 2026.4.10 or above — run `openclaw --version` and upgrade with `openclaw update` if needed.
  • An existing OpenClaw gateway installation with the `openclaw` CLI available on your PATH.
  • A Feishu or Lark workspace where you can create and publish a bot in Feishu Open Platform / Lark Developer.
  • Permission in your Feishu/Lark tenant to grant the bot scopes and enable event subscriptions, including `im.message.receive_v1`.

Steps

  1. 1

    Verify your OpenClaw version

    Feishu support requires a minimum OpenClaw version, so confirm this before you spend time wiring up bots. If you are on an older release, upgrade first so the Feishu channel and commands behave as documented.

    bash
    openclaw --version
    openclaw update
  2. 2

    Run the Feishu channel setup wizard

    Use the built-in channel login flow to create and connect a Feishu/Lark bot to your gateway. The wizard handles app creation and credentials; you authenticate by scanning a QR code from your mobile app.

    bash
    openclaw channels login --channel feishu
  3. 3

    Restart the OpenClaw gateway to apply Feishu settings

    After the wizard writes channel configuration, restart the gateway so it picks up the new Feishu account and connection mode. Skipping this restart is a common reason the bot appears connected in Feishu but never responds.

    bash
    openclaw gateway restart
  4. 4

    Configure direct message access control

    Decide who can DM your Feishu bot by setting the `dmPolicy` and, if needed, approving pairing codes. Pairing mode is useful when you want explicit approval for each new user instead of opening DMs to the whole tenant.

    bash
    openclaw pairing list feishu
    openclaw pairing approve feishu <CODE>
  5. 5

    Tune group chat behavior and mention requirements

    Control where the bot responds in group chats with `groupPolicy` and whether it needs an @mention. Start with an allowlist in busy tenants, then relax to open groups once you are confident the bot behaves well.

    json
    {
      channels: {
        feishu: {
          groupPolicy: "allowlist",
          // Group IDs look like: oc_xxx
          groupAllowFrom: ["oc_xxx", "oc_yyy"],
        },
      },
    }
  6. 6

    Restrict which users can trigger the bot inside a group

    For sensitive rooms, you can allow the bot in a group but restrict which senders it listens to. This is handy when you want a small operator set to control the agent while everyone else can read the replies.

    json
    {
      channels: {
        feishu: {
          groupPolicy: "allowlist",
          groupAllowFrom: ["oc_xxx"],
          groups: {
            oc_xxx: {
              // User open_ids look like: ou_xxx
              allowFrom: ["ou_user1", "ou_user2"],
            },
          },
        },
      },
    }
  7. 7

    Look up Feishu group and user IDs for routing

    You will need concrete `chat_id` and `open_id` values to build allowlists and bindings. Grab group IDs from the Feishu UI and user IDs from gateway logs or pairing requests so your config targets real entities.

    bash
    openclaw logs --follow
    openclaw pairing list feishu
  8. 8

    Enable streaming replies and quota optimizations

    Feishu supports streaming via interactive cards, which keeps long answers responsive. You can also disable typing indicators and sender name resolution to reduce API calls if you are close to quota limits.

    json
    {
      channels: {
        feishu: {
          streaming: true, // enable streaming card output (default: true)
          blockStreaming: true, // enable block-level streaming (default: true)
        },
      },
    }
    {
      channels: {
        feishu: {
          typingIndicator: false,
          resolveSenderNames: false,
        },
      },
    }
  9. 9

    Route Feishu conversations to specific agents

    Use bindings to send different Feishu DMs and groups to different OpenClaw agents. This lets you run, for example, a coding assistant for one user and a support bot in a specific group, all through the same gateway.

    json
    {
      agents: {
        list: [
          { id: "main" },
          { id: "agent-a", workspace: "/home/user/agent-a" },
          { id: "agent-b", workspace: "/home/user/agent-b" },
        ],
      },
      bindings: [
        {
          agentId: "agent-a",
          match: {
            channel: "feishu",
            peer: { kind: "direct", id: "ou_xxx" },
          },
        },
        {
          agentId: "agent-b",
          match: {
            channel: "feishu",
            peer: { kind: "group", id: "oc_zzz" },
          },
        },
      ],
    }

Configuration

OptionDescriptionExample
channels.feishu.enabledTurns the Feishu channel on or off in the gateway.true
channels.feishu.domainSelects whether the bot talks to Feishu or Lark APIs.feishu
channels.feishu.connectionModeControls whether events arrive over WebSocket or webhook.websocket
channels.feishu.defaultAccountSpecifies which Feishu account to use when outbound APIs do not set an accountId.default
channels.feishu.verificationTokenVerification token required when you run Feishu in webhook mode.vtoken_123456
channels.feishu.encryptKeyEncryption key Feishu uses to sign and encrypt webhook payloads.encrypt_key_abc123
channels.feishu.webhookPathHTTP path where the gateway listens for Feishu webhook events./feishu/events
channels.feishu.webhookHostHost interface the Feishu webhook server binds to.127.0.0.1
channels.feishu.webhookPortPort the Feishu webhook server listens on.3000
channels.feishu.accounts.<id>.appIdFeishu app ID for a specific account slot.cli_xxx
channels.feishu.accounts.<id>.appSecretFeishu app secret for a specific account slot.xxx
channels.feishu.accounts.<id>.domainOverrides the API domain per account if you mix Feishu and Lark.feishu
channels.feishu.dmPolicyControls who can DM the bot (pairing, allowlist, open, or disabled).allowlist
channels.feishu.allowFromList of user open_ids allowed to DM the bot when dmPolicy is allowlist.["ou_user1", "ou_user2"]
channels.feishu.groupPolicyControls which groups the bot responds in (open, allowlist, or disabled).allowlist
channels.feishu.groupAllowFromList of group chat_ids where the bot is allowed to respond when groupPolicy is allowlist.["oc_xxx", "oc_yyy"]
channels.feishu.requireMentionRequires an @mention before the bot responds in group chats.true
channels.feishu.groups.<chat_id>.requireMentionOverrides the mention requirement for a specific group.false
channels.feishu.groups.<chat_id>.enabledEnables or disables the bot in a specific group.true
channels.feishu.textChunkLimitMaximum size of each outbound text chunk in characters.2000
channels.feishu.mediaMaxMbMaximum media upload or download size in megabytes.30
channels.feishu.streamingEnables streaming card output for replies.true
channels.feishu.blockStreamingEnables block-level streaming updates for interactive cards.true
channels.feishu.typingIndicatorControls whether the bot sends typing reactions.true
channels.feishu.resolveSenderNamesControls whether the gateway looks up sender display names.true
channels.feishu.defaultAccountDetermines which Feishu account is used when outbound APIs omit accountId.main
channels.feishu.accounts.main.appIdApp ID for the primary Feishu bot account.cli_xxx
channels.feishu.accounts.main.appSecretApp secret for the primary Feishu bot account.xxx
channels.feishu.accounts.main.nameHuman-readable name for the primary Feishu bot account.Primary bot
channels.feishu.accounts.backup.appIdApp ID for a backup Feishu bot account.cli_yyy
channels.feishu.accounts.backup.appSecretApp secret for a backup Feishu bot account.yyy
channels.feishu.accounts.backup.nameHuman-readable name for the backup Feishu bot account.Backup bot
channels.feishu.accounts.backup.enabledControls whether the backup Feishu bot account is active.false

Troubleshooting

Bot does not respond in group chats

requireMention` defaults to true. Then verify `groupPolicy` is not set to `"disabled"` and tail the gateway logs to see if messages are arriving and being filtered.

bash
openclaw logs --follow

Bot does not receive messages

receive_v1`, and the event delivery mode is set to persistent connection (WebSocket). Also confirm the gateway is running and then watch the logs while you send a test message.

bash
openclaw gateway status
openclaw logs --follow

App Secret leaked

appSecret` in your config, and restart the gateway so the new secret is used.

bash
openclaw gateway restart

Frequently asked questions

Powered by Mem0

Add persistent memory to OpenClaw

Official Mem0 plugin for OpenClaw keeps context across chats and tools. Smaller prompts, lower cost, better continuity for your agents.

More in Channels