Prerequisites
Get an API key and a workspace ID, and configure authentication first. See API overview and Authentication.
Endpoint
POST /api/v1/indices/rag/index/update
Update the name, description, rerank minimum score, and other basic information of a Knowledge Base. Fields such as DenseSimilarityTopK, SparseSimilarityTopK, and PipelineCommercialType are specific to POP and are not supported by the REST endpoint — do not pass them.
The parameter is id — not index_id or indexId. Watch for the naming difference compared to other endpoints.
Request body
| Field | Required | Type | Description |
|---|
id | Yes | string | Knowledge Base ID. The parameter name is id — not index_id or indexId. |
name | No | string | Knowledge Base name. 1-20 characters; supports Unicode letter category characters (including English letters, Chinese characters, digits, etc.), and may contain half-width colons (:), underscores (_), half-width periods (.), or hyphens (-). |
description | No | string | Knowledge Base description. |
rerankMinScore | No | number | Minimum rerank score threshold. Valid range: [0, 1]. Chunks with scores below this value are filtered out. |
Wiki configuration parameters
Use this endpoint to enable or disable Wiki, or modify Wiki configuration. Enabling Wiki requires a Flagship knowledge base (enterprise) with knowledge scene basic_document_qa. For the feature and billing, see Wiki and Ontology Knowledge Graph.
| Field | Required | Type | Description |
|---|
wikiEnabled | No | boolean | Wiki switch. Omitted or null leaves the switch unchanged; true enables, false disables. Both enabling and disabling are asynchronous |
wikiAutoUpdate | Conditional | boolean | Wiki auto-update switch. Omitted or null leaves it unchanged; only auto-update mode is supported, so it must be true; required when wikiEnabled is true |
wikiConfig.extraction.synthesisModelId | Conditional | string | Wiki extraction model. Required when enabling; one of qwen3.8-flash, qwen3.8-max, qwen3.7-plus. When modifying an already-enabled knowledge base, omitted means unchanged; if provided it must not be blank |
wikiConfig.extraction.extractionGranularity | Conditional | string | Extraction granularity. Required when enabling, no default; one of focused, standard, exhaustive. When modifying an already-enabled knowledge base, omitted means unchanged |
wikiConfig.extraction.contentInstructions | No | string | Wiki content generation requirements. An empty string clears the item; omitted means unchanged; up to 4000 characters |
wikiConfig.extraction.extractionInstructions | No | string | Wiki extraction focus. An empty string clears the item; omitted means unchanged; up to 4000 characters |
When enabling Wiki, wikiConfig is required and must include the extraction group. When modifying an already-enabled knowledge base, only the provided keys change, omitted keys keep their values, Wiki is not re-enabled, and changes take effect immediately. Easy-to-get-wrong combinations (all verified): re-enable after disable requires the full wikiConfig.extraction again (the configuration is not preserved across disable), otherwise WikiConfigInvalid; passing wikiConfig without wikiEnabled on a not-enabled knowledge base succeeds but does not enable Wiki (silent no-op); passing an empty wikiConfig: {} returns BadRequest.EmptyInput — omitting all keys or passing all null means unchanged.
Request example
curl -X POST "$BASE_URL/api/v1/indices/rag/index/update" \
-H "Authorization: Bearer $BAILIAN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"id": "your-kb-id",
"name": "your-kb-name",
"description": "your-kb-description",
"rerankMinScore": 0.01
}'
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.
Modify Wiki configuration:
curl -X POST "$BASE_URL/api/v1/indices/rag/index/update" \
-H "Authorization: Bearer $BAILIAN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"id": "your-kb-id",
"wikiConfig": {
"extraction": {
"synthesisModelId": "qwen3.8-max",
"extractionGranularity": "standard",
"contentInstructions": "Use concise English and prioritize core components and processing flows."
}
}
}'
Disable Wiki:
curl -X POST "$BASE_URL/api/v1/indices/rag/index/update" \
-H "Authorization: Bearer $BAILIAN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"id": "your-kb-id",
"wikiEnabled": false
}'
Response example
Returns 200 on success.
{
"code": "Success",
"status_code": 200,
"data": {
"updated_at": 1782191157000,
"created_at": 1782180218000,
"id": "your-kb-id"
},
"success": true,
"message": "success",
"request_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"status": "SUCCESS"
}
Response fields
| Field | Type | Description |
|---|
code | string | Response code. Success when successful. |
status_code | integer | HTTP status code. |
request_id | string | Unique request identifier. Provide this ID when troubleshooting. |
success | boolean | Whether the request succeeded. |
message | string | Response message. success when successful. |
status | string | Request status: SUCCESS or FAILED. |
data | object | Response data. Sub-fields: id (string, Knowledge Base ID), updated_at (integer, update time as a Unix timestamp in milliseconds), created_at (integer, creation time as a Unix timestamp in milliseconds). |
Error codes
Wiki-related error codes are below; for general errors see Knowledge API error codes.
| HTTP status | Error code (code) | Description |
|---|
| 400 | Index.WikiEditionNotSupported | The knowledge base is not Flagship when enabling; or downgrading to Standard while requesting enable |
| 400 | Index.WikiSceneNotSupported | The knowledge scene is not basic_document_qa when enabling |
| 400 | Index.WikiConfigInvalid | Invalid Wiki configuration key; locate by the field name in message |
| 409 | Index.WikiOperationConflict | Requesting disable while enabling is in progress, requesting enable while disabling is in progress, or downgrading while Wiki is being enabled |
| 400 | Index.InvalidParameter | wikiAutoUpdate missing or not true when enabling |
| 400 | Index.BadRequest.EmptyInput | wikiConfig passed as an empty object {} |
Disabling Wiki deletes all generated Wiki Pages and the ontology knowledge graph in the knowledge base (including manual edits and revision history) and cannot be undone. Re-enabling requires the full configuration again, regenerates all documents with token fees, and Pages get new Page IDs starting from V1. The already-created Wiki retrieval service and its agent_id are preserved, and the original agent_id becomes usable again once re-enabling completes. See Disable Wiki.