All Products
Search
Document Center

Alibaba Cloud Model Studio:UpdateChunk

Last Updated:Jan 30, 2026

Modifies the content and title of a specified text chunk in the knowledge base, and sets whether the chunk participates in knowledge base retrieval.

Operation description

  • Limits: This operation supports only knowledge base of the document search type. Data query and image Q&A types are not supported.

  • Required permissions:

    • RAM users: Must first obtain the API permissions of Model Studio (such as the AliyunBailianDataFullAccess policy, which includes the sfm:UpdateChunk permission required), and become member of a workspace.
    • Alibaba Cloud account: Has the permission by default, and can call the operation directly.
  • Call method: We recommend using the latest version of the GenAI Service Platform SDK. The SDK encapsulates complex signature computational logic to simplify the call process.

  • Delay: The update takes effect immediately. During peak hours, the update may take place in seconds.

  • Idempotence: This operation is idempotent. If you perform a repeated operation on a chunk that has already been updated, the interface returns a success.

Rate limit: Rate limiting will be triggered if you call this operation frequently. Do not exceed 10 times per second. If limiting is triggered, try again later.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • For mandatory resource types, indicate with a prefix of * .
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
sfm:UpdateChunkupdate
*All Resources
*
    none
none

Request syntax

POST /{WorkspaceId}/chunk/update HTTP/1.1

Request parameters

ParameterTypeRequiredDescriptionExample
PipelineIdstringYes

The knowledge base ID, which is the Data.Id returned by CreateIndex. You can also get it on the Knowledge Base page.

79c0alxxxx
DataIdstringYes

The file ID, which is the FileId returned by AddFile. You can also go to the Application Data page. Click the ID icon next to your file to get its ID.

doc_c134aa2073204a5d936d870bf960f56axxxxxxxx
ChunkIdstringYes

The ID of the text chunk to be modified. You can find it in the Node.Metadata._id field returned by ListChunks.

llm-5ip55o1zrzxx_09fe52x_table_033b551e10024029992e79767b151fxx_10024xx_0
IsDisplayedChunkContentbooleanYes

Specifies whether this text chunk participates in knowledge base retrieval. Valid values:

  • true
  • false

Default value: true.

true
contentstringYes

The new content of the chunk. The content must be between 10 and 6,000 characters in length and cannot exceed the maximum chunk length set when the knowledge base was created.

WorkspaceIdstringYes

The ID of the workspace to which the knowledge base belongs. For more information, see How to use workspace.

llm-3z7uw7fwz0vexxxx
titlestringNo

The new title of the chunk. The title must be 0 to 50 characters in length and can be an empty string. If you specify an empty string, the existing title is cleared. If you do not pass this parameter, the original title remains unchanged.

Response parameters

ParameterTypeDescriptionExample
object

Schema of Response

RequestIdstring

The request ID.

35A267BF-xxxx-54DB-8394-AA3B0742D833
Codestring

The status code.

InvalidParameter
Messagestring

The error message.

Required parameter(%s) missing or invalid, please check the request parameters.
Successboolean

Indications whether the API call is successful. Valid values:

  • true
  • false
true
Databoolean

The data returned if the request is successful.

true
Statusstring

The HTTP status code returned.

200

Examples

Sample success responses

JSONformat

{
  "RequestId": "35A267BF-xxxx-54DB-8394-AA3B0742D833\n",
  "Code": "InvalidParameter\n",
  "Message": "Required parameter(%s) missing or invalid, please check the request parameters.",
  "Success": true,
  "Data": true,
  "Status": 200
}

Error codes

For a list of error codes, visit the Service error codes.