The example below demonstrates how to retrieve a specific Victim Resource from the ThreatConnect platform:

# replace the line below with the standard, TC script heading described here:# https://docs.threatconnect.com/en/latest/python/quick_start.html#standard-script-heading...tc=ThreatConnect(api_access_id,api_secret_key,api_default_org,api_base_url)# instantiate Victims objectvictims=tc.victims()owner='Example Community'victim_id=123456# set a filter to retrieve the Victim with the id: 123456filter1=victims.add_filter()filter1.add_owner(owner)filter1.add_id(victim_id)try:# retrieve the Victimvictims.retrieve()exceptRuntimeErrorase:print('Error: {0}'.format(e))sys.exit(1)try:# prove there is only one Victim retrievedassertlen(victims)==1exceptAssertionErrorase:# if the Victim doesn't exist in the given owner, raise an errorprint('AssertionError: The victim with ID {0} was not found in the "{1}" owner. '.format(victim_id,owner)+'Try changing the `owner` variable to the name of an owner in your instance of ThreatConnect '+'and/or set the `victim_id` variable to the ID of a Victim that exists in the given owner.')sys.exit(1)# if the Victim was found, print some information about itforvictiminvictims:print(victim.id)print(victim.name)print(victim.nationality)print(victim.org)print(victim.suborg)print(victim.work_location)print(victim.weblink)print('')

Note

If you get an AssertionError when running this code, you likely need to change the name of the owner variable so that it is the name of an owner in your instance of ThreatConnect and/or you need to change the victim_id variable so that it is the ID of a Victim that exists in the given owner.

The example below demonstrates how to retrieve multiple Victim Resources from the ThreatConnect platform:

# replace the line below with the standard, TC script heading described here:# https://docs.threatconnect.com/en/latest/python/quick_start.html#standard-script-heading...tc=ThreatConnect(api_access_id,api_secret_key,api_default_org,api_base_url)# instantiate Victims objectvictims=tc.victims()owner='Example Community'# set a filter to retrieve all Victims from the given owner that have the tag: 'Example'filter1=victims.add_filter()filter1.add_owner(owner)filter1.add_tag('Example')try:# retrieve the Victimsvictims.retrieve()exceptRuntimeErrorase:print('Error: {0}'.format(e))sys.exit(1)# iterate through the retrieved Victims and print their propertiesforvictiminvictims:print(victim.id)print(victim.name)print(victim.nationality)print(victim.org)print(victim.suborg)print(victim.work_location)print(victim.weblink)print('')

The example below demonstrates how to create a Victim Resource in the ThreatConnect platform:

# replace the line below with the standard, TC script heading described here:# https://docs.threatconnect.com/en/latest/python/quick_start.html#standard-script-heading...tc=ThreatConnect(api_access_id,api_secret_key,api_default_org,api_base_url)# instantiate Victims objectvictims=tc.victims()owner='Example Community'# create a new victim named 'Robin Scherbatsky' in the given ownervictim=victims.add('Robin Scherbatsky',owner)try:# create the Victimvictim.commit()exceptRuntimeErrorase:print('Error: {0}'.format(e))sys.exit(1)

Note

In the prior example, no API calls are made until the commit() method is invoked.

The example below demonstrates how to update a Victim Resource in the ThreatConnect platform:

# replace the line below with the standard, TC script heading described here:# https://docs.threatconnect.com/en/latest/python/quick_start.html#standard-script-heading...tc=ThreatConnect(api_access_id,api_secret_key,api_default_org,api_base_url)# instantiate Victims objectvictims=tc.victims()owner='Example Community'# create a Victim object with the name: 'Updated Victim'victim=victims.add('Updated Victim',owner)# set the id of the new Victim object to that of an existing Victimvictim.set_id(123456)# you can update the Victim metadata as described here: https://docs.threatconnect.com/en/latest/python/victims/victims.html#victim-metadatatry:# this will change the name of the Victim with id 123456 to: 'Updated Victim'victim.commit()exceptRuntimeErrorase:print('Error: {0}'.format(e))sys.exit(1)

Note

In the prior example, no API calls are made until the commit() method is invoked.

The example below demonstrates how to delete a Victim Resource from the ThreatConnect platform:

