All Products
Search
Document Center

Alibaba Cloud Model Studio:DeleteChunk

Last Updated:Jan 30, 2026

Deletes a specified text chunk from a knowledge base. The deleted chunk cannot be retrieved or recalled.

Operation description

**

Warning After a text chunk is deleted, it cannot be restored. Proceed with caution.

  • Required permissions:

    • RAM users: Must first obtain the API permissions of Model Studio (such as the AliyunBailianDataFullAccess policy, which includes the sfm:DeleteChunk 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 deleted, 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:DeleteChunkdelete
*All Resources
*
    none
none

Request syntax

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

Request parameters

ParameterTypeRequiredDescriptionExample
PipelineIdstringYes

The knowledge base ID, which is the Data.Id parameter returned by CreateIndex.

79c0alxxxx
WorkspaceIdstringYes

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

llm-3z7uw7fwz0vexxxx
ChunkIdsarrayYes

The list of text chunks to be deleted. You can specify up to 10 chunk IDs at a time.

stringYes

The text chunk ID, which is the _id field in the Metadata of the Node object returned by ListChunks.

llm-5ip55o1zrzxx_09fe52x_table_033b551e10024029992e79767b151fxx_10024xx_0

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.\n",
  "Success": true,
  "Data": true,
  "Status": 200
}

Error codes

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