Skip to main content

Update Knowledge Base

Update Knowledge Base basics, or enable/disable Wiki or modify Wiki configuration

POST
/api/v1/indices/rag/index/update
cURL
curl -X POST "https://{workspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/indices/rag/index/update" \
  -H "Authorization: Bearer $DASHSCOPE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "id": "your_index_id",
    "description": "Updated Knowledge Base description"
  }'
{
  "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"
}
The parameter is id — not index_id or indexId. Watch for the naming difference compared to other endpoints.
Update the name, description, minimum rerank score, and other basics of a Knowledge Base; you can also enable/disable Wiki or modify Wiki configuration.
Wiki currently supports only auto-update mode: wikiAutoUpdate must be true. Enabling Wiki requires an enterprise knowledge base with knowledge scene basic_document_qa; enabling and disabling are asynchronous. When modifying wikiConfig on an already-enabled knowledge base, only the provided keys change, omitted keys keep their values, and changes take effect immediately.Re-enabling after disabling requires the full wikiConfig.extraction again (the configuration is not preserved across disable). Passing wikiConfig without wikiEnabled on a not-enabled knowledge base succeeds but does not enable Wiki (silent no-op). Enabling is asynchronous with no status-query endpoint; confirm the search_type=wiki service is published via List Agents before a trial retrieval.
wikiConfig: {} returns BadRequest.EmptyInput. Omitting all Wiki keys or setting all of them to null leaves the configuration unchanged.Disabling Wiki irreversibly deletes all Wiki Pages, the ontology knowledge graph, manual edits, and revision history. Re-enabling requires the full configuration again and regenerates all documents with fees. Pages receive new Page IDs and start at V1. The original Wiki retrieval service and its agent_id are preserved, and the same agent_id becomes usable again after re-enabling completes.

Error codes

This endpoint may return the following error codes; for detailed triggers and message, see the error reference.
codestatus_codeTrigger
InvalidParameter400wikiAutoUpdate missing or not true when enabling
BadRequest.EmptyInput400wikiConfig is an empty object {}
WikiEditionNotSupported400The knowledge base is not enterprise when enabling; or downgrading to Standard while requesting enable
WikiSceneNotSupported400The knowledge scene is not basic_document_qa when enabling
WikiConfigInvalid400An invalid Wiki configuration key was provided; locate it by the field name in message
WikiOperationConflict409Requesting disable while enabling is in progress, requesting enable while disabling is in progress, or downgrading while Wiki is being enabled

Authorizations

string
header
required

DashScope API Key, obtained from the API Key page in the console.

Body

application/json
string
required

Knowledge Base ID. The parameter name is id, not index_id or indexId.

string

Knowledge Base description.

string

Knowledge Base name. 1 to 20 characters. Supports Unicode letter characters (including English, Chinese, and digits) and may contain a colon (:), underscore (_), period (.), or hyphen (-).

length: 1–20
number

Minimum Rerank score threshold, in the range [0, 1]. Chunks scoring below this value are filtered out.

0 <= x <= 1
boolean | null

Wiki switch. Omitted or null leaves it unchanged. true enables (requires enterprise/Flagship and basic_document_qa); false disables. Both operations are asynchronous; success means accepted. Disabling irreversibly deletes all Wiki Pages, the ontology graph, manual edits, and revision history. Re-enabling requires full configuration and regenerates all documents with fees; Pages get new IDs starting at V1. The original Wiki retrieval service and agent_id are preserved, and the same agent_id becomes usable again after re-enabling completes.

enum<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. Existing documents are submitted for generation automatically, and newly imported documents are submitted after import completes.

true,null
object | null

Wiki configuration. Required with extraction when enabling. For an already-enabled knowledge base, only provided keys change, omitted keys remain, and changes take effect immediately without re-enabling. Disabling does not preserve configuration; re-enabling requires full wikiConfig.extraction or returns WikiConfigInvalid. Passing only wikiConfig without wikiEnabled on a disabled knowledge base succeeds but does not enable Wiki. An empty object {} returns BadRequest.EmptyInput; omitting all Wiki keys or setting all to null leaves configuration unchanged. Validation messages use snake_case field names.

Response

200-application/json
string

Response code. Success on success.

integer

HTTP status code.

string

Unique request identifier. Include this ID when reporting an issue.

object
boolean

Whether the request succeeded.

string

Informational message; success on success.

string

Request status: SUCCESS or FAILED.