Skip to main content

Update Knowledge Base

Update the name, description, rerank minimum score, and other basic information of a Knowledge Base.

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

FieldRequiredTypeDescription
idYesstringKnowledge Base ID. The parameter name is id — not index_id or indexId.
nameNostringKnowledge 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 (-).
descriptionNostringKnowledge Base description.
rerankMinScoreNonumberMinimum rerank score threshold. Valid range: [0, 1]. Chunks with scores below this value are filtered out.

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.

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

FieldTypeDescription
codestringResponse code. Success when successful.
status_codeintegerHTTP status code.
request_idstringUnique request identifier. Provide this ID when troubleshooting.
successbooleanWhether the request succeeded.
messagestringResponse message. success when successful.
statusstringRequest status: SUCCESS or FAILED.
dataobjectResponse 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).
Managed Agent API
Flow Agent API
Sandbox API
RAG API
Long-term Memory
ParseX API
Security API
Framework Integration