---
title: "Cancel run"
method: POST
path: "/api/v1/tools/cancel_run"
---

# Cancel run

`POST /api/v1/tools/cancel_run`

## Request

- Base URL: `https://www.trezalabs.com`
- URL: `https://www.trezalabs.com/api/v1/tools/cancel_run`
- Auth: HTTP bearer

Stop a run that is still going: one run_pipeline, assemble_video or edit_asset started. Use it when the person asks to cancel, stop or kill a render, including "stop, that's wrong" about one they can see running. A render that is rendering stops once its current step finishes (status "cancelling", then "cancelled" in get_run); one still waiting to start is closed at once and costs nothing. Steps that already finished keep their output and are not refunded. Leave out runId to cancel the pipeline's newest running run. Needs the pipelines:run scope.

## Request body

- object
  - `pipelineId` string, required: The pipelineId the run was started under (for assemble_video and edit_asset, the one they returned).
  - `runId` string: The run to stop. Omit for the newest run still going.

## Response `200`

The tool's result.

- object

## Other responses

- `400`: The arguments were refused. `error` says why.
- `401`: No API key, or one that is not valid.
- `402`: The credit balance does not cover this run.
- `403`: The API key lacks a permission this tool needs.
- `404`: No such tool, or the pipeline, run or asset is not on this account.
- `429`: Too many runs started or in progress. Wait, then try again.

---

[API](https://skmtc.dev/trezalabs/apis/treza-pipelines-api.md) · [All operations](https://skmtc.dev/trezalabs/apis/treza-pipelines-api/llms.txt) · [OpenAPI document](https://skmtc.dev/trezalabs/apis/treza-pipelines-api/revisions/a76574c1731b?raw)