# replace the line below with the standard, TC script heading described here:# https://docs.threatconnect.com/en/latest/python/quick_start.html#standard-script-heading...tc=ThreatConnect(api_access_id,api_secret_key,api_default_org,api_base_url)# instantiate Victims objectvictims=tc.victims()owner='Example Community'# create an empty Victim objectvictim=victims.add('',owner)# set the id of the empty Victim object to the id of an existing Victim to deletevictim.set_id(123456)try:# delete the Victimvictim.delete()exceptRuntimeErrorase:print(e)sys.exit(1)

Note

In the prior example, no API calls are made until the delete() method is invoked.

The code snippet below demonstrates how to view Groups and Indicators which are associated with a given Victim in ThreatConnect. This example assumes there is a Victim with an ID of 123456 in the target owner. To test this code snippet, change the victim_id variable.

Note

It is not possible to associate an Indicator directly with a Victim in ThreatConnect. The code below returns Indicators that share a Group association with the given Victim. In the image below, the Victim and Indicator are not directly associated, but are both associated with the same Group. Therefore, the Indicator would be returned when iterating through victim.indicator_associations.

# replace the line below with the standard, TC script heading described here:# https://docs.threatconnect.com/en/latest/python/quick_start.html#standard-script-heading...tc=ThreatConnect(api_access_id,api_secret_key,api_default_org,api_base_url)# define the ID of the victim we would like to retrievevictim_id=123456# create a victims objectvictims=tc.victims()# set a filter to retrieve the victim with the id: 123456filter1=victims.add_filter()filter1.add_id(victim_id)try:# retrieve the Victimsvictims.retrieve()exceptRuntimeErrorase:print('Error: {0}'.format(e))sys.exit(1)# iterate through the Victimsforvictiminvictims:print(victim.name)# iterate through all associated groupsforassociated_groupinvictim.group_associations:# print details about the associated groupprint(associated_group.id)print(associated_group.name)print(associated_group.resource_type)print(associated_group.owner_name)print(associated_group.date_added)print(associated_group.weblink)print('')# iterate through all associated indicatorsforassociated_indicatorinvictim.indicator_associations:# print details about the associated indicatorprint(associated_indicator.id)print(associated_indicator.indicator)print(associated_indicator.type)print(associated_indicator.description)print(associated_indicator.owner_name)print(associated_indicator.rating)print(associated_indicator.confidence)print(associated_indicator.date_added)print(associated_indicator.last_modified)print(associated_indicator.weblink)print('')

Note

When the group_associations and indicator_associations properties are referenced, an API request is immediately invoked.

The code snippet below demonstrates how to create an association between a Victim and another Group in ThreatConnect. This example assumes there is a Victim with an ID of 123456 and an Incident with an ID of 654321 in the target owner. To test this code snippet, change the victim_id and incident_id variables.

fromthreatconnect.Config.ResourceTypeimportResourceType# replace the line below with the standard, TC script heading described here:# https://docs.threatconnect.com/en/latest/python/quick_start.html#standard-script-heading...tc=ThreatConnect(api_access_id,api_secret_key,api_default_org,api_base_url)# define the ID of the victim we would like to retrievevictim_id=123456# define the ID of the incident we would like to associate with the victimincident_id=654321# create a victims objectvictims=tc.victims()# set a filter to retrieve the victim with the id: 123456filter1=victims.add_filter()filter1.add_id(victim_id)try:# retrieve the Victimsvictims.retrieve()exceptRuntimeErrorase:print('Error: {0}'.format(e))sys.exit(1)# iterate through the Victimsforvictiminvictims:print(victim.name)# create an association between this victim and the incidentvictim.associate_group(ResourceType.INCIDENTS,incident_id)# commit the changes to ThreatConnectvictim.commit()

Note

In the prior example, no API calls are made until the commit() method is invoked.

The code snippet below demonstrates how to remove an association between a Victim and another Group. This example assumes there is a Victim with an ID of 123456 and an Incident with an ID of 654321 in the target owner. To test this code snippet, change the victim_id and incident_id variables.

fromthreatconnect.Config.ResourceTypeimportResourceType# replace the line below with the standard, TC script heading described here:# https://docs.threatconnect.com/en/latest/python/quick_start.html#standard-script-heading...tc=ThreatConnect(api_access_id,api_secret_key,api_default_org,api_base_url)# define the ID of the victim we would like to retrievevictim_id=123456# define the ID of the incident we would like to disassociate from the victimincident_id=654321# create a victims objectvictims=tc.victims()# set a filter to retrieve the victim with the id: 123456filter1=victims.add_filter()filter1.add_id(victim_id)try:# retrieve the Victimsvictims.retrieve()exceptRuntimeErrorase:print('Error: {0}'.format(e))sys.exit(1)# iterate through the Victimsforvictiminvictims:print(victim.name)# remove the association between this victim and the incidentvictim.disassociate_group(ResourceType.INCIDENTS,incident_id)# commit the changes to ThreatConnectvictim.commit()

