Passer au contenu principal
A Channel is a bridge between FIM One and an external messaging platform — Feishu (Lark), Slack, DingTalk, Teams, and so on. Channels let an agent:
  • Send outbound messages (status updates, artifacts, reports).
  • Receive card callbacks (a person taps Approve or Reject on a card). Answering questions asked in a group chat is not implemented.
  • Gate sensitive tool calls behind a human approval, delivered as an interactive card.
Channels are scoped to an organization, not an individual user. Any org admin can create, edit, and disable them.

Why channels are org-scoped

A channel is an organization’s identity in an external IM platform — not an individual’s hotline. When an agent posts a card to a Feishu group, the message carries the authority of the organization that configured the channel: the bot is registered to that organization’s Feishu tenant, the group members are peers inside that organization, and the approval / audit trail belongs to that organization. FIM One mirrors this mapping one-to-one: An agent can only use a channel inside its own organization. For a draft or personal agent, which has no organization of its own, that means an organization its owner is a member of. Saving an agent with a channel from any other organization is refused (approval_channel_denied for the approval channel, completion_channel_denied for the completion-notification channel), and at run time such a binding is treated as no channel at all. This constraint applies uniformly: both the approval gate (ApprovalGateHook, approval routing) and completion notifications (agent-configured channel) respect the same org-identity boundary.

Supported platforms

The webhook and email types are outbound only: they carry completion notifications and the messages an agent sends with the send_notification tool, and cannot be chosen as an approval channel.

Sending from an agent: send_notification

When the operator sets NOTIFICATION_TOOL_ENABLED=true, agents get a send_notification tool. It sends a title and a body to one channel, named by its name or id, among the enabled channels of the organizations the calling user belongs to. That is the person chatting, or the user a workflow run acts for, whichever agent the tool is used through. Called without a channel it returns the list and sends nothing; it never picks a channel on its own.

Webhook channels

Add a custom bot (incoming webhook) to the group on the platform and paste the URL it issues. FIM One posts only to the platform’s own host over https: open.feishu.cn or open.larksuite.com for Lark / Feishu, hooks.slack.com for Slack, qyapi.weixin.qq.com for WeCom. Any other URL is refused (channel_webhook_url_invalid). The URL is the credential for that group, so it is encrypted at rest and never returned by the API; leave the field blank when editing to keep it.

Email channels

An email channel lists recipient addresses. Mail leaves from the instance SMTP account (SMTP_HOST, SMTP_USER, SMTP_PASS), so it is held to what the operator allows agents to send: the recipients must pass SMTP_ALLOWED_DOMAINS / SMTP_ALLOWED_ADDRESSES, or the operator must set EMAIL_TOOL_ENABLED=true. Otherwise creating the channel is refused (channel_email_not_permitted), and the check runs again on every send.

How Channels interact with Hooks

The approval_gate hook (feishu_gate in agent settings saved earlier) is the primary consumer of a Feishu channel. When an agent is about to call a tool marked requires_confirmation: true (or any tool, when the agent is set to confirm all), and the agent’s approval mode routes to a channel, the hook:
  1. Resolves the agent’s Approval channel. Only the channel bound explicitly on the agent is used; the hook never borrows the notification channel or another channel in the organization. With none bound, Auto mode shows the approval in the portal chat and Channel only refuses the call.
  2. Renders an interactive approval card with the tool name and arguments.
  3. Posts the card to the configured group chat (chat_id).
  4. Suspends the tool call until a permitted approver taps Approve or Reject. Who is permitted is fixed when the request is created (the approver scope at that moment); the click must arrive through the channel that delivered the card, and the clicker’s Feishu account must be linked to a FIM One account.
  5. Resumes (or aborts) the tool based on the verdict, and streams the decision back over SSE.
The hook is attached to every agent automatically. Configure it in the agent editor’s Approval section: the mode (Auto / Inline only / Channel only), the approver scope, and the approval channel.

Creating a Channel

  1. Sign in as an Org Owner or Admin.
  2. Go to Organization Settings → Channels → New Channel.
  3. Pick a channel type, fill in what it needs (Feishu app credentials and a target chat, a webhook URL, or recipient addresses), and save.
  4. Open the channel’s details and click Send Test Message to check that it delivers.
Each channel type has its own credential shape and event-subscription dance — follow the platform-specific guide for the exact steps:

Security notes

  • App secrets and encrypt keys are encrypted at rest with the key derived from CREDENTIAL_ENCRYPTION_KEY.
  • The callback endpoint (/api/channels/{id}/callback) verifies every signature against the stored encrypt_key before acting on the event. A push without a signature (Feishu’s URL verification handshake) is accepted only when its encrypted envelope opens with the channel’s Encrypt Key and its token matches the Verification Token when one is set; an unsigned, unencrypted body is refused.
  • A card click counts only when the clicker’s Feishu account is linked to a FIM One user whom the agent’s approver scope allows (the initiator, the agent owner, or any org member). Other members of the group can see the card but cannot decide it.