Create a dataset for managing data import sources.
Prerequisites
You have an Alibaba Cloud Model Studio API key (see the API Key page in the console) and authentication configured. For details, see Knowledge (formerly RAG) API overview and Authentication. Data import endpoints use the same base URL and authentication as other Knowledge (formerly RAG) APIs, with the path prefix /api/v1/connector/dash/.
Endpoint
POST /api/v1/connector/dash/addConnector
Create a dataset for managing data import sources.
Only
FILE is currently supported for connectorType. When storeType is CUSTOM, you must also pass regionId and bucketName.Request body
| Field | Required | Type | Description |
|---|---|---|---|
connectorType | Yes | string | Dataset type. Only FILE is supported. |
connectorName | Yes | string | Dataset name, 1 to 20 characters. |
description | Yes | string | Dataset description, 1 to 200 characters. |
fileConnectorConfig | Yes | object | File dataset configuration. Sub-fields: storeType (string, required, storage type — PLATFORM (platform-managed) or CUSTOM (your own OSS)), regionId (string, OSS region ID. Required when storeType is CUSTOM), bucketName (string, OSS bucket name. Required when storeType is CUSTOM). |
Request example
BASE_URL is https://{workspace_id}.cn-beijing.maas.aliyuncs.com ({workspace_id} is the Workspace ID), and BAILIAN_API_KEY is your Alibaba Cloud Model Studio API key.
Response example
Returns 200 on success.
Response fields
| Field | Type | Description |
|---|---|---|
code | string | Response code. Success on success. |
message | string | Error or informational message; an empty string on success. |
requestId | string | Unique request identifier. Include this ID when reporting an issue. |
data | object | Creation result. Sub-field: connectorId (string, ID of the new dataset). |
status | integer | Business status code. 200 on success, 400 for failures such as invalid parameters. Note that the HTTP status code remains 200 even on failure, so rely on this field and code to determine the result. |
Error codes
| HTTP status code | Error code code | Description |
|---|---|---|
| 400 | InvalidParameter | Invalid request parameters. Example message: Required parameter missing or invalid. |
| 401 | InvalidApiKey | Authentication failed; the API key is invalid or missing. Example message: Invalid API-key provided. |
status and code in the response body to determine the result.