Note

In the prior example, no API calls are made until the commit() method is invoked.

The code snippet below demonstrates how to retrieve the attributes from a Victim. This example assumes there is a Victim with an ID of 123456 in the target owner. To test this code snippet, change the victim_id variable to the ID of a victim in your owner.

# replace the line below with the standard, TC script heading described here:# https://docs.threatconnect.com/en/latest/python/quick_start.html#standard-script-heading...tc=ThreatConnect(api_access_id,api_secret_key,api_default_org,api_base_url)# define the ID of the victim we would like to retrievevictim_id=123456# create a victims objectvictims=tc.victims()# set a filter to retrieve the victim with the id: 123456filter1=victims.add_filter()filter1.add_id(victim_id)try:# retrieve the Victimsvictims.retrieve()exceptRuntimeErrorase:print('Error: {0}'.format(e))sys.exit(1)# iterate through the Victimsforvictiminvictims:print(victim.name)# load the victim's attributesvictim.load_attributes()forattributeinvictim.attributes:print(attribute.id)print(attribute.type)print(attribute.value)print(attribute.date_added)print(attribute.last_modified)print(attribute.displayed)print('')

The code snippet below demonstrates how to create an attribute on a Victim. This example assumes there is a Victim with an ID of 123456 in the target owner. To test this code snippet, change the victim_id variable to the ID of a victim in your owner.

# replace the line below with the standard, TC script heading described here:# https://docs.threatconnect.com/en/latest/python/quick_start.html#standard-script-heading...tc=ThreatConnect(api_access_id,api_secret_key,api_default_org,api_base_url)# define the ID of the victim we would like to retrievevictim_id=123456# create a victims objectvictims=tc.victims()# set a filter to retrieve the victim with the id: 123456filter1=victims.add_filter()filter1.add_id(victim_id)try:# retrieve the Victimsvictims.retrieve()exceptRuntimeErrorase:print('Error: {0}'.format(e))sys.exit(1)# iterate through the Victimsforvictiminvictims:print(victim.name)# add a description attribute that is displayed at the top of the victim's page in ThreatConnectvictim.add_attribute('Description','Description Example',True)# add a description attribute that is not displayed at the top of the victim's page in ThreatConnectvictim.add_attribute('Description','Description Example')# commit the changesvictim.commit()

Note

In the prior example, no API calls are made until the commit() method is invoked.

The code snippet below demonstrates how to update a Victim’s attribute. This example assumes there is a Victim with an ID of 123456 in the target owner. To test this code snippet, change the victim_id variable to the ID of a victim in your owner.

# replace the line below with the standard, TC script heading described here:# https://docs.threatconnect.com/en/latest/python/quick_start.html#standard-script-heading...tc=ThreatConnect(api_access_id,api_secret_key,api_default_org,api_base_url)# define the ID of the victim we would like to retrievevictim_id=123456# create a victims objectvictims=tc.victims()# set a filter to retrieve the victim with the id: 123456filter1=victims.add_filter()filter1.add_id(victim_id)try:# retrieve the Victimsvictims.retrieve()exceptRuntimeErrorase:print('Error: {0}'.format(e))sys.exit(1)# iterate through the Victimsforvictiminvictims:print(victim.name)# load the victim's attributesvictim.load_attributes()# iterate through the victim's attributesforattributeinvictim.attributes:print(attribute.id)# if the current attribute is a description attribute, update the value of the descriptionifattribute.type=='Description':victim.update_attribute(attribute.id,'Updated Description')# commit the changesvictim.commit()

Note

In the prior example, no API calls are made until the commit() method is invoked.

The code snippet below demonstrates how to delete a Victim’s attribute. This example assumes there is a Victim with an ID of 123456 in the target owner. To test this code snippet, change the victim_id variable to the ID of a victim in your owner.

