Skip to content

Feishu

Feishu (Lark) is a team chat platform used by companies for messaging and collaboration. This plugin connects OpenClaw to a Feishu/Lark bot using the platform’s WebSocket event subscription so messages can be received without exposing a public webhook URL.


Feishu ships bundled with current OpenClaw releases, so no separate plugin install is required.

If you are using an older build or a custom install that does not include bundled Feishu, install it manually:

Terminal window
openclaw plugins install @openclaw/feishu

There are two ways to add the Feishu channel:

If you just installed OpenClaw, run onboarding:

Terminal window
openclaw onboard

The wizard guides you through:

  1. Creating a Feishu app and collecting credentials
  2. Configuring app credentials in OpenClaw
  3. Starting the gateway

After configuration, check gateway status:

  • openclaw gateway status
  • openclaw logs --follow

If you already completed initial install, add the channel via CLI:

Terminal window
openclaw channels add

Choose Feishu, then enter the App ID and App Secret.

After configuration, manage the gateway:

  • openclaw gateway status
  • openclaw gateway restart
  • openclaw logs --follow

Visit Feishu Open Platform and sign in.

Lark (global) tenants should use https://open.larksuite.com/app and set domain: "lark" in the Feishu config.

  1. Click Create enterprise app
  2. Fill in the app name + description
  3. Choose an app icon

Create enterprise app

From Credentials & Basic Info, copy:

  • App ID (format: cli_xxx)
  • App Secret

Important: keep the App Secret private.

Get credentials

On Permissions, click Batch import and paste:

{
"scopes": {
"tenant": [
"aily:file:read",
"aily:file:write",
"application:application.app_message_stats.overview:readonly",
"application:application:self_manage",
"application:bot.menu:write",
"cardkit:card:read",
"cardkit:card:write",
"contact:user.employee_id:readonly",
"corehr:file:download",
"event:ip_list",
"im:chat.access_event.bot_p2p_chat:read",
"im:chat.members:bot_access",
"im:message",
"im:message.group_at_msg:readonly",
"im:message.p2p_msg:readonly",
"im:message:readonly",
"im:message:send_as_bot",
"im:resource"
],
"user": ["aily:file:read", "aily:file:write", "im:chat.access_event.bot_p2p_chat:read"]
}
}

Configure permissions

In App Capability > Bot:

  1. Enable bot capability
  2. Set the bot name

Enable bot capability

⚠️ Important: before setting event subscription, make sure:

  1. You already ran openclaw channels add for Feishu
  2. The gateway is running (openclaw gateway status)

In Event Subscription:

  1. Choose Use long connection to receive events (WebSocket)
  2. Add the event: im.message.receive_v1
  3. (Optional) For Drive comment workflows, also add: drive.notice.comment_add_v1

⚠️ If the gateway is not running, the long-connection setup may fail to save.

Configure event subscription

  1. Create a version in Version Management & Release
  2. Submit for review and publish
  3. Wait for admin approval (enterprise apps usually auto-approve)

Terminal window
openclaw channels add

Choose Feishu and paste your App ID + App Secret.

Edit ~/.openclaw/openclaw.json:

{
channels: {
feishu: {
enabled: true,
dmPolicy: "pairing",
accounts: {
main: {
appId: "cli_xxx",
appSecret: "xxx",
name: "My AI assistant",
},
},
},
},
}

If you use connectionMode: "webhook", set both verificationToken and encryptKey. The Feishu webhook server binds to 127.0.0.1 by default; set webhookHost only if you intentionally need a different bind address.

Verification Token and Encrypt Key (webhook mode)

Section titled “Verification Token and Encrypt Key (webhook mode)”

When using webhook mode, set both channels.feishu.verificationToken and channels.feishu.encryptKey in your config. To get the values:

  1. In Feishu Open Platform, open your app
  2. Go to DevelopmentEvents & Callbacks (开发配置 → 事件与回调)
  3. Open the Encryption tab (加密策略)
  4. Copy Verification Token and Encrypt Key

