---
title: "Cancel Run"
method: POST
path: "/api/screen-bulk/{run_id}/cancel"
tags: ["screening"]
---

# Cancel Run

`POST /api/screen-bulk/{run_id}/cancel`

## Request

- Base URL: `https://api.halalterminal.com`
- URL: `https://api.halalterminal.com/api/screen-bulk/{run_id}/cancel`
- Auth: API key in header `X-API-Key`

Cancel a running bulk screening job.

Stops the specified run gracefully. Results already collected are
preserved and can still be queried. Returns the run status at the time
of cancellation.

**curl example:**
```bash
curl -X POST "https://api.halalterminal.com/api/screen-bulk/abc123/cancel" \
     -H "X-API-Key: <API_KEY>"
```

**Python requests example:**
```python
import requests

resp = requests.post(
    "https://api.halalterminal.com/api/screen-bulk/abc123/cancel",
    headers={"X-API-Key": "<API_KEY>"},
)
print(resp.json())
```

## Path parameters

- `run_id` string, required: Bulk-run ID returned by POST /api/screen-bulk.

## Response `200`

Confirmation that the run has been cancelled

- CancelResponse
  - `run_id` string, required
  - `status` string, required
  - `done` integer, required: Number of symbols that were screened before cancellation
  - `total` integer, required: Total number of symbols that were queued

## Other responses

- `400`: Invalid request parameters
- `401`: API key required or invalid
- `404`: Resource or symbol not found
- `422`: Validation Error
- `429`: Quota exceeded

---

[API](https://skmtc.dev/halalterminal/apis/halal-terminal-api.md) · [All operations](https://skmtc.dev/halalterminal/apis/halal-terminal-api/llms.txt) · [OpenAPI document](https://skmtc.dev/halalterminal/apis/halal-terminal-api/revisions/78768b250943?raw)
