Delete File

Last edited on 2026-03-16

This API should be called on the server side and cannot be called directly on the client side (Mini Program, web page, APP, etc.). For details, please refer to API Call Guide.

API English Name: deleteTcbCloudFile

This API can be used to delete files. If you encounter any issues during use, you can post in the Open Platform Service Provider Zone to discuss.

1. Call Method

HTTPS Call

POST https://api.weixin.qq.com/tcb/batchdeletefile?access_token=ACCESS_TOKEN

Cloud Call

  • This API does not support cloud call.

Third-party Call

  • This API supports third-party platforms on behalf of Merchant call.

  • The permission set ID of this API is: 49

  • After the service provider obtains one of the permission set authorizations, it can use authorizer_access_token to call on behalf of Merchant, for details please refer to Third-party Call documentation.

2. Request Parameters

Query Parameters Query String Parameters

ParameterTypeRequiredDescription
access_tokenstringYesAPI call credential, you can use access_token, authorizer_access_token

Request Body Request Payload

ParameterTypeRequiredDescription
envstringYesCloud environment ID
fileid_listarrayYesList of file IDs

3. Response Parameters

Response Body Response Payload

ParameterTypeDescription
errcodenumberError code
errmsgstringError message
delete_listobjarrayFile list

Res.delete_list(Array) Object Payload

File list

ParameterTypeDescription
fileidstringFile ID
statusnumberStatus
errmsgstringError message

4. Notes

No special notes for this API

5. Code Example

Request Example

{
  "env": "test2-4a89da",
  "fileid_list": [
    "cloud://test2-4a89da.7465-test2-4a89da/A.png"
  ]
}

Response Example

{
  "errcode": 0,
  "errmsg": "ok",
  "delete_list": [
    {
      "fileid": "cloud://test2-4a89da.7465-test2-4a89da/A.png",
      "status": 0,
      "errmsg": "ok"
    }
  ]
}

6. Error Codes

The following is the error code list of this API, other error codes can refer to Common Error Codes; When encountering errors in calling the API, you can use the official API Diagnostic Tool to assist in locating and analyzing problems.

Error CodeError DescriptionSolution
-501002Generic cloud resource error: Cloud response timeout
-1000system errorSystem error
-1system errorThe system is busy. Please try again later.
0okok
40014invalid access_tokenInvalid access_token. Please verify the validity of the access_token (e.g., whether it has expired) or check if the API is being called for the correct Official Account.
40097invalid argsInvalid parameter
40101missing parameterMissing required parameter
41001access_token missingMissing access_token parameter
42001access_token expiredaccess_token has expired. Please check the validity period of the access_token. Refer to the detailed mechanism description in Basic Support - Get access_token.
43002require POST methodPOST request required
44002empty post dataThe POST data package is empty.
47001data format errorFailed to parse JSON/XML content; missing parameters in POST data. Please check and fix, then retry.
85088no qbase privilegeCloud development is not enabled for this APP. END

7. Applicable Scope

This API supports 「Third-party Platform」 account type for proxy calls. For permission sets, please refer to the "Call Method" section. Other account types cannot call unless otherwise specified.