Feishu Integration
Overview
EchoCenter integrates Feishu in long-connection WebSocket mode.
Current implemented capabilities:
- Feishu connector config persistence (
app_id,app_secret, filters, allow-list). - Credential verification via Feishu auth API (
tenant_access_token/internal). - Inbound Feishu text message routing into Butler flow.
- Butler outbound reply relay back to Feishu.
- Butler authorization request cards in Feishu (
Approve/Reject). - Card action callback handling for command approval decisions.
Important Mode Notes
- Message ingestion uses
FEISHU_WS_ENABLED=true+FEISHU_WS_URL. - This mode does not require exposing
/api/integrations/feishu/callbackpublicly for normal message ingress. - If your tenant policy enforces callback URL checks for specific card features, ensure platform config is aligned with your deployment setup.
1. Configure Connector (EchoCenter Admin)
In Settings -> Integrations -> Feishu Connector, save:
App IDApp Secret- Optional
Verification Token/Encrypt Key - Optional
allowed_chat_idsfor outbound target restriction
2. Verify Connector
Call:
http
POST /api/integrations/feishu/:id/verify-callback
Authorization: Bearer <admin_jwt>Behavior:
- Backend calls Feishu auth API with
app_id/app_secret. - Only successful Feishu response marks connector
callback_verified=true.
3. Enable Connector
http
PATCH /api/integrations/feishu/:id/enable
Authorization: Bearer <admin_jwt>
Content-Type: application/json
{"enabled": true}enabled=true is rejected until verification succeeds.
4. Inbound Routing Rules
Incoming Feishu messages are accepted only when:
- Connector is enabled.
- Not deduplicated by same
message_id. - Policy filters pass (
allow_dm,allow_group_mention,mention_required,allowed_chat_ids,user_whitelist,prefix_command,ignore_bot_messages).
5. Butler Authorization Cards in Feishu
When Butler emits an AUTH_REQUEST, backend sends an interactive Feishu card:
ApproveReject
Card action callback result:
- Executes
ExecutePendingCommandon approve. - Marks request rejected on reject.
- Card is collapsed to decision state; repeated clicks are idempotent.
6. Troubleshooting
No inbound message reaches Butler
- Check connector
enabledstate. - Check
ws_filteredlogs for reason (prefix_not_matched, allow-list mismatch, mention rules).
Butler outbound not sent to Feishu
- Check connector has valid
app_id/app_secret. - Check outbound target resolution (
allowed_chat_idsor latest inbound chat/user). - Check
ws_outboundlogs.
Card approve/reject not effective
- Ensure Feishu card callback events are enabled in app config.
- Check integration logs for
ws_auth_card/ws_auth_card_decision.
7. Related APIs
GET /api/integrations/feishuPOST /api/integrations/feishuPATCH /api/integrations/feishu/:idPOST /api/integrations/feishu/:id/verify-callbackPATCH /api/integrations/feishu/:id/enableGET /api/integrations/feishu/:id/logs