# replace the line below with the standard, TC script heading described here:# https://docs.threatconnect.com/en/latest/python/quick_start.html#standard-script-heading...tc=ThreatConnect(api_access_id,api_secret_key,api_default_org,api_base_url)# define the ID of the victim we would like to retrievevictim_id=123456# create a victims objectvictims=tc.victims()# set a filter to retrieve the victim with the id: 123456filter1=victims.add_filter()filter1.add_id(victim_id)try:# retrieve the Victimsvictims.retrieve()exceptRuntimeErrorase:print('Error: {0}'.format(e))sys.exit(1)# iterate through the Victimsforvictiminvictims:print(victim.name)# load the victim's attributesvictim.load_attributes()# iterate through the victim's attributesforattributeinvictim.attributes:print(attribute.id)# if the current attribute is a description attribute, delete itifattribute.type=='Description':victim.delete_attribute(attribute.id)# commit the changesvictim.commit()

Note

In the prior example, no API calls are made until the commit() method is invoked.

The code snippet below demonstrates how to retrieve the security label from a Victim. This example assumes there is a Victim with an ID of 123456 in the target owner. To test this code snippet, change the victim_id variable to the ID of a victim in your owner.

# replace the line below with the standard, TC script heading described here:# https://docs.threatconnect.com/en/latest/python/quick_start.html#standard-script-heading...tc=ThreatConnect(api_access_id,api_secret_key,api_default_org,api_base_url)# define the ID of the victim we would like to retrievevictim_id=123456# create a victims objectvictims=tc.victims()# set a filter to retrieve the victim with the id: 123456filter1=victims.add_filter()filter1.add_id(victim_id)try:# retrieve the Victimsvictims.retrieve()exceptRuntimeErrorase:print('Error: {0}'.format(e))sys.exit(1)# iterate through the Victimsforvictiminvictims:print(victim.name)# load the victim's security labelvictim.load_security_label()# if this victim has a security label, print some information about the sec. labelifvictim.security_labelisnotNone:print(victim.security_label.name)print(victim.security_label.description)print(victim.security_label.date_added)print('')

Warning

Currently, the ThreatConnect Python SDK does not support multiple security labels. If a Victim has multiple security labels, the Python SDK will only return one of them.

The code snippet below demonstrates how to add a security label to a Victim. This example assumes there is a Victim with an ID of 123456 in the target owner. To test this code snippet, change the victim_id variable to the ID of a victim in your owner.

# replace the line below with the standard, TC script heading described here:# https://docs.threatconnect.com/en/latest/python/quick_start.html#standard-script-heading...tc=ThreatConnect(api_access_id,api_secret_key,api_default_org,api_base_url)# define the ID of the victim we would like to retrievevictim_id=123456# create a victims objectvictims=tc.victims()# set a filter to retrieve the victim with the id: 123456filter1=victims.add_filter()filter1.add_id(victim_id)try:# retrieve the Victimsvictims.retrieve()exceptRuntimeErrorase:print('Error: {0}'.format(e))sys.exit(1)# iterate through the Victimsforvictiminvictims:print(victim.name)# add the 'TLP Green' label to the victimvictim.add_security_label('TLP Green')# commit the victim with the new security label to ThreatConnectvictim.commit()

Note

In the prior example, no API calls are made until the commit() method is invoked.

The code snippet below demonstrates how to delete a security label from a Victim. This example assumes there is a Victim with an ID of 123456 in the target owner. To test this code snippet, change the victim_id variable to the ID of a victim in your owner.

# replace the line below with the standard, TC script heading described here:# https://docs.threatconnect.com/en/latest/python/quick_start.html#standard-script-heading...tc=ThreatConnect(api_access_id,api_secret_key,api_default_org,api_base_url)# define the ID of the victim we would like to retrievevictim_id=123456# create a victims objectvictims=tc.victims()# set a filter to retrieve the victim with the id: 123456filter1=victims.add_filter()filter1.add_id(victim_id)try:# retrieve the Victimsvictims.retrieve()exceptRuntimeErrorase:print('Error: {0}'.format(e))sys.exit(1)# iterate through the Victimsforvictiminvictims:print(victim.name)# remove the 'TLP Green' label from the victimvictim.delete_security_label('TLP Green')# commit the victim with the removed security label to ThreatConnectvictim.commit()

Note

In the prior example, no API calls are made until the commit() method is invoked.

The code snippet below demonstrates how to retrieve the tags from an Incident. This example assumes there is a Victim with an ID of 123456 in the target owner. To test this code snippet, change the victim_id variable to the ID of a victim in your owner.

