---
title: "Stop a queued or running import (owner/admin)"
method: POST
path: "/v1/projects/{project_id}/imports/{job_id}/cancel"
tags: ["imports"]
---

# Stop a queued or running import (owner/admin)

`POST /v1/projects/{project_id}/imports/{job_id}/cancel`

## Request

- Base URL: `https://api.wavehouse.cloud`
- URL: `https://api.wavehouse.cloud/v1/projects/{project_id}/imports/{job_id}/cancel`
- Auth: one of:
  - API key in cookie `whc_session`
  - HTTP bearer
  - API key in header `X-API-Key`

Stops the transfer for real: the in-flight `INSERT … SELECT FROM s3(…)` is KILLed on the engine rather than merely marked cancelled, so it stops consuming resources immediately. `killed_statements` reports how many were actually stopped (0 is normal if the job was between statements). IDEMPOTENT: cancelling an already-finished import returns 200 with `cancelled: false`. NOTHING IS ROLLED BACK — an import is not a transaction, so tables it already created still exist and rows it already loaded are still there. The job's final `cancelled` step names exactly what was created and loaded; TRUNCATE or DROP what you do not want. We deliberately do NOT drop those tables for you: one of them may be a table you already had.

## Path parameters

- `project_id` string, required
- `job_id` string, required

## Response `200`

OK

- CancelProjectImportOutput
  - `cancelled` boolean, required: false means the job had already finished and nothing was stopped — not an error
  - `import` ImportJobView, required
    - `attempt` integer, required
    - `bytes_done` integer, required
    - `cancel_requested` boolean
    - `created_at` string, date-time, required
    - `finished_at` string, date-time
    - `job_id` string, required
    - `last_error` string
    - `max_attempts` integer, required
    - `path` string
    - `query_id` string: the engine query_id of the statement most recently issued for this job
    - `rows_done` integer, required
    - `started_at` string, date-time
    - `status` string, required: queued | running | succeeded | failed | dead | cancelled
    - `steps` ImportStepView[]
      - `detail` string
      - `done_at` string, date-time
      - `name` string, required: create:<table>, load:<table>/<object>, verify:<table>, or the terminal cancelled step
      - `status` string, required: pending | done | failed
    - `tables` string[]
    - `updated_at` string, date-time, required
  - `kill_error` string: set when the engine could not be asked to stop the statement; the job is still cancelled and the worker will stop it, just less promptly
  - `killed_statements` integer, required: in-flight ClickHouse statements stopped by this call; 0 is normal (the job may have been between statements)

## Other responses

- `429`: Rate limited, per client IP, API key or org; a client IP is also refused on every route for a while after repeated authentication failures. A limited operation carries RateLimit-Policy and RateLimit on every response; wait Retry-After seconds before retrying.
- `default`: Error

---

[API](https://skmtc.dev/wavehouse/apis/wavehouse-cloud-api.md) · [All operations](https://skmtc.dev/wavehouse/apis/wavehouse-cloud-api/llms.txt) · [OpenAPI document](https://skmtc.dev/wavehouse/apis/wavehouse-cloud-api/revisions/adea029bf505?raw)
