logo
开发者文档
搜索
预检 Agent 导入文件

预检 Agent 导入文件

支持预检 .bot 文件是否可导入,不写入业务资源。

可以通过该接口,预检 .bot 文件是否可导入。预检只解析与安全扫描文件,不写入 Agent、API Key、技能、数据组或插件关系。

请求方式

POST

调用地址

https://api.${endpoint}/v1/org/agent/import/precheck

调用验证

使用账号级 DevKey / DevSecret 的 Basic 鉴权,并要求调用账号具备组织 Agent 创建权限。

请求

请求示例

curl -X POST 'https://api.${endpoint}/v1/org/agent/import/precheck' \ -H 'Authorization: Basic ${BASIC_TOKEN}' \ -F 'file=@/path/to/agent.bot' \ -F 'org_id=p-xxxx'
                      
                      curl -X POST 'https://api.${endpoint}/v1/org/agent/import/precheck' \
  -H 'Authorization: Basic ${BASIC_TOKEN}' \
  -F 'file=@/path/to/agent.bot' \
  -F 'org_id=p-xxxx'

                    
此代码块在浮窗中显示

请求头

字段 类型 说明
Authorization Basic ${BASIC_TOKEN} 使用 DevKey:DevSecret Base64 后的 Basic Token。
Content-Type multipart/form-data 文件上传表单。

请求参数(Form Data)

参数 类型 说明 required
file File .bot 文件。 true
org_id String 组织 ID。 true

响应

响应示例

{ "code": 0, "message": "OK", "data": { "valid": true, "error_message": null, "export_type": "BOT", "bot_type": "Agent", "name": "Imported Agent", "logo": "https://cdn.example.com/agent.png", "introduction": "Agent introduction", "format_version": "1.0" } }
                      
                      {
  "code": 0,
  "message": "OK",
  "data": {
    "valid": true,
    "error_message": null,
    "export_type": "BOT",
    "bot_type": "Agent",
    "name": "Imported Agent",
    "logo": "https://cdn.example.com/agent.png",
    "introduction": "Agent introduction",
    "format_version": "1.0"
  }
}

                    
此代码块在浮窗中显示

成功响应

字段 类型 说明
valid Boolean 文件是否可导入。
error_message String 不可导入时的错误信息。
export_type String 导出文件类型。
bot_type String Agent 类型:AgentFlowAgentLoopAgentAudio
name String 文件内资源名称。
logo String 图标 URL。
introduction String 简介。
format_version String 文件格式版本。

失败响应

字段 类型 说明
code Integer 错误码。
message String 错误详情。

状态码

状态码 说明
200 成功
400 参数错误
401 未授权
403 权限不足
429 请求过于频繁
500 服务器错误