
OpenClaw Integration with Lark Tutorial(Feishu)

By Sarah Jenkins


By Sarah Jenkins
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:
openclaw plugins install @openclaw/feishuThere are two ways to add the Feishu channel:
If you just installed OpenClaw, run onboarding:
openclaw onboardThe wizard guides you through:
✅ After configuration, check gateway status:
openclaw gateway statusopenclaw logs --followIf you already completed initial install, add the channel via CLI:
openclaw channels addChoose Feishu, then enter the App ID and App Secret.
✅ After configuration, manage the gateway:
openclaw gateway statusopenclaw gateway restartopenclaw logs --followVisit Feishu Open Platform and sign in.
Lark (global) tenants should use https://open.larksuite.com/app and set domain: "lark" in the Feishu config.
![]()
From Credentials & Basic Info, copy:
cli_test)❗ Important: keep the App Secret private.
![]()
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"]
}
}![]()
In App Capability > Bot:
![]()
⚠️ Important: before setting event subscription, make sure:
openclaw channels add for Feishuopenclaw gateway status)In Event Subscription:
im.message.receive_v1⚠️ If the gateway is not running, the long-connection setup may fail to save.
![]()
openclaw channels addChoose Feishu and paste your App ID + App Secret.
Edit ~/.openclaw/openclaw.json:
{
channels: {
feishu: {
enabled: true,
dmPolicy: "pairing",
accounts: {
main: {
appId: "cli_test",
appSecret: "test",
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.
When using webhook mode, set both channels.feishu.verificationToken and channels.feishu.encryptKey in your config. To get the values:
The screenshot below shows where to find the Verification Token. The Encrypt Key is listed in the same Encryption section.
![]()
export FEISHU_APP_ID="cli_test"
export FEISHU_APP_SECRET="test"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_test",
appSecret: "test",
},
},
},
},
}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_test",
appSecret: "test",
typingIndicator: true,
resolveSenderNames: false,
},
},
},
},
}openclaw gatewayIn Feishu, find your bot and send a message.
By default, the bot replies with a pairing code. Approve it:
openclaw pairing approve feishu <CODE>After approval, you can chat normally.
1. Group policy (channels.feishu.groupPolicy):
"open" = allow everyone in groups"allowlist" = only allow groupAllowFrom"disabled" = disable group messagesDefault: allowlist
2. Mention requirement (channels.feishu.requireMention, overridable via channels.feishu.groups.<chat_id>.requireMention):
true = require @mentionfalse = respond without mentionsgroupPolicy: "open" = default to falsegroupPolicy is not "open" = default to true{
channels: {
feishu: {
groupPolicy: "open",
},
},
}{
channels: {
feishu: {
groupPolicy: "open",
requireMention: true,
},
},
}{
channels: {
feishu: {
groupPolicy: "allowlist",
// Feishu group IDs (chat_id) look like: oc_test
groupAllowFrom: ["oc_test", "oc_yyy"],
},
},
}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_test"],
groups: {
oc_test: {
// Feishu user IDs (open_id) look like: ou_test
allowFrom: ["ou_user1", "ou_user2"],
},
},
},
},
}Group IDs look like oc_test.
Method 1 (recommended)
openclaw logs --follow and look for chat_idMethod 2
Use the Feishu API debugger to list group chats.
User IDs look like ou_test.
Method 1 (recommended)
openclaw logs --follow and look for open_idMethod 2
Check pairing requests for user Open IDs:
openclaw pairing list feishu| Command | Description |
|---|---|
/status | Show bot status |
/reset | Reset the session |
/model | Show/switch model |
Note: Feishu does not support native command menus yet, so commands must be sent as text.
| Command | Description |
|---|---|
openclaw gateway status | Show gateway status |
openclaw gateway install | Install/start gateway service |
openclaw gateway stop | Stop gateway service |
openclaw gateway restart | Restart gateway service |
openclaw logs --follow | Tail gateway logs |
groupPolicy is not set to "disabled"openclaw logs --followim.message.receive_v1openclaw gateway statusopenclaw logs --followim:message:send_as_bot permission{
channels: {
feishu: {
defaultAccount: "main",
accounts: {
main: {
appId: "cli_test",
appSecret: "test",
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:
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 hereNotes:
--thread here works for DMs and Feishu topics.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_test" },
},
},
{
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_test) or group ID (oc_test)Key options:
| Setting | Description | Default |
|---|---|---|
channels.feishu.enabled | Enable/disable channel | true |
channels.feishu.domain | API domain (feishu or lark) | feishu |
channels.feishu.connectionMode | Event transport mode | websocket |
channels.feishu.defaultAccount | Default account ID for outbound routing | default |
channels.feishu.verificationToken | Required for webhook mode | - |
channels.feishu.encryptKey | Required for webhook mode | - |
channels.feishu.webhookPath | Webhook route path | /feishu/events |
channels.feishu.webhookHost | Webhook bind host | 127.0.0.1 |
channels.feishu.webhookPort | Webhook bind port | 3000 |
channels.feishu.accounts.<id>.appId | App ID | - |
channels.feishu.accounts.<id>.appSecret | App Secret | - |
channels.feishu.accounts.<id>.domain | Per-account API domain override | feishu |
channels.feishu.dmPolicy | DM policy | pairing |
channels.feishu.allowFrom | DM allowlist (open_id list) | - |
channels.feishu.groupPolicy | Group policy | allowlist |
channels.feishu.groupAllowFrom | Group allowlist | - |
channels.feishu.requireMention | Default require @mention | conditional |
channels.feishu.groups.<chat_id>.requireMention | Per-group require @mention override | inherited |
channels.feishu.groups.<chat_id>.enabled | Enable group | true |
channels.feishu.textChunkLimit | Message chunk size | 2000 |
channels.feishu.mediaMaxMb | Media size limit | 30 |
channels.feishu.streaming | Enable streaming card output | true |
channels.feishu.blockStreaming | Enable block streaming | true |
| Value | Behavior |
|---|---|
"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 |
reply_in_threadFeishu currently exposes these runtime actions:
sendreadeditthread-replypinlist-pinsunpinmember-infochannel-infochannel-listreact and reactions when reactions are enabled in configAbout the author

Sarah Jenkins is a seasoned OpenClaw developer with a strong focus on optimizing high-performance computing solutions. Her work primarily involves crafting efficient parallel algorithms and enhancing GPU acceleration for complex scientific simulations. Jenkins is renowned for her meticulous attention to detail and her ability to translate intricate theoretical concepts into practical, robust OpenClaw implementations.