The screenshot below shows where to find the Verification Token. The Encrypt Key is listed in the same Encryption section.

Verification Token location

Terminal window
export FEISHU_APP_ID="cli_xxx"
export FEISHU_APP_SECRET="xxx"

If your tenant is on Lark (international), set the domain to lark (or a full domain string). You can set it at channels.feishu.domain or per account (channels.feishu.accounts.<id>.domain).

{
channels: {
feishu: {
domain: "lark",
accounts: {
main: {
appId: "cli_xxx",
appSecret: "xxx",
},
},
},
},
}

You can reduce Feishu API usage with two optional flags:

  • typingIndicator (default true): when false, skip typing reaction calls.
  • resolveSenderNames (default true): when false, skip sender profile lookup calls.

Set them at top level or per account:

{
channels: {
feishu: {
typingIndicator: false,
resolveSenderNames: false,
accounts: {
main: {
appId: "cli_xxx",
appSecret: "xxx",
typingIndicator: true,
resolveSenderNames: false,
},
},
},
},
}

Terminal window
openclaw gateway

In Feishu, find your bot and send a message.

By default, the bot replies with a pairing code. Approve it:

Terminal window
openclaw pairing approve feishu <CODE>

After approval, you can chat normally.


  • Feishu bot channel: Feishu bot managed by the gateway
  • Deterministic routing: replies always return to Feishu
  • Session isolation: DMs share a main session; groups are isolated
  • WebSocket connection: long connection via Feishu SDK, no public URL needed

  • Default: dmPolicy: "pairing" (unknown users get a pairing code)

  • Approve pairing:

    Terminal window
    openclaw pairing list feishu
    openclaw pairing approve feishu <CODE>
  • Allowlist mode: set channels.feishu.allowFrom with allowed Open IDs

1. Group policy (channels.feishu.groupPolicy):

  • "open" = allow everyone in groups
  • "allowlist" = only allow groupAllowFrom
  • "disabled" = disable group messages

Default: allowlist

2. Mention requirement (channels.feishu.requireMention, overridable via channels.feishu.groups.<chat_id>.requireMention):

  • explicit true = require @mention
  • explicit false = respond without mentions
  • when unset and groupPolicy: "open" = default to false
  • when unset and groupPolicy is not "open" = default to true

Allow all groups, no @mention required (default for open groups)

Section titled “Allow all groups, no @mention required (default for open groups)”
{
channels: {
feishu: {
groupPolicy: "open",
},
},
}

Allow all groups, but still require @mention

Section titled “Allow all groups, but still require @mention”
{
channels: {
feishu: {
groupPolicy: "open",
requireMention: true,
},
},
}
{
channels: {
feishu: {
groupPolicy: "allowlist",
// Feishu group IDs (chat_id) look like: oc_xxx
groupAllowFrom: ["oc_xxx", "oc_yyy"],
},
},
}

Restrict which senders can message in a group (sender allowlist)

Section titled “Restrict which senders can message in a group (sender allowlist)”

In addition to allowing the group itself, all messages in that group are gated by the sender open_id: only users listed in groups.<chat_id>.allowFrom have their messages processed; messages from other members are ignored (this is full sender-level gating, not only for control commands like /reset or /new).

{
channels: {
feishu: {
groupPolicy: "allowlist",
groupAllowFrom: ["oc_xxx"],
groups: {
oc_xxx: {
// Feishu user IDs (open_id) look like: ou_xxx
allowFrom: ["ou_user1", "ou_user2"],
},
},
},
},
}

Group IDs look like oc_xxx.

Method 1 (recommended)

  1. Start the gateway and @mention the bot in the group
  2. Run openclaw logs --follow and look for chat_id

Method 2

Use the Feishu API debugger to list group chats.

User IDs look like ou_xxx.

Method 1 (recommended)

  1. Start the gateway and DM the bot
  2. Run openclaw logs --follow and look for open_id

Method 2

Check pairing requests for user Open IDs:

