---
title: "Cancel a check run"
method: POST
path: "/v25-10-beta/agentic-logic/rules/{ruleId}/cancel-checks"
tags: ["Agentic Logic"]
---

# Cancel a check run

`POST /v25-10-beta/agentic-logic/rules/{ruleId}/cancel-checks`

## Request

- Base URL: `https://api.intelligems.io`
- URL: `https://api.intelligems.io/v25-10-beta/agentic-logic/rules/{ruleId}/cancel-checks`
- Auth: API key in header `intelligems-access-token`
- TypeScript: <https://skmtc.dev/intelligems/apis/intelligems-external-api-v25-10-beta/docs/v25-10-beta/agentic-logic/rules/:ruleId/cancel-checks/post.ts> (a function with typed inputs; its response is checked against the schema)

```http
POST /v25-10-beta/agentic-logic/rules/{ruleId}/cancel-checks
```

Stops the check run a job belongs to. It works on jobs of either `mode`: a
`dry_run`, including one started by run-gates, or a `publish`.

- `publishJobId` (uuid, required) — The job to cancel. It must belong to the
  rule; an unknown job answers 404.

The cancel is live when the named job is still `queued` or `running`, or when
the rule's AI repair run is working that job. A live cancel stops all of these
in one transaction:

- the named job, if it is still in flight;
- the rule's live repair run, which ends `abandoned` and starts no further
  attempts;
- every other `queued` or `running` job of the rule, publish or dry run.

Cancelled jobs end `cancelled`. Gates that were mid-run go back to `pending`;
finished gates keep their results. A `publish` job cancelled before it promotes
creates no version and leaves the active version unchanged.

The response is `{ job, cancelled }`. `job` is the named job after the request,
in the [poll](#poll-a-publish-job) shape. `cancelled` is `true` when this
request stopped anything. A `failed` job whose repair run this request stopped
stays `failed`, with `cancelled: true`.

`cancelled` is `false` when the named job had already finished (`succeeded`,
`failed`, or `cancelled`) and no repair run is working it. Nothing changes
then, and other jobs of the rule keep running. Repeating a cancel is safe. A
`succeeded` publish is not undone; use `rollback` for that.

Use the `intelligems-access-token` header. The token selects the organization; do not send `orgId`. The organization must have Agentic Logic enabled.

**Rate Limit:** 50 requests per 30s window, refilling 25 tokens every 30s.

## Path parameters

- `ruleId` string, uuid, required

## Request body

- object
  - `publishJobId` string, uuid, required

## Response `200`

OK

- object
  - `job` object, required: One publish job: the async unit that runs the gate pipeline against a frozen draft snapshot and, in publish mode, promotes a new active version on success.
    - `id` string, required: Publish-job id (uuid) — the handle returned by the publish endpoint.
    - `ruleId` string, required: Rule the job publishes (uuid).
    - `status` 'queued' | 'running' | 'succeeded' | 'failed' | 'cancelled', required: 'queued' | 'running' | 'succeeded' | 'failed'.
    - `mode` 'publish' | 'dry_run', required: 'publish' (runs every gate and promotes a version on success) | 'dry_run' (validation gates only, never promotes). What the job IS — a reader cannot infer it from status while the job is still in flight.
    - `startedAtTs` number, nullable, required: Worker start time, Unix epoch-ms; null while queued.
    - `finishedAtTs` number, nullable, required: Terminal time, Unix epoch-ms; null until the job finishes.
    - `resultingVersionId` string, nullable, required: Version the job promoted, when it succeeded in publish mode; null otherwise (and null again if that version is later deleted by retention).
    - `gates` object[], required: Per-gate results, in pipeline order.
      - `gateKey` 'static_contract' | 'deps_locked' | 'org_secrets_resolved' | 'required_tests_passed' | 'bundle_size' | 'runtime_timeout' | 'chain_cost' | 'scan_cost' | 'graph_consistency' | 'ai_tests_generated' | 'ai_tests_passed' | 'user_tests_passed' | 'lambda_deploy', required: Which gate this result belongs to.
      - `status` 'pending' | 'running' | 'passed' | 'failed' | 'warning' | 'blocked', required: 'pending' | 'running' | 'passed' | 'failed' | 'warning' | 'blocked'. 'warning' passes with caveats; 'blocked' means an earlier gate's failure prevented this one from running.
      - `result` string, nullable: Human-readable gate summary, when available.
      - `detailsJson` object, nullable: Structured gate details, when available.
      - `startedAtTs` number, nullable: Gate start time, Unix epoch-ms, when started.
      - `finishedAtTs` number, nullable: Gate finish time, Unix epoch-ms, when finished.
  - `cancelled` boolean, required

## Other responses

- `429`: Too Many Requests

---

[API](https://skmtc.dev/intelligems/apis/intelligems-external-api-v25-10-beta.md) - [All operations](https://skmtc.dev/intelligems/apis/intelligems-external-api-v25-10-beta/llms.txt) - [OpenAPI document](https://skmtc.dev/intelligems/apis/intelligems-external-api-v25-10-beta/revisions/7b769b2f90b1?raw)
