---
title: "Cancel a job"
method: POST
path: "/preview/jobs/{id}/cancel"
tags: ["jobs"]
---

# Cancel a job

`POST /preview/jobs/{id}/cancel`

## Request

- Base URL: `https://autoresearch.sfcompute.com`
- URL: `https://autoresearch.sfcompute.com/preview/jobs/{id}/cancel`
- Auth: HTTP bearer

Cancel a job. SCOPE: one of your own batch jobs in your own workspace - never end-user data, another tenant, or a production system. Stopping a run whose answer you already have, or one that is clearly failing, is the routine and expected call: it stops the meter, and the job's record and logs stay readable through get_job (logs live 30 days). Returns immediately with status `canceling`; a running attempt is stopped (and billed up to the stop), a queued or building job stops for free. Cancelling a task set's job stops every machine working the set. Idempotent: canceling an already-finished job is a no-op. Cancel because you no longer want the RESULT - never because the queue is deep: queued time is free, and a sustained backlog for a shape is what raises the fleet's procurement target for it, so cancelling withdraws the demand that was starting the machines that would have drained the queue. The wait gets longer, not shorter. To stop paying attention rather than stop the work, leave it queued (it holds its place for queue_ttl_minutes) and poll get_job on a relaxed cadence.

## Path parameters

- `id` string, required: Job id from submit_job (e.g. "job-8x2mf").

## Query parameters

- `workspace` string

## Response `200`

The capability's JSON result.

- Result: The capability's result: the same object the MCP tool returns as structuredContent. Resources carry an `object` type discriminator and an immutable id; money is integer micro-dollars in `*_usd_micros` fields.
  - `object` string: The resource type, when the result is one resource.

## Other responses

- `400`: Malformed request: bad JSON, a parameter that does not parse, or a value outside its range. Code `invalid`.
- `401`: No bearer token, or one this API cannot verify. Code `unauthenticated`.
- `403`: Authenticated, but the token's scopes or the account's role do not reach this operation. The message names the scope word to request. Code `forbidden`.
- `404`: No such route. Code `not_found`; the body names the OpenAPI document.
- `422`: A well-formed request the platform declined: no such node, a cap reached, a state that forbids the move. The message says which, and what to do instead. Code `refused`.
- `429`: Over this door's per-customer budget. Wait `Retry-After` seconds. Code `rate_limited`.
- `500`: Our fault. Retry; if it persists, quote the request-id. Code `internal`.

---

[API](https://skmtc.dev/givemeanode/apis/autoresearch-customer-api.md) · [All operations](https://skmtc.dev/givemeanode/apis/autoresearch-customer-api/llms.txt) · [OpenAPI document](https://skmtc.dev/givemeanode/apis/autoresearch-customer-api/revisions/f88dcb70ac6c?raw)
