Add or update relationships between a Threat Profile and other objects

🚧

Public Preview

Threat Profile module is provided as a public preview and is subject to change. Use with caution.

This endpoint adds new, or updates existing relationships between a Threat Profile and other objects. Available relationships are described in the Threat Profiles object Relationships section. This endpoint requires objects' descriptors and the user to be the owner or an editor of the Threat Profile.

You can also delete existing relationships between a Threat Profile.

Examples

Add user1 and members of group1 as new viewers to the Threat Profile with 332e02da667746f180a9740e94a3ec98 identifier.

import requests

profile_id = "332e02da667746f180a9740e94a3ec98"
relationship = "viewers"
payload = {
    "data":[
        {
            "type": "user",
            "id": "user1"},
        {
            "type": "group",
            "id": "group1"}
    ]
}
url = f"https://www.virustotal.com/api/v3/threat_profiles/{profile_id}/relationships/{relationship}"
headers = {
    "accept": "application/json","x-apikey": <api-key>
}
response = requests.post(url, json=payload, headers=headers)

Change privileges of user1 and members of group1 from viewers to editors of the Threat Profile with 332e02da667746f180a9740e94a3ec98 identifier.

import requests

profile_id = "332e02da667746f180a9740e94a3ec98"
relationship = "editors"
payload = {
    "data":[
        {
            "type": "user",
            "id": "user1"},
        {
            "type": "group",
            "id": "group1"}
    ]
}
url = f"https://www.virustotal.com/api/v3/threat_profiles/{profile_id}/relationships/{relationship}"
headers = {
    "accept": "application/json","x-apikey": <api-key>
}
response = requests.post(url, json=payload, headers=headers)
Language
Click Try It! to start a request and see the response here!