Hey everyone, I was integrating Hyperproof with our CI/CD pipeline using their API to automatically upload evidence for controls. I hit a weird issue and wanted to share so others don't waste time like I did 😅
If you create or upload evidence for a control via the API, and then someone *also* uploads evidence for that *same* control manually through the Hyperproof UI, you can end up with duplicate evidence entries. It doesn't seem to deduplicate based on the file or content. Now we have some controls with the same file listed twice.
I was using a simple Python script with `requests` to POST to the evidence endpoint. Maybe I'm missing a parameter to check for existing items?
```python
import requests
response = requests.post(
'https://api.hyperproof.com/.../evidence',
headers={'Authorization': 'Bearer TOKEN'},
files={'file': open('compliance_report.pdf', 'rb')},
data={'controlId': 'CONTROL_123'}
)
```
Is there a best practice to avoid this? Like, should I always fetch the evidence list for a control first and check if my file already exists before uploading via API?