Terminal window
openclaw pairing list feishu

CommandDescription
/statusShow bot status
/resetReset the session
/modelShow/switch model

Note: Feishu does not support native command menus yet, so commands must be sent as text.

CommandDescription
openclaw gateway statusShow gateway status
openclaw gateway installInstall/start gateway service
openclaw gateway stopStop gateway service
openclaw gateway restartRestart gateway service
openclaw logs --followTail gateway logs

  1. Ensure the bot is added to the group
  2. Ensure you @mention the bot (default behavior)
  3. Check groupPolicy is not set to "disabled"
  4. Check logs: openclaw logs --follow
  1. Ensure the app is published and approved
  2. Ensure event subscription includes im.message.receive_v1
  3. Ensure long connection is enabled
  4. Ensure app permissions are complete
  5. Ensure the gateway is running: openclaw gateway status
  6. Check logs: openclaw logs --follow
  1. Reset the App Secret in Feishu Open Platform
  2. Update the App Secret in your config
  3. Restart the gateway
  1. Ensure the app has im:message:send_as_bot permission
  2. Ensure the app is published
  3. Check logs for detailed errors

{
channels: {
feishu: {
defaultAccount: "main",
accounts: {
main: {
appId: "cli_xxx",
appSecret: "xxx",
name: "Primary bot",
},
backup: {
appId: "cli_yyy",
appSecret: "yyy",
name: "Backup bot",
enabled: false,
},
},
},
},
}

defaultAccount controls which Feishu account is used when outbound APIs do not specify an accountId explicitly.

  • textChunkLimit: outbound text chunk size (default: 2000 chars)
  • mediaMaxMb: media upload/download limit (default: 30MB)

Feishu supports streaming replies via interactive cards. When enabled, the bot updates a card as it generates text.

{
channels: {
feishu: {
streaming: true, // enable streaming card output (default true)
blockStreaming: true, // enable block-level streaming (default true)
},
},
}

Set streaming: false to wait for the full reply before sending.

Feishu supports ACP for:

  • DMs
  • group topic conversations

Feishu ACP is text-command driven. There are no native slash-command menus, so use /acp ... messages directly in the conversation.

Use top-level typed ACP bindings to pin a Feishu DM or topic conversation to a persistent ACP session.

{
agents: {
list: [
{
id: "codex",
runtime: {
type: "acp",
acp: {
agent: "codex",
backend: "acpx",
mode: "persistent",
cwd: "/workspace/openclaw",
},
},
},
],
},
bindings: [
{
type: "acp",
agentId: "codex",
match: {
channel: "feishu",
accountId: "default",
peer: { kind: "direct", id: "ou_1234567890" },
},
},
{
type: "acp",
agentId: "codex",
match: {
channel: "feishu",
accountId: "default",
peer: { kind: "group", id: "oc_group_chat:topic:om_topic_root" },
},
acp: { label: "codex-feishu-topic" },
},
],
}

In a Feishu DM or topic conversation, you can spawn and bind an ACP session in place:

/acp spawn codex --thread here

Notes:

  • --thread here works for DMs and Feishu topics.
  • Follow-up messages in the bound DM/topic route directly to that ACP session.
  • v1 does not target generic non-topic group chats.

Use bindings to route Feishu DMs or groups to different agents.

{
agents: {
list: [
{ id: "main" },
{
id: "clawd-fan",
workspace: "/home/user/clawd-fan",
agentDir: "/home/user/.openclaw/agents/clawd-fan/agent",
},
{
id: "clawd-xi",
workspace: "/home/user/clawd-xi",
agentDir: "/home/user/.openclaw/agents/clawd-xi/agent",
},
],
},
bindings: [
{
agentId: "main",
match: {
channel: "feishu",
peer: { kind: "direct", id: "ou_xxx" },
},
},
{
agentId: "clawd-fan",
match: {
channel: "feishu",
peer: { kind: "direct", id: "ou_yyy" },
},
},
{
agentId: "clawd-xi",
match: {
channel: "feishu",
peer: { kind: "group", id: "oc_zzz" },
},
},
],
}

