Delete files¶
Delete temporary files, which cannot be recovered after deletion.
POST $CLOUDSIGMA_API_BASE/connectors/file/delete
Before you call this API¶
Configure the regional API endpoint and authentication, and select the target workspace.
Make sure the file is no longer needed before deleting it.
Set the operation-specific values used in the request:
$CONN_FILE_ID: Temporary file ID to delete, passed viaconn_file_id.
Request¶
curl -X POST "$CLOUDSIGMA_API_BASE/connectors/file/delete" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H 'Content-Type: application/json' \
-d "{
\"conn_file_id\": \"$CONN_FILE_ID\"
}"
Request body
Field |
Type |
Is it required |
Description |
|---|---|---|---|
|
string |
Yes |
The ID of the temporary file to be deleted. |
Successful response¶
Returns 200 on success and data is null.
{
"code": "OK",
"msg": "OK",
"data": null
}
The response fields are as follows.
Field |
Type |
Description |
|---|---|---|
|
string |
|
|
string |
|
|
null |
This interface does not return metadata of deleted files. |
Error response¶
{
"code": "ErrParamInvalid",
"msg": "invalid file identifier",
"data": null
}
Common HTTP errors¶
HTTP status code |
error code |
Common causes |
Recommended actions |
|---|---|---|---|
|
|
The JSON request body is invalid. |
Check the JSON format and try again. |
|
|
|
Confirm the file ID; no need to delete the file again if it has already been deleted. |
|
|
The access token is invalid or has expired. |
Try again after updating the access token. |
|
|
The caller does not have permission to delete temporary files. |
Check workspace ID and access permissions. |
|
|
The service is temporarily unable to delete files. |
Keep the desensitization error message and try again. |
Follow-up operations¶
When you need to confirm the deletion result, keep conn_file_id and Preview file or Download file again. Both interfaces return a non-exist error when the temporary file has been deleted.