Minerva API
API referenceJobs

Cancel an async job

POST/jobs/{jobId}/cancel

Cancel an extraction or preprocess job. Extraction jobs mark still-pending/running documents cancelled. Preprocess cancellation is best-effort per document: each per-document cancel is attempted independently and individual failures are logged and swallowed, so a 200 does not guarantee every document reached cancelled — some may still report in_progress. Re-read the job to confirm. Returns the same job envelope as GET /jobs/{jobId}, now with status cancelled (extraction jobs with at least one successful document instead settle as completed_with_failures). Idempotent in that it never errors on an already-terminal job — it returns the current envelope (note: re-cancelling an extraction session re-stamps its completedAt, so a repeat call can shift the reported duration). A forged / unknown / cross-org / no-job handle returns 404 (no existence oracle), matching GET.

Requires an API key with one of these roles: admin, editor.

Authorization

bearerAuth
AuthorizationBearer <token>

An API key created in Settings → API Keys.

In: header

Path Parameters

jobId*string

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/jobs/string/cancel"
{  "data": {    "id": "string",    "type": "preprocess",    "status": "queued",    "progress": {      "done": 0,      "total": 0,      "failed": 0    },    "result": {},    "error": "string",    "createdAt": "2019-08-24T14:15:22Z",    "duration": 0,    "fileName": "string",    "numPages": 0,    "totalPages": 0,    "reference": {      "property1": "string",      "property2": "string"    }  },  "meta": {    "requestId": "string",    "timestamp": "string"  }}