Skip to main content

机器人管理

机器人管理接口用于创建和管理机器人。所有接口都需要开发者权限。

获取机器人列表

/dev/bot/list
获取机器人列表。

请求参数

参数名类型必选说明
pageinteger页码,默认1
sizeinteger每页数量
GET /dev/bot/list?page=1&size=10
Content-Type: application/json
Authorization: Bearer YOUR_TOKEN

获取机器人详情

/dev/bot/:id
获取指定机器人的详细信息。

请求参数

参数名类型必选说明
idstring机器人ID
GET /dev/bot/bot_123
Content-Type: application/json
Authorization: Bearer YOUR_TOKEN

创建机器人

/dev/bot
创建新的机器人。

请求参数

参数名类型必选说明
namestring机器人名称
descriptionstring机器人描述
configobject机器人配置
POST /dev/bot
Content-Type: application/json
Authorization: Bearer YOUR_TOKEN

{
  "name": "新机器人",
  "description": "这是一个新机器人",
  "config": {
    "type": "customer_service",
    "model": "gpt-4",
    "language": "zh"
  }
}

更新机器人

/dev/bot/:id
更新指定机器人的信息。

请求参数

参数名类型必选说明
idstring机器人ID
namestring机器人名称
descriptionstring机器人描述
configobject机器人配置
PUT /dev/bot/bot_124
Content-Type: application/json
Authorization: Bearer YOUR_TOKEN

{
  "name": "更新后的机器人",
  "description": "这是更新后的机器人描述"
}

删除机器人

/dev/bot/:id
删除指定的机器人。

请求参数

参数名类型必选说明
idstring机器人ID
DELETE /dev/bot/bot_124
Content-Type: application/json
Authorization: Bearer YOUR_TOKEN

错误码说明

错误码说明

错误码说明
400请求参数错误
401未授权或令牌无效
403权限不足(需要开发者权限)
404机器人不存在
422请求参数验证失败
500服务器错误