创建群
POST
/open-apis/im/v1/chats
/open-apis/im/v1/chats
自建应用商店应用
注意事项:
错误码
HTTP状态码 | 错误码 | 描述 | 排查建议 |
---|---|---|---|
400 | 232001 | Your request contains an invalid request parameter. | 参数错误,参考本文档检查输入参数。 |
400 | 232004 | Such an app does NOT exist. | 作为操作者的 app_id 不存在,请联系技术支持。 |
400 | 232019 | The request has been rate limited. | 触发群限流,请控制请求的速度,详情参见频控策略。 |
400 | 232020 | Name can NOT be less than two characters for public chats. | 公开群名称太短,不得少于2个字符。 |
400 | 232021 | Bot can NOT be found. | 未找到机器人。 |
400 | 232022 | User has already resigned. | 邀请的用户已离职,请检查邀请的群成员ID。 |
400 | 232023 | Chat information review failed while updating the chat. | 群组相关信息审核没有通过,请检查群名称或群描述中是否存在敏感内容。 |
400 | 232025 | Bot ability is not activated. | 应用需要开启机器人能力。 |
400 | 232030 | Your request specifies a user_id which is invalid. | 请检查user_id是否正确。 |
400 | 232032 | The operator who will create the chat and the designated chat owner must be in the same tenant. | 指定的群主须与本接口的操作者在同一个租户中。 |
400 | 232033 | The operator or invited bots does NOT have the authority to manage external chats without the scope. | 没有权限操作外部群。 |
400 | 232034 | The app is unavailable or inactivated by the tenant. | 应用在本租户下未安装或未启用。 |
400 | 232037 | The operator or invited bots does NOT have the authority to manage chat labels without the scope. | 操作者或受邀的机器人没有权限管理群Label,请检查权限配置。 |
400 | 232042 | Public group chat's name should not be empty. | 创建公开群时需要指定群名称。 |
400 | 232043 | Your request contains unavailable ids. | 请检查传入的 ID 列表。 |
400 | 232057 | The operator tenant doesn't have the permission to use restricted mode. | 操作者所属的租户没有权限使用防泄密模式,请联系租户管理员。 |
400 | 232068 | The group is being created, please wait a moment. | 群组正在创建中,请稍等。 |
400 | 232069 | current chat type unsupported to set public. | 不支持群类型为public的外部群。 |
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://open.feishu.cn/open-apis/im/v1/chats' \
--header 'Authorization;' \
--header 'Content-Type: application/json' \
--data-raw '{
"avatar": "default-avatar_44ae0ca3-e140-494b-956f-78091e348435",
"name": "测试群名称",
"description": "测试群描述",
"i18n_names": {
"zh_cn": "群聊",
"en_us": "group chat",
"ja_jp": "グループチャット"
},
"owner_id": "4d7a3c6g",
"chat_mode": "group",
"chat_type": "private",
"external": false,
"join_message_visibility": "all_members",
"leave_message_visibility": "all_members",
"membership_approval": "no_approval_required"
}'
响应示例响应示例
{
"code": 0,
"msg": "success",
"data": {
"chat_id": "oc_a0553eda9014c201e6969b478895c230",
"avatar": "https://p3-lark-file.byteimg.com/img/lark-avatar-staging/default-avatar_44ae0ca3-e140-494b-956f-78091e348435~100x100.jpg",
"name": "测试群名称",
"description": "测试群描述",
"i18n_names": {
"zh_cn": "群聊",
"en_us": "group chat",
"ja_jp": "グループチャット"
},
"owner_id": "4d7a3c6g",
"owner_id_type": "user_id",
"add_member_permission": "all members",
"share_card_permission": "allowed",
"at_all_permission": "all members",
"edit_permission": "all members",
"chat_mode": "group",
"chat_type": "private",
"chat_tag": "inner",
"external": false,
"tenant_key": "736588c9260f175e",
"join_message_visibility": "all_members",
"leave_message_visibility": "all_members",
"membership_approval": "no_approval_required",
"moderation_permission": "all_members"
}
}
请求参数
Query 参数
user_id_type
string
可选
示例值:
open_id
set_bot_manager
string
可选
示例值:
false
uuid
string
可选
Header 参数
Authorization
string
必需
默认值:
Bearer {{access_token}}
Content-Type
string
必需
默认值:
application/json; charset=utf-8
Body 参数application/json
返回响应
修改于 2023-01-12 10:10:16