---
title: "Cancel a running task"
method: POST
path: "/v1/tasks/{id}/cancel"
tags: ["Tasks"]
---

# Cancel a running task

`POST /v1/tasks/{id}/cancel`

## Request

- Base URL: `https://nanostudiopro.com/api`
- URL: `https://nanostudiopro.com/api/v1/tasks/{id}/cancel`
- Auth: HTTP bearer

Marks a `queued` or `running` task as `canceled`. Note: synchronous tasks (everything except video) typically complete in seconds, so the cancel window is narrow. For async provider tasks (video) the cancel propagates to our records but does not abort the external provider's job — you may still be billed by them.

## Path parameters

- `id` string, required

## Response `200`

Task canceled.

- Task: Lifecycle row for an async operation (generations, uploads, scans, exports). Returned by `/v1/tasks` so external clients can poll their jobs the same way the in-app UI does.
  - `id` string
  - `action` 'upload' | 'scan' | 'export' | 'generate': High-level grouping of the operation.
  - `kind` string: Specific operation — e.g. `generate.quick`, `generate.restyle`, `generate.video`, `generate.angles`, `upload`, `scan`, `export`.
  - `status` 'queued' | 'running' | 'complete' | 'failed' | 'canceled'
  - `progress` integer: Best-effort 0-100; many endpoints leave it at 0.
  - `error` string, nullable: User-facing error message if `status=failed`.
  - `label` string, nullable
  - `origin` string, nullable: Where the task was triggered from. `API` for external callers, plus values like `Prompter`, `Card menu`, `Pose editor`.
  - `display_meta` object, nullable: Free-form metadata (aspect ratio, project id, thumbnail path) used by the UI placeholder. Safe for external clients to display verbatim.
  - `intent` object, nullable: Endpoint + body the task originated from. Used internally for retries.
  - `retries` integer: How many retry attempts have been made.
  - `max_retries` integer
  - `provider` object, nullable: External-system tracking for async providers (Kling video, future Runway/Pika/etc.). `null` for synchronous providers like Gemini.
    - `key` string
    - `task_id` string, nullable: External system's job id.
    - `status` string, nullable: Provider-specific status string.
    - `updated_at` string, date-time, nullable
  - `generation_id` string, nullable: FK to the resulting Generation, if applicable.
  - `asset_id` string, nullable: FK to the resulting Asset, if applicable.
  - `scan_result_id` string, nullable
  - `parent_task_id` string, nullable: For batched operations — points to the parent Task.
  - `started_at` string, date-time
  - `completed_at` string, date-time, nullable
  - `created_at` string, date-time

## Other responses

- `400`: Task is already in a terminal state
- `401`: Missing or invalid token
- `404`: Task not found
- `429`: Rate limit exceeded

---

[API](https://skmtc.dev/nanostudiopro/apis/nano-studio-pro-api.md) · [All operations](https://skmtc.dev/nanostudiopro/apis/nano-studio-pro-api/llms.txt) · [OpenAPI document](https://skmtc.dev/nanostudiopro/apis/nano-studio-pro-api/revisions/7f7d4a72b17c?raw)
