飞书 icon

飞书

飞书 API 集成,支持多种飞书功能

Actions105

群组管理 → 将用户或机器人拉入群聊

AI-generated

Summary

Add users or bots to a Feishu group chat by specifying the group chat ID and member IDs to invite, with configurable handling for invalid IDs and batch request options.

Inputs

  • 凭证类型 — Select the credential type to authenticate the request: user-level or application-level credentials.
  • 群 ID (required) — The target group chat's ID (chat_id) where members are to be added. Only supports groups of type 'group' or 'topic'. Retrieve chat_id via group creation response, group list, or search APIs.
  • 成员 ID 列表 (required) — Comma-separated string or an array of member IDs to invite into the group chat. Use OpenID for inviting users and App ID for inviting bots. Limits: max 50 users per request, max 5 bots per request (total bots in group cannot exceed 15).
  • 成员 ID 类型 — Defines the type of IDs provided in the member ID list. Recommended 'open_id' for users and 'app_id' for bots.
  • 不可用 ID 处理方式 — Strategy for handling invalid member IDs during invitation: 0 = fail with error and add other valid IDs; 1 = succeed with valid IDs, return invalid IDs and reasons; 2 = fail entirely if any invalid ID exists, showing invalid IDs.
  • Options — Additional options including batching controls (items per batch and batch interval in milliseconds) for concurrent requests, and request timeout in milliseconds.

Output shape

a single execution result with success or error information for the add-members action

The operation returns the Feishu API response indicating success or failure for member additions. Errors related to invalid IDs are returned based on the selected '不可用 ID 处理方式' option. Supports batching to handle multiple requests concurrently with configurable batch size and interval. Errors for individual items can be managed with continueOnFail setting.

Examples

Example 1: Add multiple users to a group chat using OpenID

Specify the group chat ID, a list of user OpenIDs as member IDs, member ID type as 'open_id', and adjust invalid ID handling as desired.

Example 2: Add bots to a group chat using App IDs

Provide the group chat ID, list of bot App IDs, set member ID type to 'app_id', and configure batching options if inviting many bots across multiple requests.

Links

Discussion