How do you know when import complete when API is called?

when you call the sonarr API is there any way to know when the operation is complete? Eg. I want to trigger the download scan to import manually but want to know when the import is done so I can delete the files.

You’ll need to check the command that is returned when send the import /api/command/{ID} will get you all the info about it.