Skip to main content

Introduction

This tutorial guides you through creating and configuring a Feishu bot in OpenClaw Manager. Once complete, your Feishu Bot will be powered by APIMart’s AI models for intelligent conversations within Feishu.
Prerequisites: Please ensure you have completed the OpenClaw Manager deployment and the Manager is running with the management UI accessible.

Step 1: Create a Feishu Enterprise App

  1. Go to Feishu Open Platform, log in and click Create Custom App
Create Custom App
  1. Fill in the app name and description, upload an app icon
Fill in app info

Step 2: Configure App Permissions

  1. Enter the app details page, click Permission Management in the left menu
  2. Click Batch Enable, paste the following JSON configuration:
{
  "scopes": {
    "tenant": [
      "contact:contact.base:readonly",
      "contact:user.email:readonly",
      "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",
      "cardkit:card:write"
    ]
  }
}
Configure permissions
  1. Click to confirm

Step 3: Get Credentials

  1. Click Credentials & Basic Info in the left menu
  2. Copy the App ID (format: cli_xxxxxxxxxx) and App Secret
Get credentials
Keep your App Secret secure and do not share it.

Step 4: Create Instance in Manager

  1. Open the OpenClaw Manager UI (http://127.0.0.1:51942)
  2. Click + New Instance
  3. Enter instance name — e.g. my-feishu-bot
Enter instance name
  1. Select AI model — Choose the model you want to use
Select model
  1. Enter APIMart API Key — Enter your API key starting with sk-
Enter API Key
  1. Select channel — Choose Feishu
  2. Fill in credentials — Paste the App ID and App Secret into the corresponding fields
Configure Feishu channel
  1. Click Create to complete instance creation

Step 5: Configure Event Subscription

After creating the instance, you still need to configure event subscription on the Feishu Open Platform:
  1. Return to the Feishu Open Platform, enter the app details
  2. Click Events & Callbacks in the left menu
  3. Set Subscription Method to “Long Connection
Select subscription method
  1. Click Add Event, search and add im.message.receive_v1 (Receive messages)
Add event

Step 6: Create Version and Publish

  1. Click Version Management & Release in the left menu
  2. Click Create Version
  3. Fill in the version number and update notes
  4. Submit for review and wait for admin approval
Create version and publish
Important: After every permission or event subscription change, you must create a new version and republish for changes to take effect.

Step 7: Pairing Code Binding

After the app is approved and published:
  1. Search for your bot name in Feishu
  2. Send any message (e.g. “Hello”)
  3. The bot will reply with an 8-digit pairing code (e.g. DFE62DTD)
Get pairing code
  1. Return to the Manager’s new instance wizard, enter the pairing code in the “Enter Pairing Code” step and click “Approve
Enter pairing code
  1. After the code is approved, click “Done
Pairing approved
  1. Return to Feishu, send another message, and the bot will respond with AI-generated content
Chat with bot

FAQ

Q1: Bot not responding to messages?

Solutions:
  1. Confirm event subscription has added im.message.receive_v1
  2. Confirm subscription method is “Long Connection” (not Webhook)
  3. Confirm a new version has been created and published, and approval has passed
  4. Confirm the instance status is “Running” in Manager

Q2: Insufficient permissions error?

Solutions:
  1. Check that all permissions are enabled (see Step 2)
  2. After modifying permissions, you must create a new version and republish
  3. Wait for admin approval

Q3: Pairing code approval failed?

Solutions:
  • Confirm Gateway is running
  • Pairing codes are case-sensitive, double check carefully
  • Codes expire after Gateway restart, have the user send a new message

Back to OpenClaw Manager Deployment Guide

View the complete guide for Manager installation, deployment and instance management