2.8 Delete rescan task

Request

Value

Method

DELETE

URL

https://api.metadefender.com/v4/file/schedule/:fileId

Summary

Delete a periodic rescan task using its "file_id". This applies to the active periodic rescans that were scheduled using the /v4/file endpoint.

Request

URL Parameters

 

Description

Example

:fileId

Get from retrieving the Active rescan tasks

bzE5MDEyM1NKZmxDRjY2SG1F

Header Parameters

 

Description

Allowed Values

Required

apikey

Gives rights to use the endpoint (token authentication) (API Authentication Mechanisms)

apikey

YES

Response

HTTP Status Codes

Please refer to Status Codes for more information.

Body

Example of a successful request:

{
"message": "bzE5MDEyM1NKZmxDRjY2SG1F was successfully deleted."
}

Example of a failed request:

{
"error": {
"code": 404001,
"messages": [
"There was no task with the given id."
]
}
}

Descriptions of responses:

message

Describes the completed operation

Errors

Please refer to Errors for more information.

Sample code (Node.js)

var http = require("https");
 
var options = {
"method": "DELETE",
"hostname": [
"api",
"metadefender",
"com"
],
"path": [
"v4",
"file",
"schedule",
"bzE5MDEyM1NKZmxDRjY2SG1F"
],
"headers": {
"apikey": process.env.APIKEY
}
};
 
var req = http.request(options, function (res) {
var chunks = [];
 
res.on("data", function (chunk) {
chunks.push(chunk);
});
 
res.on("end", function () {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
});
 
req.end();

Sample code (cURL)

curl -X DELETE \
https://api.metadefender.com/v4/file/schedule/bzE5MDEyM1NKZmxDRjY2SG1F \
-H "apikey: ${APIKEY}"