# replace the line below with the standard, TC script heading described here:# https://docs.threatconnect.com/en/latest/python/quick_start.html#standard-script-heading...tc=ThreatConnect(api_access_id,api_secret_key,api_default_org,api_base_url)# define the ID of the victim we would like to retrievevictim_id=123456# create a victims objectvictims=tc.victims()# set a filter to retrieve the victim with the id: 123456filter1=victims.add_filter()filter1.add_id(victim_id)try:# retrieve the Victimsvictims.retrieve()exceptRuntimeErrorase:print('Error: {0}'.format(e))sys.exit(1)# iterate through the Victimsforvictiminvictims:print(victim.name)# load the victim's tagsvictim.load_tags()# print details about each tag on the victimfortaginvictim.tags:print(tag.name)print(tag.weblink)print('')

The code snippet below demonstrates how to add a tag to a Victim. This example assumes there is a Victim with an ID of 123456 in the target owner. To test this code snippet, change the victim_id variable to the ID of a victim in your owner.

# replace the line below with the standard, TC script heading described here:# https://docs.threatconnect.com/en/latest/python/quick_start.html#standard-script-heading...tc=ThreatConnect(api_access_id,api_secret_key,api_default_org,api_base_url)# define the ID of the victim we would like to retrievevictim_id=123456# create a victims objectvictims=tc.victims()# set a filter to retrieve the victim with the id: 123456filter1=victims.add_filter()filter1.add_id(victim_id)try:# retrieve the Victimsvictims.retrieve()exceptRuntimeErrorase:print('Error: {0}'.format(e))sys.exit(1)# iterate through the Victimsforvictiminvictims:print(victim.name)# add the 'Test' tag to the victimvictim.add_tag('Test')# commit the victim with the new tag to ThreatConnectvictim.commit()

Note

In the prior example, no API calls are made until the commit() method is invoked.

The code snippet below demonstrates how to delete a tag from a Victim. This example assumes there is a Victim with an ID of 123456 in the target owner. To test this code snippet, change the victim_id variable to the ID of a victim in your owner.

# replace the line below with the standard, TC script heading described here:# https://docs.threatconnect.com/en/latest/python/quick_start.html#standard-script-heading...tc=ThreatConnect(api_access_id,api_secret_key,api_default_org,api_base_url)# define the ID of the victim we would like to retrievevictim_id=123456# create a victims objectvictims=tc.victims()# set a filter to retrieve the victim with the id: 123456filter1=victims.add_filter()filter1.add_id(victim_id)try:# retrieve the Victimsvictims.retrieve()exceptRuntimeErrorase:print('Error: {0}'.format(e))sys.exit(1)# iterate through the Victimsforvictiminvictims:print(victim.name)# remove the 'Test' tag from the victimvictim.delete_tag('Test')# commit the victim with the removed tag to ThreatConnectvictim.commit()

Note

In the prior example, no API calls are made until the commit() method is invoked.

Victim Assets are accounts, infrastructure, and equipment that are used by the victim and targeted or exploited by an Adversary Threat. These include email accounts, social network accounts, network accounts, phones, or web sites. They can be associated to an incident, email, or threat as a targeted asset within ThreatConnect.

The example below demonstrates how to pull all Assets for the current Victim Resource from the ThreatConnect platform:

# replace the line below with the standard, TC script heading described here:# https://docs.threatconnect.com/en/latest/python/quick_start.html#standard-script-heading...tc=ThreatConnect(api_access_id,api_secret_key,api_default_org,api_base_url)# instantiate Victims objectvictims=tc.victims()# set a filter to retrieve the Victim with the id: 123456filter1=victims.add_filter()filter1.add_id(123456)try:# retrieve the Victimsvictims.retrieve()exceptRuntimeErrorase:print('Error: {0}'.format(e))sys.exit(1)# iterate through the Victimsforvictiminvictims:print(victim.id)print(victim.name)# retrieve the assets from ThreatConnectvictim.load_assets()# iterate through the Victim's assetsforassetinvictim.assets:print(asset.id)print(asset.name)print(asset.type)print(asset.weblink)print('')

The example below demonstrates how to create Victim Assets for an existing Victim with an ID of 123456:

