Cancel Report
Cancels an in-progress report generation.
Endpoint
DELETE /api/reports/:id
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | The report ID to cancel |
Request Example
curl -X DELETE https://api.silentwitness.ai/api/reports/rpt_xyz789 \
-H "X-API-Key: sk-your-api-key"
Response
Success (200 OK)
{
"success": true,
"data": {
"id": "rpt_xyz789",
"status": "cancelled",
"message": "Report generation cancelled"
}
}
Error (404 Not Found)
{
"success": false,
"error": "Report not found"
}
Error (400 Bad Request)
{
"success": false,
"error": "Cannot cancel a completed report"
}
Notes
- Only reports with
pendingorprocessingstatus can be cancelled - Completed reports cannot be cancelled (they can be deleted separately if needed)
- Cancellation stops the underlying Temporal workflow