Pangea Docs FAQ Get early access

Docs / Chat

Lark / Feishu

Connect your own Lark or Feishu custom app and work with an agent from a group chat or DM.

Pangea connects to Lark and Feishu through a custom app that you create in your own organization. A custom app belongs to your organization and needs no marketplace review. Only members of your workspace can use it.

Connect

As a team Administrator, open Connectors, find Lark (Feishu) and click Add. The wizard walks you through each step and shows the exact values to paste.

1. Site

Choose Feishu or Lark. The app and its credentials must belong to the site you pick.

2. Create app

  1. Open the developer console for your site and click Create custom app.
  2. Set the name to Pangea and the description to The agent workspace for your team.
  3. Use the Pangea logo as its icon. The wizard has a download link for it.

3. Credentials

In the console, open Basic Info → Credentials & Basic Info. Copy the App ID and App Secret into the wizard. The App ID starts with cli_.

4. Permissions

Open Permissions & Scopes, then Batch import/export scopes → Import. Paste this JSON, click Next, review the new scopes and apply them:

{
  "scopes": {
    "tenant": [
      "im:message:send_as_bot",
      "im:message.group_at_msg:readonly",
      "im:message.p2p_msg:readonly",
      "im:chat:readonly",
      "contact:contact.base:readonly"
    ],
    "user": []
  }
}

These let Pangea reply as the bot, list the groups it is in, and read a sender's display name.

5. Encryption

Open Events & Callbacks → Encryption Strategy. Click the reset icon next to Encrypt Key to generate one, then paste it into the wizard. The key is required. Pangea uses it to verify and decrypt incoming events and rejects events without it.

Enter the App ID, App Secret and Encrypt Key only in the wizard. Never paste them into an agent conversation.

6. Webhook and events

After you save the credentials, the wizard shows your app's request URL. It has this form:

https://api.pangea.build/lark/events/<your App ID>

Copy it from the wizard. Then, in Events & Callbacks → Event Configuration:

  1. Set Subscription mode to Send notifications to developer's server, not the default persistent connection.
  2. Paste the URL into Request URL and save.
  3. Subscribe to these three events:
Event Why
im.message.receive_v1 Receive messages sent to the bot
im.chat.member.bot.added_v1 Know when the bot joins a group
im.chat.member.bot.deleted_v1 Know when the bot leaves a group

Saving credentials alone does not turn on event delivery.

7. Publish and go live

Scopes and events stay pending until the app is published. Click Create Version in the banner at the top of the app, or open Version Management & Release. Submit it for release and wait until it goes live. The bot does not respond until a version is published.

Add the bot to a group

  1. Open the group in Lark and tap the group name at the top, then Settings.
  2. Go to Group Bots (群机器人) → Add Bot.
  3. Search for your app and add it.

The group links by itself and shows up under Groups in the Lark connection in Pangea. Administrators can turn agent replies on or off for each group there. Then @mention Pangea in the group, or DM the bot directly.

Each member links their own Lark account. In the Lark connection in Pangea, open Link your Lark account and click Generate pairing code. DM the Pangea bot in Lark and send the code before it expires. Check member identity and account access before sensitive work.

Troubleshooting

If events do not arrive, check the selected site, that a version is published, the request URL, the Encrypt Key, the event subscriptions and the granted scopes.

If a secret leaks, rotate it in the developer console and reconnect with Reconnect in Pangea.