# Note: You need to first fetch the treatment IDs# (Dcycle API doesn't have a list endpoint for treatments yet)treatment_ids_to_delete = [ "treatment-uuid-1", "treatment-uuid-2", "treatment-uuid-3"]for treatment_id in treatment_ids_to_delete: response = requests.delete( f"https://api.dcycle.io/api/v1/waste_water_treatments/{treatment_id}", headers=headers ) if response.status_code == 204: print(f"β Deleted: {treatment_id}") else: print(f"β Failed to delete: {treatment_id}")
Always confirm deletion, especially for production data:
Copy
treatment_id = "treatment-uuid"# Get treatment details first (if you have the data)print(f"About to delete treatment: {treatment_id}")# Confirmconfirmed = True # Replace with actual user confirmationif confirmed: response = requests.delete( f"https://api.dcycle.io/api/v1/waste_water_treatments/{treatment_id}", headers=headers )