Grant viewer or editor permissions on a private URL to users (including service accounts) in the owning group or to 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 grant viewer or editor permissions on a Private URL (see URL identifiers) to:
- Individual users (including service accounts) in the owning Google TI group.
- The owning group itself.
This endpoint is restricted to the URL's owner, group administrators of the owning group, and existing editors. The owner relationship is read-only, and the URL's owner cannot be added to viewers or editors.
Adding an existing viewer to editors (or an existing editor to viewers) automatically moves them to the new role. The operation is idempotent and returns 200 OK with an empty response body on success.
This is an example request body:
{
"data": [
{
"id": "<user_id>",
"type": "user"
},
{
"id": "<group_id>",
"type": "group"
}
]
}To revoke access, see Revoke viewer or editor access from a private URL. For full sharing rules, see Sharing private analyses.
Examples
Grant editor access to a user in the owning group:
import requests
url_id = "100680ad546ce6a577f42f52df33b4cfdca756859e664b8d7de329b150d09ce9"
url = f"https://www.virustotal.com/api/v3/private/urls/{url_id}/relationships/editors"
payload = {
"data": [
{"type": "user", "id": "analyst_username"}
]
}
headers = {
"x-apikey": "<api-key>",
"content-type": "application/json",
}
response = requests.post(url, json=payload, headers=headers)Grant viewer access to the owning group:
import requests
url_id = "100680ad546ce6a577f42f52df33b4cfdca756859e664b8d7de329b150d09ce9"
url = f"https://www.virustotal.com/api/v3/private/urls/{url_id}/relationships/viewers"
payload = {
"data": [
{"type": "group", "id": "my_group_id"}
]
}
headers = {
"x-apikey": "<api-key>",
"content-type": "application/json",
}
response = requests.post(url, json=payload, headers=headers) 200200 OK (empty response body)