Documentation Index
Fetch the complete documentation index at: https://docs.praison.ai/llms.txt
Use this file to discover all available pages before exploring further.
Delete an async job and all associated data. This operation is permanent.
The unique job identifier (e.g., run_abc123).
Response
Returns 204 No Content on successful deletion.
curl -X DELETE http://127.0.0.1:8005/api/v1/runs/run_abc123
Deletion Behavior
- Completed jobs: Can be deleted immediately
- Cancelled jobs: Can be deleted immediately
- Running jobs: Must be cancelled first before deletion
- Queued jobs: Must be cancelled first before deletion
Example: Cancel and Delete
import httpx
API_URL = "http://127.0.0.1:8005"
def force_delete_job(job_id):
# First, try to cancel if running
status = httpx.get(f"{API_URL}/api/v1/runs/{job_id}").json()
if status["status"] in ("queued", "running"):
print(f"Cancelling job {job_id}...")
httpx.post(f"{API_URL}/api/v1/runs/{job_id}/cancel")
# Now delete
response = httpx.delete(f"{API_URL}/api/v1/runs/{job_id}")
if response.status_code == 204:
print(f"Job {job_id} deleted successfully")
return True
else:
print(f"Failed to delete: {response.json()}")
return False
force_delete_job("run_abc123")
Error Responses
| Status | Description |
|---|
400 | Cannot delete running/queued job |
404 | Job not found |
500 | Internal server error |
See Also