Update Dataset ACL

Updated at:

Enable or disable ACL permissions for a file dataset. After disabling, the current permissions of files in the dataset are cleared.

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/updateConnector

Enable or disable ACL permissions for a target FILE dataset in the current Workspace.

NoteWhen aclEnabled is true, the eligibility check is the same as when creating a dataset. When false, the server first queries RAG for Knowledge Base references. After disabling succeeds, the current permissions of files in the dataset are cleared.

Request body

FieldRequiredTypeDescription
connectorIdYesstringID of the target FILE dataset in the current Workspace.
aclEnabledYesbooleantrue enables ACL; the eligibility check is the same as when creating a dataset. false disables ACL; the server first queries RAG for Knowledge Base references. After disabling succeeds, the current permissions of files in the dataset are cleared.

Request example

curl -X POST "$BASE_URL/api/v1/connector/dash/updateConnector" \
  -H "Authorization: Bearer $BAILIAN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "connectorId": "conn_abc123",
    "aclEnabled": true
  }'

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.

{
  "code": "Success",
  "status_code": 200,
  "data": {
    "connectorId": "conn_abc123"
  },
  "requestId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}

Response fields

FieldTypeDescription
codestringResponse code. Success on success. On failure, returns a business error code.
messagestringError or informational message; an empty string on success. On failure, describes the reason.
requestIdstringUnique request identifier. Include this ID when reporting an issue.
dataobjectUpdate result. Sub-field: connectorId (string, ID of the updated dataset, returned on success).
statusintegerBusiness 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 codeError code codeDescription
400InvalidParameterInvalid request parameters. Example message: Required parameter missing or invalid.
401InvalidApiKeyAuthentication failed; the API key is invalid or missing. Example message: Invalid API-key provided.

On business failures the HTTP status code remains 200. Check status and code in the response body to determine the result.

If enabling ACL fails, message may indicate that the Workspace has no eligible enterprise Knowledge Base (当前工作空间没有符合条件的企业级知识库,无法开启 ACL) or that the eligibility check is temporarily unavailable (暂时无法查询开启资格,请稍后重试). If disabling ACL fails, message may indicate that the dataset is referenced by a Knowledge Base (数据集已被知识库引用,无法关闭 ACL) or that the reference check is temporarily unavailable (暂时无法查询知识库引用,请稍后重试).