Upload a file or create a new folder

This endpoint can be used to create or overwrite an already existing file using a multipart/form-data encoded request. The file has to be smaller than 32MB, for bigger files use a URL returned by /items/upload_url.

The parameter path indicates the path relative to your monitor root folder where the file is going to be stored. This path must include the name of the file being uploaded. For example /folder/myfile.exe. You can also provide a MonitorItemID representing a path to a file previously uploaded to VT Monitor and this will upload the new file to this path, overwriting the file referenced by the MonitorItemID.

To create a new folder just make a request with the desired path or item ending it with a slash (/), for example /mynewfolder/.

The MonitorItemID returned in the response can be used at a later stage to operate with the given file or folder and request its analysis information.

import requests

session = requests.Session()
session.headers = {'X-Apikey': '<api-key>'}

url = "https://www.virustotal.com/api/v3/monitor/items"

files = {'file': ('filepath', open('<filename>', 'rb'), 'application/octet-stream')}
args = {'path': '<monitor-path>'}

response = session.post(url, files=files, data=args)
print(response.text)
curl --request POST \
  --url 'https://www.virustotal.com/api/v3/monitor/items' \
  --header 'X-Apikey: <api-key>' \
  --form 'path=<monitor-folder-ending-with-slash>' \
import requests

session = requests.Session()
session.headers = {'X-Apikey': '<api-key>'}

url = "https://www.virustotal.com/api/v3/monitor/items"
args = {'path': '<monitor-folder-ending-with-slash>'}

response = session.post(url, data=args)
print(response.text)
{
 "data": {
  "type": "monitor_item", 
  "id": "[MONITOR-ID]"
 }
}
Language
Click Try It! to start a request and see the response here!