Skip to content

Feishu / Lark

The Feishu driver receives messages via an HTTP webhook pushed by Feishu's event system and sends via the Feishu IM v1 API using lark-oapi.

Feishu (China) and Lark (international) use the same API and the same driver.

Setup

  1. Go to the Feishu Open Platform (or Lark Developer).
  2. Create a custom app and enable the im:message:receive_v1 event.
  3. Under Event Subscriptions, set the request URL to http://your-host:8080/event (matching your listen_port and listen_path).
  4. Copy the App ID, App Secret, Verification Token, and Encrypt Key (leave encrypt key blank to disable encryption).
  5. Add the bot to the target group chat.

Public endpoint required

Feishu must be able to reach your HTTP endpoint from the internet. Use a reverse proxy, tunnel (e.g. ngrok), or deploy on a public server.

Config keys

Add under feishu.<instance_id> in config.json:

KeyRequiredDefaultDescription
app_idYesFeishu/Lark App ID
app_secretYesFeishu/Lark App Secret
verification_tokenNo""Event verification token from the developer console
encrypt_keyNo""Event encryption key (leave empty to disable)
listen_portNo8080HTTP port to listen on for incoming events
listen_pathNo"/event"HTTP path for incoming events
json
{
  "feishu": {
    "fs_main": {
      "app_id": "cli_xxxxxxxxxxxx",
      "app_secret": "your_app_secret",
      "verification_token": "your_verification_token",
      "encrypt_key": "",
      "listen_port": 8080,
      "listen_path": "/event"
    }
  }
}

Rule channel keys

Use under channels or from/to in rules.json:

KeyDescription
chat_idFeishu open chat ID, e.g. "oc_xxxxxxxxxxxxxxxxxx"
json
{
  "fs_main": { "chat_id": "oc_xxxxxxxxxxxxxxxxxx" }
}

You can find the chat ID in the Feishu developer console, or from the event payload of any message sent to the bot in that chat.

Notes

  • Currently only text messages are received. Other message types (cards, files, stickers) are ignored on the receive side.
  • Outgoing attachments are sent as URLs appended to the message text (Feishu file upload via the API requires additional permissions).
  • The sender's display name is shown as their open_id. Resolving the human-readable name requires an extra user-info API call and is not currently implemented.