Edit Assets in a site via API insightvm

Hello All,

I am trying to edit the assets in a site with the API. I see you are able to delete them all out and able to modify the site. In the documentation it does not describe how to edit the assets included in the site with a PUT request. I see when you are creating a site with the POST request you can add in the assets under the scan body. If there is anything else out there where I can add in assets to an existing site via the API that would be great.

Thanks,
Jacob

:wave: What you’re looking for are the PUT endpoints for included targets and asset groups: https://help.rapid7.com/insightvm/en-us/api/index.html#operation/updateIncludedTargets

One thing to note is that since it’s a PUT and not a PATCH endpoint that this will replace everything in the scope. If you’re looking to just add to the scope you’ll need to first retrieve the current scope via the GET endpoint and then add your updates to that list as part of your request to the PUT endpoint.

Okay. I see what to use now. Thank you for pointing me in the right direction. @tyler_schmidtke