Prerequisites
- A running OpenClaw gateway (see VPS Deploy Recipe)
- A public URL for your gateway (via Cloudflare Tunnel or Reverse Proxy)
- A Feishu/Lark account with permissions to create apps
Step 1 — Create a Feishu App
- Go to the Feishu Open Platform.
- Click Create Custom App.
- Enter a name and description (e.g., "OpenClaw Agent").
- Navigate to App Settings → App Credentials and copy your App ID and App Secret.
Step 2 — Enable Bot Capability
- In your app sidebar, go to App Capabilities → Bot.
- Click Enable Bot.
Step 3 — Configure OpenClaw
Add the Feishu credentials to your secrets.env file.
FEISHU_APP_ID=cli_a1b2c3d4e5f6
FEISHU_APP_SECRET=your_app_secret
FEISHU_VERIFICATION_TOKEN=your_token_from_step_4
FEISHU_ENCRYPT_KEY=your_key_from_step_4
Restart your gateway: systemctl --user restart openclaw-gateway.
Step 4 — Event Subscriptions & Webhook
- Go to Development Config → Event Subscriptions.
- Copy the Verification Token and Encrypt Key and add them to
your
secrets.envfrom Step 3. - Set the Request URL to:
https://your-public-url.com/webhook/feishu. - Feishu will send a test request. OpenClaw handles this automatically if your Verification Token matches.
- Under Add Events, subscribe to:
im.message.receive_v1(Receive messages)im.message.recalled_v1(Recall messages)
Step 5 — Permissions
Go to Development Config → Permissions and add:
im:message(Receive and send messages)im:message.group_at:readonly(Receive messages that @bot in groups)im:message.p2p:msg:readonly(Receive messages in private chats)
Click Apply for release (or use the test version) to activate these permissions.
Step 6 — Test the Bot
- Find your bot in Feishu (search for the app name).
- Send a message like "Hello".
- Check your OpenClaw logs:
journalctl --user -u openclaw-gateway -f. - If the bot replies, you're connected!
💡 Troubleshooting
- Handshake Failed: Ensure your public URL is accessible and the
FEISHU_VERIFICATION_TOKENin your env exactly matches what's in the Feishu console. - No Response: Verify the Bot has permission to send messages and the app is in the "Running" state (not just "Developing").
- EncodingAESKey Errors: If you enabled encryption, ensure
FEISHU_ENCRYPT_KEYis correctly set. OpenClaw supports both encrypted and plaintext webhooks.
Related
- Multi-Channel Routing — route messages across Feishu and other platforms
- Security Hardening — secure your Feishu integration
- SOUL.md Template — define how your Feishu bot behaves