POST /jobs/{jobId}/cancel
Ask an analytical job to stop; what already ran is charged, the rest is released.
Syntax
POST https://grid-lab.zyxio.xyz/jobs/<jobId>/cancel
x-api-key: <key>
Request
| Name | Where | Required | Meaning |
|---|---|---|---|
x-api-key | header | yes, or Authorization | Your API key, or Authorization: Bearer <token> from Zyxio sign-in. |
jobId | path | yes | An analytical job's cj_ id. Capture items cannot be cancelled. |
No body.
Response
200 OK with the job's record, cancellation recorded. The job reaches CANCELLED once its container has stopped; poll GET /jobs/{jobId}.
Cancelling a job that has already finished also answers 200 OK with its record: a SUCCEEDED or CANCELLED job, or one already being cancelled, is returned unchanged; a FAILED or TIMED_OUT job keeps its phase and records the cancellation, which stops an automatic replay that was still to come (see retries on POST /jobs).
Errors
| Status | Body | When | What to do |
|---|---|---|---|
401 | {"error": "unauthorized"} | No credential, or a key that is revoked, expired, wrong, or of a suspended account. | Send a valid key. |
503 | {"error": "accounting_unavailable"} | Your key or Zyxio sign-in could not be checked because the account database did not answer in time. Nothing was done. | Retry shortly; the same request is safe to resend. |
403 | {"error": "forbidden"} | A valid Zyxio sign-in token whose identity has no account here, or whose account is suspended. | Accept your invitation first, or use a key. |
404 | {"error": "unknown job"} | No such job, a capture item's id, or a job of another identity. | Check the id. |
409 | {"error": "JOB_STATE_CONFLICT"} | The job's record changed under the call in a way it could not follow. Rare. | Read the job with GET /jobs/{jobId}, then cancel again if it still runs. |
503 | {"error": "COMPUTE_UNAVAILABLE"} | Job tracking is not ready. | Retry after the retry-after seconds. |
Example
curl -s -X POST https://grid-lab.zyxio.xyz/jobs/cj_0123456789abcdef0123456789abcdef/cancel \
-H "x-api-key: $BROWSERGRID_API_KEY"
Billing
The call is free. The cancelled attempt ends in class cancelled and is charged for the time its container ran, rounded once to the micro-euro; an attempt that had not started its container costs nothing. Further retries do not run, and the rest of the job's reservation returns to your available credit. Both appear within one settlement interval (30 seconds) of the attempt ending.