DeleteFiles

更新时间:
复制 MD 格式

Delete files in batch

Operation description

  • Deleting data tables through the API is not supported. To delete a data table or specific data in a table, go to Application Data.

  • This API is used to delete files in Application Data. It does not affect knowledge bases that have already been built. To delete files in a knowledge base, call the DeleteIndexDocument operation.

  • A RAM user (sub-account) must first obtain the API permissions for Alibaba Cloud Model Studio (requires AliyunBailianDataFullAccess, which already includes the sfm:DeleteFiles permission) and join a workspace before calling this operation. The Alibaba Cloud account (main account) can call this operation directly without authorization. We recommend that you use the latest version of the Alibaba Cloud Model Studio SDK to call this operation.

  • This operation can only delete files whose status is parsing failed (PARSE_FAILED) or parsing succeeded (PARSE_SUCCESS).

  • This operation is idempotent.

Throttling: Frequent calls to this operation are throttled. Do not exceed 10 queries per second (QPS). If you are throttled, try again later.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

No authorization for this operation. If you encounter issues with this operation, contact technical support.

Request syntax

POST /{WorkspaceId}/datacenter/file/delete HTTP/1.1

Path Parameters

Parameter

Type

Required

Description

Example

WorkspaceId

string

Yes

The ID of the workspace to which the category belongs. For information about how to obtain it, see How to use a workspace.

llm-mbhn96xxxx

Request parameters

Parameter

Type

Required

Description

Example

FileIds

array

Yes

The list of IDs of the files to be deleted. A maximum of 20 files can be deleted in a single request.

string

No

The ID of the file to be deleted.

file_xxxx

Response elements

Element

Type

Description

Example

object

Schema of Response

Code

string

The error code.

DataCenter.FileTooLarge

Data

object

The returned data.

DeleteFileResultList

array<object>

The deletion results.

object

The deletion result of a single file.

FileId

string

file_6b193b9b4b1546ef9eaa7340e69adfca_10052857

Status

string

DELETED

Message

string

The error message.

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

RequestId

string

Id of the request

17204B98-7734-4F9A-8464-2446A84821CA

Status

string

The status code returned by the API.

200

Success

boolean

Indicates whether the API call is successful. Valid values:

  • true: The call is successful.

  • false: The call fails.

true

Examples

Success response

JSON format

{
  "Code": "DataCenter.FileTooLarge",
  "Data": {
    "DeleteFileResultList": [
      {
        "FileId": "file_6b193b9b4b1546ef9eaa7340e69adfca_10052857",
        "Status": "DELETED"
      }
    ]
  },
  "Message": "Required parameter(%s) missing or invalid, please check the request parameters.",
  "RequestId": "17204B98-7734-4F9A-8464-2446A84821CA",
  "Status": "200",
  "Success": true
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.