post
https://www.virustotal.com/api/v3/threat_profiles//relationships/recommendations
Use this endpoint to add Threat objects (Threat Actors, Malware Families, Software or Toolkits, Campaigns, IoC Collections, Reports and Vulnerabilities) to a certain Threat Profile.
This endpoint requires objects' descriptors and the user to be the owner or an editor of the Threat Profile.
Examples
Add the IoC collection with alienvault_6603ebc9f7d8b30ccfe70c54 identifier and the cve-2024-11820 vulnerability to the 332e02da667746f180a9740e94a3ec98 Threat Profile.
import requests
profile_id = "332e02da667746f180a9740e94a3ec98"
payload = {
"data":[
{
"type": "collection",
"id": "alienvault_6603ebc9f7d8b30ccfe70c54"},
{
"type": "collection",
"id": "vulnerability--cve-2024-11820"}
]
}
url = f"https://www.virustotal.com/api/v3/threat_profiles/{profile_id}/relationships/recommendations"
headers = {
"accept": "application/json",
"x-apikey": <api-key>,
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)