---
title: "Cancel a running async query job."
method: DELETE
path: "/v1/data/query/jobs/{jobId}"
tags: ["data"]
---

# Cancel a running async query job.

`DELETE /v1/data/query/jobs/{jobId}`

## Request

- Base URL: `http://localhost:8080`
- URL: `http://localhost:8080/v1/data/query/jobs/{jobId}`
- Auth: one of:
  - API key in cookie `dvt_session`
  - HTTP bearer

Cancels a running job by calling the engine's stateless `/internal/query/cancel`
endpoint, then transitions the job to `status: canceled` (DVT-708, ADR-0050).
Idempotent — a DELETE on an already-terminal job returns the current terminal
status. Same AUTHZ binding as `GET /v1/data/query/jobs/{jobId}`.

## Path parameters

- `jobId` string, uuid, required

## Response `200`

Job canceled (or already terminal — returns current status).

- object
  - `data` object, required
    - `status` 'running' | 'succeeded' | 'failed' | 'canceled', required: The job's status after the cancel attempt.
  - `meta` Meta, required: Response metadata.
    - `requestId` string, required: Correlates with the X-Request-Id header.
    - `total` integer: Item count, present on collection responses.
    - `nextCursor` string, nullable: Opaque keyset-pagination cursor, present on paginated responses (e.g. GET /v1/dashboards) when more rows exist beyond this page. Pass it back as the `cursor` query param to fetch the next page; absent or null on the last page.
    - `roleResolveDegraded` boolean: Snowflake mode only (DVT-2260), on GET /v1/dashboards: present and true when the caller's live Snowflake role resolution failed or was unavailable — role-shared dashboards may be missing from this page. Omitted (not merely false) whenever resolution succeeded or the role-share arm does not apply (off snowflake mode, an org admin/owner, or off the ingress listener).

## Other responses

- `401`: Missing, invalid, or expired session.
- `404`: Job not found, or the caller's identity does not match the submitter's (indistinguishable).
- `502`: The analytics engine could not be reached (`https://docs.dvt.dev/errors/engine-unavailable`) or returned an error (`https://docs.dvt.dev/errors/engine-error`). One 502 on this shape is NOT an engine fault and says so: when Snowflake refuses the caller's-rights LOGIN, the Problem type is `https://docs.dvt.dev/errors/caller-connect-refused` — no session was established and the caller's SQL was never reached, so the remediation is a fresh dvt session rather than the engine logs (DVT-4345).

---

[API](https://skmtc.dev/dvt/apis/dvt-rest-api.md) · [All operations](https://skmtc.dev/dvt/apis/dvt-rest-api/llms.txt) · [OpenAPI document](https://skmtc.dev/dvt/apis/dvt-rest-api/revisions/00016f504165?raw)
