Buda LogoBuda

Connect Feishu (Lark) Bot

How to configure and connect a Feishu (Lark) bot to Buda for real-time AI conversations.

Connect Feishu (Lark) Bot

Buda natively supports Feishu bots via persistent WebSocket connections. No public webhook URL or tunneling required — just provide your App ID and App Secret.

Lark (international) tenants: use https://open.larksuite.com/app and set domain: "lark" in your config.


Step 1: Create a Feishu App

1.1 Open Feishu Open Platform

Visit Feishu Open Platform and sign in.

1.2 Create an enterprise app

  1. Click Create enterprise app
  2. Fill in the app name, description, and icon
  3. Click Create

Create enterprise app

1.3 Copy credentials

From Credentials & Basic Info, copy:

App ID:      cli_xxxxxxxxxxxx
App Secret:  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

App Secret is hidden by default — click "View" to reveal it. Keep it private.

Get credentials

1.4 Configure permissions

In 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"]
  }
}

Configure permissions

1.5 Publish the app (first time)

You must publish before enabling event subscriptions.

  1. Go to Version Management & ReleaseCreate Version
  2. Set version to 1.0.0, click SaveSubmit for release
  3. Wait for approval (enterprise apps usually auto-approve)

Step 2: Configure the channel in Buda

Open Buda's Channel settings, select Feishu, enter your App ID and App Secret, and save.

Buda immediately establishes a WebSocket long connection to Feishu in the background.

⚠️ Complete this step before configuring event subscriptions — Feishu needs to detect the active connection first.


Step 3: Enable event subscription

  1. Go to Event SubscriptionEvent Configuration
  2. Enable Use long connection to receive events
  3. Click Add Event and add im.message.receive_v1
  4. Click Save

Configure event subscription

⚠️ If the long connection toggle is grayed out, the app hasn't been published yet. Complete step 1.5 first.


Step 4: Publish a new version

After adding events, publish a new version for changes to take effect:

  1. Version Management & ReleaseCreate Version, increment the version (e.g. 1.0.1)
  2. Click SaveSubmit for release

Step 5: Test

  1. Open Feishu and find your bot
  2. Send a message, e.g. Hello
  3. The bot replies — you're all set 🎉

Troubleshooting

Bot does not respond

Possible causeSolution
Event not addedCheck that im.message.receive_v1 is added
Missing permissionsReview step 1.4
Wrong credentialsVerify App ID and App Secret in Buda
Version not publishedPublish a new version after adding events

Long connection cannot be enabled

The app hasn't been published. Complete step 1.5 and wait 1–2 minutes before retrying.

App Secret leaked

  1. Reset the App Secret in Feishu Open Platform
  2. Update the App Secret in Buda
  3. Restart the gateway

Supported message types

Receive

  • ✅ Text, rich text
  • ✅ Images, files, audio, video
  • ✅ Stickers

Send

  • ✅ Text, images, files, audio, video
  • ✅ Interactive cards (streaming output)

Configuration reference

SettingDescriptionDefault
channels.feishu.enabledEnable/disable channeltrue
channels.feishu.domainAPI domain (feishu or lark)feishu
channels.feishu.connectionModeEvent transport modewebsocket
channels.feishu.defaultAccountDefault account IDdefault
channels.feishu.accounts.<id>.appIdApp ID-
channels.feishu.accounts.<id>.appSecretApp Secret-
channels.feishu.dmPolicyDM policypairing
channels.feishu.allowFromDM allowlist (open_id)-
channels.feishu.groupPolicyGroup policyopen
channels.feishu.groupAllowFromGroup allowlist-
channels.feishu.groups.<chat_id>.requireMentionRequire @mentiontrue
channels.feishu.textChunkLimitMessage chunk size2000
channels.feishu.mediaMaxMbMedia size limit30
channels.feishu.streamingEnable streaming card outputtrue
channels.feishu.typingIndicatorEnable typing indicatortrue
channels.feishu.resolveSenderNamesResolve sender namestrue

On this page