Revoke viewer or editor permissions on a private file from users (including service accounts) in the owning group or from the owning group itself.
Special privileges requiredPrivate Scanning is only available to users with the Google Threat Intelligence (Google TI) Enterprise or Enterprise Plus licenses.
Use this endpoint to revoke viewer or editor permissions on a Private File from specific users (including service accounts) in the owning Google TI group or from the owning group itself.
This endpoint is restricted to the file's owner, group administrators of the owning group, and existing editors. The operation is idempotent and returns 200 OK with an empty response body on success.
Request body requiredThis endpoint requires a JSON request body containing the descriptors to remove, even though it uses the
DELETEmethod.
This is an example request body:
{
"data": [
{
"id": "<user_id>",
"type": "user"
},
{
"id": "<group_id>",
"type": "group"
}
]
}To grant access, see Grant viewer or editor access to a private file. For full sharing rules, see Sharing private analyses.
Examples
Revoke viewer access from the owning group:
import requests
file_id = "275a021bbfb6489e54d471899f7db9d1663fc695ec2fe2a2c4538aabf651fd0f"
url = f"https://www.virustotal.com/api/v3/private/files/{file_id}/relationships/viewers"
payload = {
"data": [
{"type": "group", "id": "my_group_id"}
]
}
headers = {
"x-apikey": "<api-key>",
"content-type": "application/json",
}
response = requests.delete(url, json=payload, headers=headers)Revoke editor access from a user:
import requests
file_id = "275a021bbfb6489e54d471899f7db9d1663fc695ec2fe2a2c4538aabf651fd0f"
url = f"https://www.virustotal.com/api/v3/private/files/{file_id}/relationships/editors"
payload = {
"data": [
{"type": "user", "id": "analyst_username"}
]
}
headers = {
"x-apikey": "<api-key>",
"content-type": "application/json",
}
response = requests.delete(url, json=payload, headers=headers) 200200 OK (empty response body)