Skip to main content

Add Dataset

Create a new RAG dataset to manage data import sources.

POST
/api/v1/connector/dash/addConnector
cURL
curl -X POST "https://{workspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/connector/dash/addConnector" \
  -H "Authorization: Bearer $DASHSCOPE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "connectorType": "FILE",
    "connectorName": "产品文档数据集",
    "description": "用于导入产品文档的文件数据集",
    "fileConnectorConfig": {
      "storeType": "PLATFORM"
    }
  }'
{
  "code": "Success",
  "status_code": 200,
  "data": {
    "connectorId": "conn_abc123"
  },
  "requestId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
This resource is called a dataset in the console. For API compatibility, the endpoint path, operation name, and parameter names continue to use connector. Currently, only the FILE type is supported for connectorType. When storeType is set to CUSTOM, you must additionally provide regionId and bucketName.

Authorizations

string
header
required

DashScope API Key,在控制台 API Key 页面 获取。

Body

application/json
enum<string>
required

数据集类型,当前仅支持 FILE。

FILE
string
required

数据集名称。

length: 1–20
string
required

数据集描述信息。

length: 1–200
object
required

文件数据集配置。

Response

200-application/json
string

响应码,成功时为 Success。

string

错误或提示信息,成功时为空字符串。

string

请求唯一标识,排查问题时请提供此 ID。

object
integer

业务状态码。成功为 200,参数错误等失败场景为 400。注意失败时 HTTP 状态码仍为 200,需根据本字段与 code 判断结果。