---
title: Feishu (Lark)
description: Integrate CowAgent into Feishu application
---

Integrate CowAgent into Feishu by creating a custom enterprise app. You need to be a Feishu enterprise user with admin privileges.

## 1. Create Enterprise Custom App

### 1.1 Create App

Go to [Feishu Developer Platform](https://open.feishu.cn/app/), click **Create Enterprise Custom App**, fill in the required information and click **Create**:

<img src="https://img-1317903499.cos.ap-guangzhou.myqcloud.com/docs/feishu-hosting-create-app.jpg" width="500"/>

### 1.2 Add Bot Capability

In **Add App Capabilities**, add **Bot** capability to the app:

<img src="https://img-1317903499.cos.ap-guangzhou.myqcloud.com/docs/feishu-hosting-add-bot.jpg" width="800"/>

### 1.3 Configure App Permissions

Click **Permission Management**, paste the following permission string into the input box below **Permission Configuration**, select all filtered permissions, click **Batch Enable** and confirm:

```
im:message,im:message.group_at_msg,im:message.group_at_msg:readonly,im:message.p2p_msg,im:message.p2p_msg:readonly,im:message:send_as_bot,im:resource
```

<img src="https://cdn.link-ai.tech/doc/feishu-hosting-add-auth2.png" width="800"/>

## 2. Project Configuration

1. Get `App ID` and `App Secret` from **Credentials & Basic Info**:

<img src="https://img-1317903499.cos.ap-guangzhou.myqcloud.com/docs/feishu-hosting-appid-secret.jpg" width="800"/>

2. Add the following configuration to `config.json` in the project root:

```json
{
  "channel_type": "feishu",
  "feishu_app_id": "YOUR_APP_ID",
  "feishu_app_secret": "YOUR_APP_SECRET",
  "feishu_bot_name": "YOUR_BOT_NAME"
}
```

| Parameter | Description |
| --- | --- |
| `feishu_app_id` | Feishu bot App ID |
| `feishu_app_secret` | Feishu bot App Secret |
| `feishu_bot_name` | Bot name (set when creating the app), required for group chat usage |

Start the project after configuration is complete.

## 3. Configure Event Subscription

1. After the project is running successfully, go to the Feishu Developer Platform, click **Events & Callbacks**, select **Long Connection** mode, and click save:

<img src="https://cdn.link-ai.tech/doc/202601311731183.png" width="600"/>

2. Click **Add Event** below, search for "Receive Message", select "**Receive Message v2.0**", and confirm.

3. Click **Version Management & Release**, create a new version and apply for **Production Release**. Check the approval message in the Feishu client and approve:

<img src="https://cdn.link-ai.tech/doc/202601311807356.png" width="600"/>

Once completed, search for the bot name in Feishu to start chatting.
