Home Tutorials Categories Skills About
ZH EN JA KO
Channels

Connecting OpenClaw to Feishu (Lark) Bot

· 12 min read

Feishu (known internationally as Lark) is an enterprise collaboration platform developed by ByteDance, featuring instant messaging, document collaboration, video conferencing, and more. OpenClaw supports Feishu channels through its plugin system, allowing you to chat directly with AI agents within Feishu for use cases such as intelligent customer service, knowledge Q&A, and workflow automation.

Prerequisites

Before you begin, you need to prepare the following:

  • A deployed and running OpenClaw instance
  • An enterprise self-built application on the Feishu Open Platform (requires admin permissions to create)
  • The application's App ID and App Secret
  • A configured event subscription callback URL (requires a publicly accessible URL)

Creating a Feishu Self-Built Application

First, log in to the Feishu Open Platform (open.feishu.cn) and go to the Developer Console. Click "Create Enterprise Self-Built Application" and fill in the application name and description. Once created, you can obtain the App ID and App Secret on the application's "Credentials & Basic Info" page — you will need these values for the configuration later.

Next, you need to add the "Bot" capability to the application. In the application's "Add App Capabilities" section, select "Bot" so that the application can send and receive messages in Feishu chats.

Configuring Permissions and Event Subscriptions

On the application's "Permission Management" page, enable the following permissions:

  • im:message — Send and receive messages
  • im:message.group_at_msg — Receive messages that @mention the bot in group chats
  • im:message.p2p_msg — Receive direct messages
  • im:resource — Access resource files in messages

On the "Event Subscriptions" page, configure the request URL to point to your OpenClaw instance's Feishu webhook endpoint. The OpenClaw Feishu plugin listens on the default path /webhooks/feishu, so the full URL would be something like https://your-domain.com/webhooks/feishu.

The event to subscribe to is: im.message.receive_v1 (message received event). After configuration, Feishu will send a verification request, which the OpenClaw plugin handles automatically.

Installing the Feishu Plugin

OpenClaw's Feishu channel is provided through the plugin system. First, install the plugin:

openclaw plugin install feishu

After installation, you can use the interactive login command to configure it:

openclaw channels login feishu

The system will prompt you to enter the App ID, App Secret, and Verification Token (found on the Event Subscriptions page). These credentials will be securely stored in the local configuration.

Manual openclaw.json Configuration

You can also directly edit the openclaw.json configuration file to set up the Feishu channel:

{
  "channels": {
    "feishu": {
      "enabled": true,
      "appId": "cli_xxxxxxxxxx",
      "appSecret": "your-app-secret",
      "verificationToken": "your-verification-token",
      "encryptKey": "your-encrypt-key"
    }
  }
}

The encryptKey is optional and only required if you configured an Encrypt Key on the Feishu Open Platform. Enabling encryption enhances the security of data transmission and is recommended for production environments.

Publishing and Testing

After configuration, go back to the Feishu Open Platform, set the application's availability scope to target users or departments, then click "Create Version" and submit for review. For internal enterprise use, the admin can approve it directly.

Once published successfully, search for your bot name in the Feishu chat list and send a message to test whether it responds correctly.

Using in Group Chats

After adding the bot to a Feishu group chat, by default the bot only responds to messages that @mention it. You can adjust this behavior in the configuration:

{
  "channels": {
    "feishu": {
      "groupBehavior": "mention_only"
    }
  }
}

groupBehavior supports two modes: mention_only (respond only to @mentions) and all (respond to all messages). In group chats with many members, mention_only mode is recommended to avoid unnecessary noise.

Security Configuration

It is recommended to use OpenClaw's allowlist feature to restrict which users can interact with the bot:

{
  "channels": {
    "feishu": {
      "allowlist": ["user_id_1", "user_id_2"]
    }
  }
}

You can also use OpenClaw's DM pairing feature, which requires users to verify their identity through a direct message before they can use the bot in group chats.

Coexistence with Other Channels

The Feishu channel can run simultaneously with other channels supported by OpenClaw. All channels share the same AI model backend. Conversations in Feishu are independent from conversations on Telegram, Discord, and other platforms, but they can share the same knowledge base and tool configurations. This allows enterprises to simultaneously serve internal employees (via Feishu) and external customers (via other platforms) with AI services.

Troubleshooting

If the bot cannot receive messages, check that the event subscription callback URL is correct, that the application has been published, and that the network firewall allows requests from Feishu servers. The Feishu Open Platform's "Event Subscriptions" page provides a logging feature where you can check the status and error messages of event pushes.

OpenClaw is a free, open-source personal AI assistant that supports WhatsApp, Telegram, Discord, and many more platforms