Skip to main content
数据导入

新增类目

在当前业务空间下创建新的类目,用于组织和管理数据文件。

前提

已获取阿里云百炼 API Key(控制台 API Key 页面)并完成鉴权配置,详见 RAG API 概览与鉴权。数据导入接口与其他 RAG API 使用相同的 Base URL 与鉴权方式,路径前缀为 /api/v1/connector/dash/。

接口

POST /api/v1/connector/dash/addCategory 在当前业务空间下创建新的类目,用于组织和管理数据文件。

请求体

字段必填类型说明
categoryName是string类目名称,长度 1~20 个字符。
categoryType是string类目类型,仅支持 UNSTRUCTURED。
parentCategoryId否string父类目 ID,创建子类目时传入。
connectorId否string连接器 ID,将类目关联到指定连接器。

请求示例

curl -X POST "$BASE_URL/api/v1/connector/dash/addCategory" \
  -H "Authorization: Bearer $BAILIAN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "categoryName": "产品文档",
    "categoryType": "UNSTRUCTURED"
  }'
其中 BASE_URL 为 https://{workspace_id}.cn-beijing.maas.aliyuncs.com({workspace_id} 为业务空间 ID),BAILIAN_API_KEY 为阿里云百炼 API Key。

响应示例

成功返回 200。
{
  "code": "Success",
  "message": "",
  "messageUnmodified": false,
  "requestId": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
  "data": {
    "categoryId": "cate_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx_xxxxxx",
    "categoryName": "_tmp_example"
  },
  "status": 200
}

响应字段

字段类型说明
codestring响应码,成功时为 Success。
messagestring错误或提示信息,成功时为空字符串。
requestIdstring请求唯一标识,排查问题时请提供此 ID。
dataobject创建结果。子字段 categoryId(string,新创建的类目 ID)、categoryName(string,类目名称)。
statusinteger业务状态码。成功为 200,参数错误等失败场景为 400。注意失败时 HTTP 状态码仍为 200,需根据本字段与 code 判断结果。

错误码

HTTP 状态码错误码 code说明
400InvalidParameter请求参数无效。message 示例:Required parameter missing or invalid.
401InvalidApiKey鉴权失败,API Key 无效或缺失。message 示例:Invalid API-key provided.
业务失败时 HTTP 状态码仍为 200,需根据响应体中的 status 与 code 判断结果。
Managed Agents
Sandbox
Security
应用调用
长期记忆
ParseX
框架