---
title: "cancel_job_run"
description: "Generated reference for the management action cancel_job_run: its description, access metadata, payload contract, and registration status."
slug: /reference/actions/cancel-job-run
order: 77
visibility: public
redirects_from: []
---

# cancel\_job\_run

Generated automatically from the [published contract sources](/cloud/reference/about/#contract-sources).

A script calls this action over HTTPS at `POST https://tzcloud.dev.turnzero.ai/v1/cancel_job_run`, with a bearer credential and the action's payload as the JSON body. An MCP connection lists this action as the tool `tzcloud_cancel_job_run`.

OAuth access tokens and minted tokens, including the turnzero command's computer token, are bearer credentials. The action determines which kinds, scopes and grants it accepts ([Sign-in, sessions, and tokens](/cloud/concepts/sign-in-sessions-and-tokens/)).

**Build metadata:** Registered in this build. Registration describes the default dispatcher in this build. It does not guarantee that a caller has the required credential or grant, that a tool is listed for that connection, or that the required service is configured.

## Contract description

Cancel your job run\. The service records an unfinished run as `cancelled`\. If the run has already ended, the response shows its recorded outcome\.

## More about this action

If a database size change or restore cannot start while a job runs, wait for the run to finish\. A run that succeeds or fails with the provider's execution recorded stops blocking the database request when it ends\. Cancelling a run before its timeout does not shorten this wait and can lengthen it\. Cancel only if the owner authorizes it\.

`cancelled` records the result in Turn Zero\. The provider may still be stopping the container\. If the provider stop fails, a later pass tries again\. Read the run's outcome and check any data it may have written before repeating the work\.

A run that Cloud began starting can still block the database request if it was cancelled, timed out or ended without a recorded provider execution\. The block lasts until more than the run's timeout plus 90 seconds have passed since Cloud began starting it\. For a retry estimate, add the job's timeout for that run plus three minutes to `requested_at`\. Follow the database action's approval instructions\.

## Access and action metadata

```json
{
  "name": "cancel_job_run",
  "resource": "application",
  "tier": "reversible",
  "surface": "tzcloud",
  "addresses": [
    "tzcloud"
  ],
  "product": "cloud",
  "summary": "Cancel one unfinished job run. If the run has already ended, the response returns its current record. Use `read_job_runs` to check the recorded outcome. The service can record cancellation before the provider confirms the stop.",
  "annotations": {
    "readOnlyHint": false,
    "destructiveHint": true,
    "openWorldHint": true
  }
}
```

## MCP catalog entry

```json
{
  "name": "cancel_job_run",
  "title": "Cancel a job run",
  "tier": "reversible",
  "scenario": "CHI-L0-09",
  "summary": "Cancel your job run. The service records an unfinished run as `cancelled`. If the run has already ended, the response shows its recorded outcome.",
  "owners": [
    "JOB-L0-05",
    "MAPI-04"
  ]
}
```

## request

| JSON pointer | Description and constraints |
|---|---|
| "" \(root\) | Type: object<br>Required fields: \["application","run"\] |
| /<wbr>properties/<wbr>application | The application ID from `list_applications`\.<br><br>Type: string |
| /<wbr>properties/<wbr>run | A run ID from `run_job` or `read_job_runs`\.<br><br>Type: string |

## response

| JSON pointer | Description and constraints |
|---|---|
| "" \(root\) | Type: object<br>Required fields: \["contract\_version","run","detail"\] |
| /<wbr>properties/<wbr>contract\_version | Required value: 1 |
| /<wbr>properties/<wbr>reference | The ten\-character call reference\. Include it if you report a problem\.<br><br>Type: string<br>Pattern: ^\[0\-9a\-f\]\{10\}$ |
| /<wbr>properties/<wbr>run | $ref: \#/shapes/job\_run |
| /<wbr>properties/<wbr>detail | A short explanation of the result\.<br><br>Type: string |

## Complete payload contract

```json
{
  "request": {
    "type": "object",
    "required": [
      "application",
      "run"
    ],
    "properties": {
      "application": {
        "type": "string",
        "description": "The application ID from `list_applications`."
      },
      "run": {
        "type": "string",
        "description": "A run ID from `run_job` or `read_job_runs`."
      }
    }
  },
  "response": {
    "type": "object",
    "required": [
      "contract_version",
      "run",
      "detail"
    ],
    "properties": {
      "contract_version": {
        "const": 1
      },
      "reference": {
        "type": "string",
        "pattern": "^[0-9a-f]{10}$",
        "description": "The ten-character call reference. Include it if you report a problem."
      },
      "run": {
        "$ref": "#/shapes/job_run"
      },
      "detail": {
        "type": "string",
        "description": "A short explanation of the result."
      }
    }
  }
}
```

## Shared contracts

- [Refusals](/cloud/reference/refusals/): every refusal, by surface, with its cause and its remedy
- [schemas/wire\_error\.schema\.json](/cloud/reference/sources/schemas/wire-error-schema/)
- [schemas/wire\_errors\.json](/cloud/reference/sources/schemas/wire-errors/)
- [schemas/action\_payloads\.json](/cloud/reference/sources/schemas/action-payloads/) (includes shared shapes)
- [management\_api\_contract\.md](/cloud/reference/sources/management-api-contract/)