fromthreatconnect.Config.ResourceTypeimportResourceType# replace the line below with the standard, TC script heading described here:# https://docs.threatconnect.com/en/latest/python/quick_start.html#standard-script-heading...tc=ThreatConnect(api_access_id,api_secret_key,api_default_org,api_base_url)# instantiate Victims objectvictims=tc.victims()# set a filter to retrieve the victim with the id: 123456filter1=victims.add_filter()filter1.add_id(123456)try:# retrieve the Victimsvictims.retrieve()exceptRuntimeErrorase:print('Error: {0}'.format(e))sys.exit(1)# iterate through the Victimsforvictiminvictims:# add email address asset to Victimasset=VictimAssetObject(ResourceType.VICTIM_EMAIL_ADDRESSES)asset.set_address('victim@example.com')asset.set_address_type('Personal')victim.add_asset(asset)# add network account asset to Victimasset=VictimAssetObject(ResourceType.VICTIM_NETWORK_ACCOUNTS)asset.set_account('victim')asset.set_network('victimsareus Active Directory')victim.add_asset(asset)# add phone asset to Victimasset=VictimAssetObject(ResourceType.VICTIM_PHONES)asset.set_phone_type('555-555-5555')victim.add_asset(asset)# add social network asset to Victimasset=VictimAssetObject(ResourceType.VICTIM_SOCIAL_NETWORKS)asset.set_account('@victim')asset.set_network('Twitter')victim.add_asset(asset)# add website asset to Victimasset=VictimAssetObject(ResourceType.VICTIM_WEBSITES)asset.set_website('www.example.com')victim.add_asset(asset)try:# commit the Victim with the new Victim Assetsvictim.commit()exceptRuntimeErrorase:print('Error: {0}'.format(e))sys.exit(1)

Note

In the prior example, no API calls are made until the commit() method is invoked.

The example below demonstrates how to update the Victim Assets of an existing Victim with an ID of 123456:

fromthreatconnect.Config.ResourceTypeimportResourceType# replace the line below with the standard, TC script heading described here:# https://docs.threatconnect.com/en/latest/python/quick_start.html#standard-script-heading...tc=ThreatConnect(api_access_id,api_secret_key,api_default_org,api_base_url)# instantiate Victims objectvictims=tc.victims()# set a filter to retrieve the Victim with the id: 123456filter1=victims.add_filter()filter1.add_id(123456)try:# retrieve the Victimsvictims.retrieve()exceptRuntimeErrorase:print('Error: {0}'.format(e))sys.exit(1)# iterate through the Victimsforvictiminvictims:print(victim.id)print(victim.name)# retrieve the assets from ThreatConnectvictim.load_assets()# iterate through the Victim's assetsforassetinvictim.assets:# if the asset is an email address asset, update itifasset.type=='EmailAddress':# create a new Victim asset objectnew_asset=VictimAssetObject(ResourceType.VICTIM_EMAIL_ADDRESSES)new_asset.set_address('victim2@example.com')new_asset.set_address_type('Personal')# update the existing asset with the new onevictim.update(asset.id,new_asset)try:# commit the Victim with the updated Victim Assetvictim.commit()exceptRuntimeErrorase:print('Error: {0}'.format(e))sys.exit(1)

Note

In the prior example, no API calls are made until the commit() method is invoked.

The example below demonstrates how to delete Victim Assets from an existing Victim with an ID of 123456:

# replace the line below with the standard, TC script heading described here:# https://docs.threatconnect.com/en/latest/python/quick_start.html#standard-script-heading...tc=ThreatConnect(api_access_id,api_secret_key,api_default_org,api_base_url)# instantiate Victims objectvictims=tc.victims()# set a filter to retrieve the Victim with the id: 123456filter1=victims.add_filter()filter1.add_id(123456)try:# retrieve the Victimsvictims.retrieve()exceptRuntimeErrorase:print('Error: {0}'.format(e))sys.exit(1)# iterate through the Victimsforvictiminvictims:print(victim.id)print(victim.name)# retrieve the assets from ThreatConnectvictim.load_assets()# iterate through the Victim's assetsforassetinvictim.assets:# if the asset is a phone number asset, delete itifasset.type=='Phone':victim.delete(asset.id,asset)try:# commit the Victim with the Victim Asset(s) deletedvictim.commit()exceptRuntimeErrorase:print('Error: {0}'.format(e))sys.exit(1)

Note

In the prior example, no API calls are made until the commit() method is invoked.