Skip to content

GET /jobs/{jobId}

How a piece of background work is getting on

What a 202 Accepted handed back is polled here. The answer is the status, how far along it is where the job can say so, where the result will be, and the code of the last failure - and nothing else the queue row holds. A job belongs to the tenant that asked for it and is answered to that tenant only. A job that belongs to no tenant - the queue's own housekeeping - is answered to nobody here, and is indistinguishable from one that never existed.

Path parameters

NameTypeRequiredDescription
jobIdstring (uuid) required

Responses

Example bash
curl -X GET "$HUBTASK_URL/jobs/{jobId}" \  -H "Authorization: Bearer $HUBTASK_TOKEN"

POST /jobs/{jobId}:cancel

Stop a piece of background work

Cooperative, not a kill: it moves the job to CANCELLED, and a pass that is under way finds at its next write that the job is no longer its own and leaves nothing behind. What a pass already put outside the database - bytes at a backup target, a message handed to a mail server - a cancellation cannot take back. A job that has already finished, failed or been cancelled answers 409: there is nothing left to stop, and pretending otherwise would let a client believe it had prevented something that had already happened.

Path parameters

NameTypeRequiredDescription
jobIdstring (uuid) required

Headers

NameTypeRequiredDescription
Idempotency-Keystring (uuid) optionalA UUID; identical requests return the same result for 24 h.

Responses

  • 200 The job, now cancelled Job
  • 4XX An error per RFC 9457 Problem
Example bash
curl -X POST "$HUBTASK_URL/jobs/{jobId}:cancel" \  -H "Authorization: Bearer $HUBTASK_TOKEN" \  -H "Idempotency-Key: $(uuidgen)"