Skip to main content

DeleteDocument

Deletes a document. After deletion, you cannot view the original document or recall it.

Operation description

Prerequisites
  • You have activated Alibaba Cloud Model Studio and Tongyi Dianjin services.
  • Obtain the workspaceId: obtain the workspace identifier.

Try it now

You can directly run this API in OpenAPI Explorer, saving you the trouble of calculating signatures. After a successful run, OpenAPI Explorer can automatically generate SDK code examples. Try it now

RAM authorization

The following table describes the authorization information of the API. You can use it in the Action element of a RAM policy statement to grant a RAM user or RAM role the permission to call this API. Details are as follows:
  • Operation: the specific permission point.
  • Access level: the access level of each operation. Valid values: Write, Read, or List.
  • Resource type: the resource types that support authorization in the operation. Details are as follows:
    • For required resource types, an asterisk (*) is prefixed.
    • For operations that do not support resource-level authorization, All Resources is used.
  • Condition key: the condition keys defined by the cloud service itself.
  • Dependent operation: other permissions required to successfully perform the operation. The caller must also have the permissions of the dependent operations for the operation to succeed.
OperationAccess levelResource typeCondition keyDependent operation
dianjin:DeleteDocumentnone
*All Resources
*
    None
None

Request syntax

POST /{workspaceId}/api/library/document/delete HTTP/1.1

Request parameters

NameTypeRequiredDescriptionExample value
workspaceIdstringYes

Path parameter. The business space ID.

llm-xxxxx
bodyobjectNo

Request body parameters.

docIdsarrayYes

List of document IDs.

docIdstringNo

Document ID.

1782981430906818562
libraryIdstringYes

Document library ID.

3akzl28vap

Response parameters

NameTypeDescriptionExample value
object

ResultCode

costlong

Time consumed.

null
databoolean

Returned data.

True
dataTypestring

Data type.

null
errCodestring

Error code.

0
messagestring

Error message.

ok
requestIdstring

Request ID.

67C7021A-D268-553D-8C15-A087B9604028
successboolean

Indicates whether the operation is successful.

true
timestring

Timestamp.

2024-04-24 11:54:34

Examples

Success response example JSON format
{
  "cost": 0,
  "data": true,
  "dataType": null,
  "errCode": 0,
  "message": "ok",
  "requestId": "67C7021A-D268-553D-8C15-A087B9604028",
  "success": true,
  "time": "2024-04-24 11:54:34"
}

Error codes

Visit the Error Center to view more error codes.