Routing fields:

  • match.channel: "feishu"
  • match.peer.kind: "direct" or "group"
  • match.peer.id: user Open ID (ou_xxx) or group ID (oc_xxx)

See Get group/user IDs for lookup tips.


Full configuration: Gateway configuration

Key options:

SettingDescriptionDefault
channels.feishu.enabledEnable/disable channeltrue
channels.feishu.domainAPI domain (feishu or lark)feishu
channels.feishu.connectionModeEvent transport modewebsocket
channels.feishu.defaultAccountDefault account ID for outbound routingdefault
channels.feishu.verificationTokenRequired for webhook mode-
channels.feishu.encryptKeyRequired for webhook mode-
channels.feishu.webhookPathWebhook route path/feishu/events
channels.feishu.webhookHostWebhook bind host127.0.0.1
channels.feishu.webhookPortWebhook bind port3000
channels.feishu.accounts.<id>.appIdApp ID-
channels.feishu.accounts.<id>.appSecretApp Secret-
channels.feishu.accounts.<id>.domainPer-account API domain overridefeishu
channels.feishu.dmPolicyDM policypairing
channels.feishu.allowFromDM allowlist (open_id list)-
channels.feishu.groupPolicyGroup policyallowlist
channels.feishu.groupAllowFromGroup allowlist-
channels.feishu.requireMentionDefault require @mentionconditional
channels.feishu.groups.<chat_id>.requireMentionPer-group require @mention overrideinherited
channels.feishu.groups.<chat_id>.enabledEnable grouptrue
channels.feishu.textChunkLimitMessage chunk size2000
channels.feishu.mediaMaxMbMedia size limit30
channels.feishu.streamingEnable streaming card outputtrue
channels.feishu.blockStreamingEnable block streamingtrue

ValueBehavior
"pairing"Default. Unknown users get a pairing code; must be approved
"allowlist"Only users in allowFrom can chat
"open"Allow all users (requires "*" in allowFrom)
"disabled"Disable DMs

  • ✅ Text
  • ✅ Rich text (post)
  • ✅ Images
  • ✅ Files
  • ✅ Audio
  • ✅ Video/media
  • ✅ Stickers
  • ✅ Text
  • ✅ Images
  • ✅ Files
  • ✅ Audio
  • ✅ Video/media
  • ✅ Interactive cards
  • ⚠️ Rich text (post-style formatting and cards, not arbitrary Feishu authoring features)
  • ✅ Inline replies
  • ✅ Topic-thread replies where Feishu exposes reply_in_thread
  • ✅ Media replies stay thread-aware when replying to a thread/topic message

Feishu can trigger the agent when someone adds a comment on a Feishu Drive document (Docs, Sheets, etc.). The agent receives the comment text, document context, and the comment thread so it can respond in-thread or make document edits.

Requirements:

  • Subscribe to drive.notice.comment_add_v1 in your Feishu app event subscription settings (alongside the existing im.message.receive_v1)
  • The Drive tool is enabled by default; disable with channels.feishu.tools.drive: false

The feishu_drive tool exposes these comment actions:

ActionDescription
list_commentsList comments on a document
list_comment_repliesList replies in a comment thread
add_commentAdd a new top-level comment
reply_commentReply to an existing comment thread

When the agent handles a Drive comment event, it receives:

  • the comment text and sender
  • document metadata (title, type, URL)
  • the comment thread context for in-thread replies

After making document edits, the agent is guided to use feishu_drive.reply_comment to notify the commenter and then output NO_REPLY to avoid duplicate sends.

Feishu currently exposes these runtime actions:

  • send
  • read
  • edit
  • thread-reply
  • pin
  • list-pins
  • unpin
  • member-info
  • channel-info
  • channel-list
  • react and reactions when reactions are enabled in config
  • feishu_drive comment actions: list_comments, list_comment_replies, add_comment, reply_comment