approval_gate hook).
This guide walks through the end-to-end setup. It assumes FIM One is reachable at a stable HTTPS origin — call this API_BASE_URL (e.g. https://one.yourdomain.com).
1. Create a Feishu app
- Go to the Feishu Open Platform and click Create custom app for enterprise.
- Give it a name, icon, and a short description — end-users of your org will see these on cards.
- On the Credentials & Basic Info page, copy the App ID and App Secret. You’ll paste them into FIM One in step 4.
2. Grant permissions
Under Permissions & Scopes, enable the following scopes and submit the permission version:3. Enable event subscriptions (leave the Request URL blank for now)
Open Event Subscriptions, but don’t fill in the Request URL yet — you get it from FIM One in step 5. Subscribe the following events:card.action.trigger— Approve / Reject button clicks
4. Add the Channel in FIM One
- Sign in as an Org Owner or Admin.
- Go to Organization Settings → Channels → New Channel.
-
Pick Feishu as the type, then fill in:
- Click Browse chats — FIM One calls Feishu with your credentials and lists every group the bot is currently a member of.
- Pick the group chat you want to route to, click Save.
5. Register the callback URL with Feishu
After saving, FIM One shows a Callback URL on the channel detail panel, shaped like:url_verification challenge; FIM One answers automatically.
6. Send a test message
Back in the FIM One channel detail panel, click Send test message. A short plaintext message (FIM One test message from <your email>) should appear in the target group within a second.
If it doesn’t:
- 401 / 403 — recheck App Secret, re-enable the scopes from step 2, and re-publish the permission version.
- Silent failure — confirm the bot is actually in the group (step 4 picker) and that
is_activeis true on the channel row. - Verification fails on step 5 — confirm
API_BASE_URLis HTTPS and publicly reachable; Feishu refuses non-HTTPS request URLs.
7. Wire up an agent (optional — approvals)
To gate tool calls behind group approval:- On the tool / connector action, flip Requires confirmation on.
- In the agent editor’s Approval section, pick this channel as the Approval channel and set the mode to Auto or Channel only. The gate is attached to every agent automatically; no hook configuration is needed.
- Set the Approver scope (initiator, agent owner, or any org member). Approvers must have linked their Feishu account to their FIM One user, otherwise their click is ignored.
Troubleshooting
Finding a chat_id without the picker
The Browse chats UI is the recommended flow. If you need the raw ID (e.g. for a POST /api/channels call from scripting), there are three fallbacks:
a. curl against Feishu directly
items[].chat_id in the response (prefixed oc_) is a candidate.
b. Feishu API Explorer
In the Feishu Open Platform console, open Dev Tools → API Explorer, find /open-apis/im/v1/chats, pick tenant_access_token auth, and click Invoke. Feishu mints the token for you — no shell required.
c. Copy from the Feishu client
In the Feishu desktop or mobile client, open the group → Group settings → Group info, and some versions expose a Copy group ID affordance. Availability depends on client version and admin-set permissions, so this is the least reliable fallback.
Card clicks don’t reach FIM One (error 200340)
If clicking Approve or Reject on a card produces出错了,请稍后重试 code: 200340 in the Feishu client, work down this list:
card.action.triggermust be subscribed (step 3). If you enabled approval gates before subscribing, click Resubscribe in the Feishu console.- Re-save the callback URL. Feishu sometimes caches a stale subscription state that survives restarts — even when the URL verification handshake still passes, event routing can silently stop. Open the event subscription page in the Feishu open platform, re-enter the exact same callback URL, and click Save / Verify again. The URL will re-verify in one round-trip and live button clicks start flowing on the next press. This is the most common fix when the channel worked yesterday but stopped today with no code change.
- Check the Event Debugger in the Feishu open platform (
事件与回调 → 事件调试). Each button press should appear there with the delivery status (2xx/4xx/未投递). If you see未投递, Feishu itself is rejecting the event before sending — usually a missing scope or a disabled subscription. - Scope check. In
权限管理, make sure the app has theim:messageand anycard-related scopes your tenant requires. A missing scope manifests as the subscription showing green in the UI but events silently dropped at delivery.